From 84e2ce06e9ad5b1a6e780b059ec07d5396e76e8a Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Mon, 28 Aug 2023 21:43:33 +0530 Subject: [PATCH] Modified scripts Aug 23 (#28829) * Newly added semi/automated testcases: TC_GRPKEY_2_1 TC_GRPKEY_2_2 TC_BRBINFO_2_1 TC_DGGEN_2_1 TC_DGGEN_2_3 TC_FAN_2_5 TC_LCFG_2_1 TC_LTIME_3_1 TC_LWM_1_1 TC_LWM_2_1 TC_LWM_3_1 TC_MOD_2_1 TC_MOD_3_1 TC_MOD_3_2 TC_MOD_3_3 TC_MOD_3_4 TC_OPSTATE_2_4 TC_REFALM_1_1 TC_RVCCLEANM_3_1 TC_TCCM_1_1 TC_TCTL_1_1 Test_TC_MOD_2_3 * Auto generated files * Newly added manual tests: TC_DT_1_1 TC_GRPKEY_5_4 TC_LWM_3_3 TC_OPCREDS_3_7 TC_RVCCLEANM_1_2 TC_RVCCLEANM_2_1 TC_RVCCLEANM_3_2 TC_RVCRUNM_1_2 TC_RVCRUNM_2_1 TC_RVCRUNM_3_2 TC_SM_1_1 TC_SM_1_2 Modified manual tests: TC_ACT_2_1 TC_ACT_2_2 TC_BR_1 TC_BR_2 TC_DESC_2_1 TC_DISHALM_1_1 TC_DISHALM_2_1 TC_DISHALM_3_1 TC_DISHALM_3_2 TC_DISHALM_3_3 TC_DISHALM_3_4 TC_DISHALM_3_5 TC_DISHALM_3_6 TC_DISHM_1_1 TC_DISHM_1_2 TC_DISHM_2_1 TC_DISHM_3_1 TC_DISHM_3_2 TC_DISHM_3_3 TC_DRLK_2_1 TC_DRLK_2_10 TC_DRLK_2_2 TC_G_2_2 TC_G_2_3 TC_G_3_2 TC_IDM_4_2 TC_LWM_1_2 TC_LWM_3_2 TC_MOD_1_2 TC_RVCCLEANM_1_1 TC_RVCCLEANM_3_3 TC_RVCRUNM_1_1 TC_RVCRUNM_3_3 TC_TCCM_1_2 TC_TCCM_2_1 TC_TCCM_3_1 TC_TCCM_3_2 TC_TCCM_3_3 TC_TCTL_2_1 TC_TCTL_2_2 TC_TCTL_2_3 TC_TCTL_3_2 TC_TCTL_3_3 * Restyled by whitespace * Fixes issue 620 * Restyled by whitespace * Modified tests: TC-DGGEN-2.1 TC-GRPKEY-2.1 * Modified GRPKEY-2.1 test * Fixed CI failure for OPSTATE-2.4 * Modified DGGEN-2.1 test * Fixes issue: 589 Added TC-G-2.4 automated test Modified test: TC-DGGEN-2.1 * Modified test DGGEN-2.1 PICS * Test_TC_G_2_4.yaml test added in init.py as the chip-repl does not support EqualityCommands pseudo-cluster * Fixes issue: 623, 624 * Restyled by whitespace * Modified ACL commision step logs * Restyled by whitespace * MOdified files: TC-BINFO-2.1 TC-TSTAT-1.1 Removed tests: TC-WASHERCTRL-3.1 TC-WASHERCTRL-3.2 --------- Co-authored-by: Restyled.io --- .../templates/tests/ciTests.json | 2 + scripts/tests/chiptest/__init__.py | 9 + src/app/tests/suites/certification/PICS.yaml | 111 +- .../certification/Test_TC_ACL_2_10.yaml | 9 +- .../suites/certification/Test_TC_ACL_2_7.yaml | 9 +- .../suites/certification/Test_TC_ACL_2_8.yaml | 10 +- .../suites/certification/Test_TC_ACT_2_1.yaml | 183 +- .../suites/certification/Test_TC_ACT_2_2.yaml | 258 +- .../certification/Test_TC_BINFO_2_1.yaml | 1 + .../certification/Test_TC_BRBINFO_2_1.yaml | 85 +- .../suites/certification/Test_TC_BR_1.yaml | 532 +- .../suites/certification/Test_TC_BR_2.yaml | 1313 +- .../suites/certification/Test_TC_BR_4.yaml | 12282 +- .../certification/Test_TC_DESC_2_1.yaml | 146 +- .../certification/Test_TC_DGGEN_2_1.yaml | 533 +- .../certification/Test_TC_DGGEN_2_3.yaml | 95 +- .../certification/Test_TC_DISHALM_1_1.yaml | 98 +- .../certification/Test_TC_DISHALM_2_1.yaml | 30 +- .../certification/Test_TC_DISHALM_3_1.yaml | 186 +- .../certification/Test_TC_DISHALM_3_2.yaml | 184 +- .../certification/Test_TC_DISHALM_3_3.yaml | 184 +- .../certification/Test_TC_DISHALM_3_4.yaml | 185 +- .../certification/Test_TC_DISHALM_3_5.yaml | 185 +- .../certification/Test_TC_DISHALM_3_6.yaml | 189 +- .../certification/Test_TC_DISHM_1_1.yaml | 10 +- .../certification/Test_TC_DISHM_1_2.yaml | 14 +- .../certification/Test_TC_DISHM_2_1.yaml | 26 +- .../certification/Test_TC_DISHM_3_1.yaml | 66 +- .../certification/Test_TC_DISHM_3_2.yaml | 12 + .../certification/Test_TC_DISHM_3_3.yaml | 9 +- .../certification/Test_TC_DLOG_1_1.yaml | 2 +- .../certification/Test_TC_DRLK_2_1.yaml | 157 +- .../certification/Test_TC_DRLK_2_10.yaml | 20 +- .../suites/certification/Test_TC_DT_1_1.yaml | 142 + .../suites/certification/Test_TC_FAN_2_5.yaml | 2 +- .../certification/Test_TC_GRPKEY_2_1.yaml | 228 + .../certification/Test_TC_GRPKEY_2_2.yaml | 774 + .../certification/Test_TC_GRPKEY_5_4.yaml | 96 + .../suites/certification/Test_TC_G_2_2.yaml | 10 +- .../suites/certification/Test_TC_G_2_3.yaml | 13 +- .../suites/certification/Test_TC_G_2_4.yaml | 559 +- .../suites/certification/Test_TC_G_3_2.yaml | 109 +- .../suites/certification/Test_TC_IDM_4_2.yaml | 107 +- .../suites/certification/Test_TC_IDM_4_3.yaml | 12 +- .../suites/certification/Test_TC_IDM_7_1.yaml | 360 +- .../suites/certification/Test_TC_I_2_2.yaml | 80 +- .../certification/Test_TC_LCFG_2_1.yaml | 202 +- .../certification/Test_TC_LTIME_3_1.yaml | 242 +- .../suites/certification/Test_TC_LWM_1_1.yaml | 224 +- .../suites/certification/Test_TC_LWM_1_2.yaml | 12 +- .../suites/certification/Test_TC_LWM_2_1.yaml | 318 +- .../suites/certification/Test_TC_LWM_3_1.yaml | 226 +- .../suites/certification/Test_TC_LWM_3_2.yaml | 18 +- .../suites/certification/Test_TC_LWM_3_3.yaml | 287 + .../suites/certification/Test_TC_MOD_1_2.yaml | 8 +- .../suites/certification/Test_TC_MOD_2_1.yaml | 171 +- .../suites/certification/Test_TC_MOD_2_3.yaml | 131 - .../suites/certification/Test_TC_MOD_3_1.yaml | 218 +- .../suites/certification/Test_TC_MOD_3_2.yaml | 195 +- .../suites/certification/Test_TC_MOD_3_3.yaml | 206 +- .../suites/certification/Test_TC_MOD_3_4.yaml | 260 +- .../certification/Test_TC_OPCREDS_3_7.yaml | 210 + .../certification/Test_TC_OPSTATE_2_4.yaml | 73 +- .../certification/Test_TC_REFALM_1_1.yaml | 213 +- .../certification/Test_TC_RVCCLEANM_1_1.yaml | 9 +- .../certification/Test_TC_RVCCLEANM_1_2.yaml | 115 + .../certification/Test_TC_RVCCLEANM_2_1.yaml | 241 + .../certification/Test_TC_RVCCLEANM_3_1.yaml | 171 +- .../certification/Test_TC_RVCCLEANM_3_2.yaml | 203 + .../certification/Test_TC_RVCCLEANM_3_3.yaml | 11 +- .../certification/Test_TC_RVCRUNM_1_1.yaml | 4 +- .../certification/Test_TC_RVCRUNM_1_2.yaml | 113 + .../certification/Test_TC_RVCRUNM_2_1.yaml | 215 + .../certification/Test_TC_RVCRUNM_3_1.yaml | 8 +- .../certification/Test_TC_RVCRUNM_3_2.yaml | 223 + .../certification/Test_TC_RVCRUNM_3_3.yaml | 11 +- .../suites/certification/Test_TC_SM_1_1.yaml | 220 + .../suites/certification/Test_TC_SM_1_2.yaml | 132 + .../certification/Test_TC_TCCM_1_1.yaml | 219 +- .../certification/Test_TC_TCCM_1_2.yaml | 10 +- .../certification/Test_TC_TCCM_2_1.yaml | 4 +- .../certification/Test_TC_TCCM_3_1.yaml | 49 +- .../certification/Test_TC_TCCM_3_2.yaml | 8 +- .../certification/Test_TC_TCCM_3_3.yaml | 4 +- .../certification/Test_TC_TCTL_1_1.yaml | 260 +- .../certification/Test_TC_TCTL_2_1.yaml | 52 +- .../certification/Test_TC_TCTL_2_2.yaml | 19 +- .../certification/Test_TC_TCTL_2_3.yaml | 5 + .../certification/Test_TC_TCTL_3_2.yaml | 208 +- .../certification/Test_TC_TCTL_3_3.yaml | 100 +- .../certification/Test_TC_TSTAT_1_1.yaml | 26 +- .../certification/Test_TC_WASHERCTRL_3_1.yaml | 54 - .../certification/Test_TC_WASHERCTRL_3_2.yaml | 55 - .../certification/Test_TC_WNCV_3_1.yaml | 68 +- .../certification/Test_TC_WNCV_3_2.yaml | 70 +- .../tests/suites/certification/ci-pics-values | 104 +- src/app/tests/suites/ciTests.json | 23 +- src/app/tests/suites/manualTests.json | 38 +- .../chip-tool/zap-generated/test/Commands.h | 144272 +++++++++++++++ .../zap-generated/test/Commands.h | 15325 +- 100 files changed, 169061 insertions(+), 16429 deletions(-) mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_ACT_2_2.yaml mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_BR_1.yaml mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_BR_2.yaml create mode 100755 src/app/tests/suites/certification/Test_TC_DT_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_MOD_2_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_MOD_2_3.yaml mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml mode change 100644 => 100755 src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml create mode 100755 src/app/tests/suites/certification/Test_TC_SM_1_1.yaml create mode 100755 src/app/tests/suites/certification/Test_TC_SM_1_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_2.yaml create mode 100644 zzz_generated/chip-tool/zap-generated/test/Commands.h diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 4898f5fd8b4518..f2bb41046718d9 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -39,6 +39,8 @@ "Test_TC_SMOKECO_2_3", "Test_TC_SMOKECO_2_4", "Test_TC_SMOKECO_2_5", + "Test_TC_DGGEN_2_1", + "Test_TC_OPSTATE_2_4", "Disabled due to undefined properties", "Test_TC_SMOKECO_2_6", "Disabled because the power source configuration cluster is now deprecated and not present in all-clusters", diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index d148b043186bc6..6c90152405e60e 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -165,6 +165,15 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_S_2_2.yaml", # chip-repl does not support scenes cluster commands "Test_TC_S_2_3.yaml", # chip-repl does not support scenes cluster commands "Test_TC_S_2_4.yaml", # chip-repl does not support scenes cluster commands + "Test_TC_MOD_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_MOD_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_MOD_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_MOD_3_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_BRBINFO_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_DGGEN_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_DGGEN_2_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_LWM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_G_2_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster } diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 2785ad6e7f8bc5..8d88aa7bcde944 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -1774,8 +1774,25 @@ PICS: - label: "Can the Dishwasher Alarm attribute changed by physical control at the device?" - id: DISHALM.M.ManuallyControlled + id: DISHALM.S.M.ManuallyControlled + - label: "Does the device support the Inflow alarm?" + id: DISHALM.S.M.InflowAlarmSupported + + - label: "Does the device support the Drain alarm?" + id: DISHALM.S.M.DrainAlarmSupported + + - label: "Does the device support the Door alarm?" + id: DISHALM.S.M.DoorAlarmSupported + + - label: "Does the device support the TempLow alarm?" + id: DISHALM.S.M.TempLowAlarmSupported + + - label: "Does the device support the TempHigh alarm?" + id: DISHALM.S.M.TempHighAlarmSupported + + - label: "Does the device support the WaterLevel alarm?" + id: DISHALM.S.M.WaterLevelAlarmSupported # # server / Commands received # @@ -1790,11 +1807,20 @@ PICS: - label: "Does the device implement the DISHM cluster as a server?" id: DISHM.S + - label: "IDoes the DUT support testing the failed ChangeToMode command?" + id: DISHM.S.M.CAN_TEST_MODE_FAILURE + + # PIXIT + - label: "Id of mode the device will fail to transition to, given its current state" - id: PIXIT.DISHM.CAN_TEST_MODE_FAILURE + id: PIXIT.DISHM.MODE_CHANGE_FAIL + - label: + "Id of mode the device will successfully transition to, given its + current state" + id: PIXIT.DISHM.MODE_CHANGE_OK # # server / features # @@ -2862,7 +2888,7 @@ PICS: id: DRLK.S.Simulate.NotFullyLocked - label: "Does the DUT(server) detect a LockJammed State?" - id: DRLK.S.DetectLockJammed + id: DRLK.S.M.DetectLockJammed # # client / attributes @@ -3610,6 +3636,43 @@ PICS: feature?" id: GRPKEY.S.F00 + # + #server attributes + # + - label: "Does the device implement the GroupKeyMap attribute?" + id: GRPKEY.S.A0000 + + - label: "Does the device implement the GroupTable attribute?" + id: GRPKEY.S.A0001 + + - label: "Does the device implement the MaxGroupsPerFabric attribute?" + id: GRPKEY.S.A0002 + + - label: "Does the device implement the MaxGroupKeysPerFabric attribute?" + id: GRPKEY.S.A0003 + + # + # server commandsGenerated + # + - label: "Does the device implement the KeySetWrite command}?" + id: GRPKEY.S.C00.Rsp + + - label: "Does the device implement the KeySetRead command}?" + id: GRPKEY.S.C01.Rsp + + - label: "Does the device implement the KeySetReadResponse command}?" + id: GRPKEY.S.C02.Rsp + + - label: "Does the device implement the KeySetRemove command}?" + id: GRPKEY.S.C03.Rsp + + - label: "Does the device implement the KeySetReadAllIndices command}?" + id: GRPKEY.S.C04.Rsp + + - label: + "Does the device implement the KeySetReadAllIndicesResponse command}?" + id: GRPKEY.S.C05.Rsp + # # client / attributes # @@ -8930,10 +8993,18 @@ PICS: - label: "Does the device implement the LWM cluster as a server?" id: LWM.S + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: LWM.S.M.CAN_TEST_MODE_FAILURE + - label: "Id of mode the device will fail to transition to, given its current state" - id: PIXIT.LWM.CAN_TEST_MODE_FAILURE + id: PIXIT.LWM.MODE_CHANGE_FAIL + + - label: + "Id of mode the device will successfully transition to, given its + current state" + id: PIXIT.LWM.MODE_CHANGE_OK # # server / features @@ -9012,21 +9083,36 @@ PICS: "Does the device implement sending the ChangeToModeResponse command?" id: RVCCLEANM.S.C01.Tx + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE + - label: "Id of mode the device will fail to transition to, given its current state" - id: PIXIT.RVCCLEANM.CAN_TEST_MODE_FAILURE + id: PIXIT.RVCCLEANM.MODE_CHANGE_FAIL + - label: + "Id of mode the device will successfully transition to, given its + current state" + id: PIXIT.RVCCLEANM.MODE_CHANGE_OK # #Temperature Controlled Cabinet Mode Cluster # - label: "Does the device implement the TCCM cluster as a server?" id: TCCM.S + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: TCCM.S.M.CAN_TEST_MODE_FAILURE + + - label: + "Id of mode the device will successfully transition to, given its + current state" + id: PIXIT.TCCM.MODE_CHANGE_OK + - label: "Id of mode the device will fail to transition to, given its current state" - id: PIXIT.TCCM.CAN_TEST_MODE_FAILURE + id: PIXIT.TCCM.MODE_CHANGE_FAIL #Features - label: @@ -9103,6 +9189,9 @@ PICS: device?" id: TCC.M.ManuallyControlledTemperature + - label: "Does the device support the INVALID_IN_MODE response" + id: TCTL.S.M.SupportsInvalidInMode + #Commands received - label: "Does the device implement receiving the SetTemperatureCommand @@ -9161,10 +9250,18 @@ PICS: - label: "Does the device implement the RVCRUNM cluster as a server?" id: RVCRUNM.S + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: RVCRUNM.S.M.CAN_TEST_MODE_FAILURE + - label: "Id of mode the device will fail to transition to, given its current state" - id: PIXIT.RVCRUNM.CAN_TEST_MODE_FAILURE + id: PIXIT.RVCRUNM.MODE_CHANGE_FAIL + + - label: + "Id of mode the device will successfully transition to, given its + current state" + id: PIXIT.RVCRUNM.MODE_CHANGE_OK #Features - label: diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml index 21f673670f1cec..cd77adbe3b1bff 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml @@ -106,15 +106,16 @@ tests: ./chip-tool pairing open-commissioning-window 1 1 400 2000 3841 + Commission TH2(Chiptool) to DUT using manualcode generated in TH1 using open commission window + + ./chip-tool pairing code 2 36253605617 --commissioner-name beta --commissioner-nodeid 223344 + [1657186324.710951][10820:10825] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 Status=0x0 [1657186324.710980][10820:10825] CHIP:CTL: Successfully opened pairing window On TH(Chiptool)e device [1657186324.711048][10820:10825] CHIP:CTL: Manual pairing code: [36253605617] [1657186324.711108][10820:10825] CHIP:CTL: SetupQRCode: [MT:-24J0IRV01A7TB7E700] - - Commission TH2(Chiptool) to DUT using manualcode generated in TH1 using open commission window - - ./chip-tool pairing code 2 36253605617 --commissioner-name beta --commissioner-nodeid 223344 + Commission TH2(Chiptool) to DUT: [1657186359.584672][3509:3514] CHIP:CTL: Successfully finished commissioning step 'Cleanup' [1657186359.584743][3509:3514] CHIP:TOO: Device commissioning completed with success cluster: "LogCommands" diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml index 28ba51356dd0b2..61a98cd52ddb95 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml @@ -97,15 +97,16 @@ tests: ./chip-tool pairing open-commissioning-window 1 1 400 2000 3841 + Commission TH2(Chiptool) to DUT using manualcode generated in TH1 using open commission window + + ./chip-tool pairing code 2 36253605617 --commissioner-name beta --commissioner-nodeid 223344 + [1657186324.710951][10820:10825] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 Status=0x0 [1657186324.710980][10820:10825] CHIP:CTL: Successfully opened pairing window On TH(Chiptool)e device [1657186324.711048][10820:10825] CHIP:CTL: Manual pairing code: [36253605617] [1657186324.711108][10820:10825] CHIP:CTL: SetupQRCode: [MT:-24J0IRV01A7TB7E700] - - Commission TH2(Chiptool) to DUT using manualcode generated in TH1 using open commission window - - ./chip-tool pairing code 2 36253605617 --commissioner-name beta --commissioner-nodeid 223344 + Commission TH2(Chiptool) to DUT: [1657186359.584672][3509:3514] CHIP:CTL: Successfully finished commissioning step 'Cleanup' [1657186359.584743][3509:3514] CHIP:TOO: Device commissioning completed with success cluster: "LogCommands" diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml index 99dd99b97e8d08..1d5333c7a0f54f 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml @@ -98,16 +98,16 @@ tests: ./chip-tool pairing open-commissioning-window 1 1 400 2000 3841 + Commission TH2(Chiptool) to DUT using manualcode generated in TH1 using open commission window + + ./chip-tool pairing code 2 36253605617 --commissioner-name beta --commissioner-nodeid 223344 + [1657186324.710951][10820:10825] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 Status=0x0 [1657186324.710980][10820:10825] CHIP:CTL: Successfully opened pairing window On TH(Chiptool)e device [1657186324.711048][10820:10825] CHIP:CTL: Manual pairing code: [36253605617] [1657186324.711108][10820:10825] CHIP:CTL: SetupQRCode: [MT:-24J0IRV01A7TB7E700] - - Commission TH2(Chiptool) to DUT using manualcode generated in TH1 using open commission window - - ./chip-tool pairing code 2 36253605617 --commissioner-name beta --commissioner-nodeid 223344 - + Commission TH2(Chiptool) to DUT: [1657186359.584672][3509:3514] CHIP:CTL: Successfully finished commissioning step 'Cleanup' [1657186359.584743][3509:3514] CHIP:TOO: Device commissioning completed with success cluster: "LogCommands" diff --git a/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml old mode 100644 new mode 100755 index 5be7d63eb82bd6..ea44aa586a99d9 --- a/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml @@ -55,23 +55,21 @@ tests: verification: | ./chip-tool descriptor read parts-list 1 0 - Via the TH (chip-tool), verify the PartsList value has 12 entries (number may vary by DUT capabilities). + Via the TH (chip-tool), verify the PartsList value has 11 entries (number may vary by DUT capabilities). [1661775581.434024][11909:11914] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2309949467 - [1661775581.434098][11909:11914] CHIP:TOO: parts list: 12 entries - [1661775581.434129][11909:11914] CHIP:TOO: [1]: 1 - [1661775581.434155][11909:11914] CHIP:TOO: [2]: 3 - [1661775581.434180][11909:11914] CHIP:TOO: [3]: 4 - [1661775581.434205][11909:11914] CHIP:TOO: [4]: 5 - [1661775581.434230][11909:11914] CHIP:TOO: [5]: 6 - [1661775581.434255][11909:11914] CHIP:TOO: [6]: 7 - [1661775581.434280][11909:11914] CHIP:TOO: [7]: 8 - [1661775581.434304][11909:11914] CHIP:TOO: [8]: 9 - [1661775581.434383][11909:11914] CHIP:TOO: [9]: 10 - [1661775581.434408][11909:11914] CHIP:TOO: [10]: 11 - [1661775581.434434][11909:11914] CHIP:TOO: [11]: 12 - [1661775581.434459][11909:11914] CHIP:TOO: [12]: 13 - [1661775581.434597][11909:11914] CHIP:EM: Sending Standalone Ack for MessageCounter:142298497 on exchange 3054i + [1692261442.387782][3599:3601] CHIP:TOO: PartsList: 11 entries + [1692261442.387823][3599:3601] CHIP:TOO: [1]: 1 + [1692261442.387849][3599:3601] CHIP:TOO: [2]: 3 + [1692261442.387885][3599:3601] CHIP:TOO: [3]: 4 + [1692261442.387910][3599:3601] CHIP:TOO: [4]: 5 + [1692261442.387943][3599:3601] CHIP:TOO: [5]: 6 + [1692261442.387967][3599:3601] CHIP:TOO: [6]: 7 + [1692261442.387990][3599:3601] CHIP:TOO: [7]: 8 + [1692261442.388022][3599:3601] CHIP:TOO: [8]: 9 + [1692261442.388086][3599:3601] CHIP:TOO: [9]: 10 + [1692261442.388112][3599:3601] CHIP:TOO: [10]: 11 + [1692261442.388135][3599:3601] CHIP:TOO: [11]: 12 disabled: true - label: "Step 4a: Read EndpointLists attribute of Actions server" @@ -82,23 +80,23 @@ tests: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. [1658474608.888833][20775:20780] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2082192894 - [1658474608.888887][20775:20780] CHIP:TOO: endpoint list: 2 entries - [1658474608.888949][20775:20780] CHIP:TOO: [1]: { - [1658474608.888968][20775:20780] CHIP:TOO: EndpointListID: 57345 - [1658474608.888985][20775:20780] CHIP:TOO: Name: Room 1 - [1658474608.889001][20775:20780] CHIP:TOO: Type: 1 - [1658474608.889020][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889040][20775:20780] CHIP:TOO: [1]: 10 - [1658474608.889056][20775:20780] CHIP:TOO: [2]: 11 - [1658474608.889072][20775:20780] CHIP:TOO: } - [1658474608.889099][20775:20780] CHIP:TOO: [2]: { - [1658474608.889114][20775:20780] CHIP:TOO: EndpointListID: 57346 - [1658474608.889128][20775:20780] CHIP:TOO: Name: Room 2 - [1658474608.889142][20775:20780] CHIP:TOO: Type: 1 - [1658474608.889159][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889175][20775:20780] CHIP:TOO: [1]: 12 - [1658474608.889191][20775:20780] CHIP:TOO: [2]: 13 - [1658474608.889205][20775:20780] CHIP:TOO: } + [1692261467.505888][3603:3605] CHIP:TOO: EndpointLists: 2 entries + [1692261467.505968][3603:3605] CHIP:TOO: [1]: { + [1692261467.505993][3603:3605] CHIP:TOO: EndpointListID: 57345 + [1692261467.506015][3603:3605] CHIP:TOO: Name: Room 1 + [1692261467.506062][3603:3605] CHIP:TOO: Type: 1 + [1692261467.506089][3603:3605] CHIP:TOO: Endpoints: 2 entries + [1692261467.506115][3603:3605] CHIP:TOO: [1]: 9 + [1692261467.506171][3603:3605] CHIP:TOO: [2]: 10 + [1692261467.506204][3603:3605] CHIP:TOO: } + [1692261467.506254][3603:3605] CHIP:TOO: [2]: { + [1692261467.506287][3603:3605] CHIP:TOO: EndpointListID: 57346 + [1692261467.506340][3603:3605] CHIP:TOO: Name: Room 2 + [1692261467.506381][3603:3605] CHIP:TOO: Type: 1 + [1692261467.506415][3603:3605] CHIP:TOO: Endpoints: 2 entries + [1692261467.506461][3603:3605] CHIP:TOO: [1]: 11 + [1692261467.506519][3603:3605] CHIP:TOO: [2]: 12 + [1692261467.506542][3603:3605] CHIP:TOO: } disabled: true - label: @@ -107,24 +105,25 @@ tests: verification: | Via the TH (chip-tool), Verify all referenced endpoints present in list from step 3 - [1658474608.888833][20775:20780] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2082192894 - [1658474608.888887][20775:20780] CHIP:TOO: endpoint list: 2 entries - [1658474608.888949][20775:20780] CHIP:TOO: [1]: { - [1658474608.888968][20775:20780] CHIP:TOO: EndpointListID: 57345 - [1658474608.888985][20775:20780] CHIP:TOO: Name: Room 1 - [1658474608.889001][20775:20780] CHIP:TOO: Type: 1 - [1658474608.889020][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889040][20775:20780] CHIP:TOO: [1]: 10 - [1658474608.889056][20775:20780] CHIP:TOO: [2]: 11 - [1658474608.889072][20775:20780] CHIP:TOO: } - [1658474608.889099][20775:20780] CHIP:TOO: [2]: { - [1658474608.889114][20775:20780] CHIP:TOO: EndpointListID: 57346 - [1658474608.889128][20775:20780] CHIP:TOO: Name: Room 2 - [1658474608.889142][20775:20780] CHIP:TOO: Type: 1 - [1658474608.889159][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889175][20775:20780] CHIP:TOO: [1]: 12 - [1658474608.889191][20775:20780] CHIP:TOO: [2]: 13 - [1658474608.889205][20775:20780] CHIP:TOO: } + + [1692261467.505798][3603:3605] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2563467668 + [1692261467.505888][3603:3605] CHIP:TOO: EndpointLists: 2 entries + [1692261467.505968][3603:3605] CHIP:TOO: [1]: { + [1692261467.505993][3603:3605] CHIP:TOO: EndpointListID: 57345 + [1692261467.506015][3603:3605] CHIP:TOO: Name: Room 1 + [1692261467.506062][3603:3605] CHIP:TOO: Type: 1 + [1692261467.506089][3603:3605] CHIP:TOO: Endpoints: 2 entries + [1692261467.506115][3603:3605] CHIP:TOO: [1]: 9 + [1692261467.506171][3603:3605] CHIP:TOO: [2]: 10 + [1692261467.506204][3603:3605] CHIP:TOO: } + [1692261467.506254][3603:3605] CHIP:TOO: [2]: { + [1692261467.506287][3603:3605] CHIP:TOO: EndpointListID: 57346 + [1692261467.506340][3603:3605] CHIP:TOO: Name: Room 2 + [1692261467.506381][3603:3605] CHIP:TOO: Type: 1 + [1692261467.506415][3603:3605] CHIP:TOO: Endpoints: 2 entries + [1692261467.506461][3603:3605] CHIP:TOO: [1]: 11 + [1692261467.506519][3603:3605] CHIP:TOO: [2]: 12 + [1692261467.506542][3603:3605] CHIP:TOO: } disabled: true - label: @@ -132,24 +131,24 @@ tests: verification: | Via the TH (chip-tool), Verify each EndpointListStruct has Name in following log. - [1658474608.888833][20775:20780] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2082192894 - [1658474608.888887][20775:20780] CHIP:TOO: endpoint list: 2 entries - [1658474608.888949][20775:20780] CHIP:TOO: [1]: { - [1658474608.888968][20775:20780] CHIP:TOO: EndpointListID: 57345 - [1658474608.888985][20775:20780] CHIP:TOO: Name: Room 1 - [1658474608.889001][20775:20780] CHIP:TOO: Type: 1 - [1658474608.889020][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889040][20775:20780] CHIP:TOO: [1]: 10 - [1658474608.889056][20775:20780] CHIP:TOO: [2]: 11 - [1658474608.889072][20775:20780] CHIP:TOO: } - [1658474608.889099][20775:20780] CHIP:TOO: [2]: { - [1658474608.889114][20775:20780] CHIP:TOO: EndpointListID: 57346 - [1658474608.889128][20775:20780] CHIP:TOO: Name: Room 2 - [1658474608.889142][20775:20780] CHIP:TOO: Type: 1 - [1658474608.889159][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889175][20775:20780] CHIP:TOO: [1]: 12 - [1658474608.889191][20775:20780] CHIP:TOO: [2]: 13 - [1658474608.889205][20775:20780] CHIP:TOO: } + [1692261467.505798][3603:3605] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2563467668 + [1692261467.505888][3603:3605] CHIP:TOO: EndpointLists: 2 entries + [1692261467.505968][3603:3605] CHIP:TOO: [1]: { + [1692261467.505993][3603:3605] CHIP:TOO: EndpointListID: 57345 + [1692261467.506015][3603:3605] CHIP:TOO: Name: Room 1 + [1692261467.506062][3603:3605] CHIP:TOO: Type: 1 + [1692261467.506089][3603:3605] CHIP:TOO: Endpoints: 2 entries + [1692261467.506115][3603:3605] CHIP:TOO: [1]: 9 + [1692261467.506171][3603:3605] CHIP:TOO: [2]: 10 + [1692261467.506204][3603:3605] CHIP:TOO: } + [1692261467.506254][3603:3605] CHIP:TOO: [2]: { + [1692261467.506287][3603:3605] CHIP:TOO: EndpointListID: 57346 + [1692261467.506340][3603:3605] CHIP:TOO: Name: Room 2 + [1692261467.506381][3603:3605] CHIP:TOO: Type: 1 + [1692261467.506415][3603:3605] CHIP:TOO: Endpoints: 2 entries + [1692261467.506461][3603:3605] CHIP:TOO: [1]: 11 + [1692261467.506519][3603:3605] CHIP:TOO: [2]: 12 + [1692261467.506542][3603:3605] CHIP:TOO: } disabled: true - label: @@ -159,22 +158,22 @@ tests: Via the TH (chip-tool), Verify the type is present and valid for each EndpointListStruct in the following log. [1658474608.888833][20775:20780] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2082192894 - [1658474608.888887][20775:20780] CHIP:TOO: endpoint list: 2 entries + [1658474608.888887][20775:20780] CHIP:TOO: EndpointLists: 2 entries [1658474608.888949][20775:20780] CHIP:TOO: [1]: { [1658474608.888968][20775:20780] CHIP:TOO: EndpointListID: 57345 [1658474608.888985][20775:20780] CHIP:TOO: Name: Room 1 [1658474608.889001][20775:20780] CHIP:TOO: Type: 1 [1658474608.889020][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889040][20775:20780] CHIP:TOO: [1]: 10 - [1658474608.889056][20775:20780] CHIP:TOO: [2]: 11 + [1658474608.889040][20775:20780] CHIP:TOO: [1]: 9 + [1658474608.889056][20775:20780] CHIP:TOO: [2]: 10 [1658474608.889072][20775:20780] CHIP:TOO: } [1658474608.889099][20775:20780] CHIP:TOO: [2]: { [1658474608.889114][20775:20780] CHIP:TOO: EndpointListID: 57346 [1658474608.889128][20775:20780] CHIP:TOO: Name: Room 2 [1658474608.889142][20775:20780] CHIP:TOO: Type: 1 [1658474608.889159][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889175][20775:20780] CHIP:TOO: [1]: 12 - [1658474608.889191][20775:20780] CHIP:TOO: [2]: 13 + [1658474608.889175][20775:20780] CHIP:TOO: [1]: 11 + [1658474608.889191][20775:20780] CHIP:TOO: [2]: 12 [1658474608.889205][20775:20780] CHIP:TOO: } disabled: true @@ -185,22 +184,22 @@ tests: Via the TH (chip-tool), Verify the EndPointListIDs of all EndpointListStruct are unique and no duplicates in the following log [1658474608.888833][20775:20780] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2082192894 - [1658474608.888887][20775:20780] CHIP:TOO: endpoint list: 2 entries + [1658474608.888887][20775:20780] CHIP:TOO: EndpointLists: 2 entries [1658474608.888949][20775:20780] CHIP:TOO: [1]: { [1658474608.888968][20775:20780] CHIP:TOO: EndpointListID: 57345 [1658474608.888985][20775:20780] CHIP:TOO: Name: Room 1 [1658474608.889001][20775:20780] CHIP:TOO: Type: 1 [1658474608.889020][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889040][20775:20780] CHIP:TOO: [1]: 10 - [1658474608.889056][20775:20780] CHIP:TOO: [2]: 11 + [1658474608.889040][20775:20780] CHIP:TOO: [1]: 9 + [1658474608.889056][20775:20780] CHIP:TOO: [2]: 10 [1658474608.889072][20775:20780] CHIP:TOO: } [1658474608.889099][20775:20780] CHIP:TOO: [2]: { [1658474608.889114][20775:20780] CHIP:TOO: EndpointListID: 57346 [1658474608.889128][20775:20780] CHIP:TOO: Name: Room 2 [1658474608.889142][20775:20780] CHIP:TOO: Type: 1 [1658474608.889159][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889175][20775:20780] CHIP:TOO: [1]: 12 - [1658474608.889191][20775:20780] CHIP:TOO: [2]: 13 + [1658474608.889175][20775:20780] CHIP:TOO: [1]: 11 + [1658474608.889191][20775:20780] CHIP:TOO: [2]: 12 [1658474608.889205][20775:20780] CHIP:TOO: } disabled: true @@ -213,22 +212,22 @@ tests: Via the TH (chip-tool), Verify the information matches, Name and Type against the name/type of each group of endpoints provided [1658474608.888833][20775:20780] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 2082192894 - [1658474608.888887][20775:20780] CHIP:TOO: endpoint list: 2 entries + [1658474608.888887][20775:20780] CHIP:TOO: EndpointLists: 2 entries [1658474608.888949][20775:20780] CHIP:TOO: [1]: { [1658474608.888968][20775:20780] CHIP:TOO: EndpointListID: 57345 [1658474608.888985][20775:20780] CHIP:TOO: Name: Room 1 [1658474608.889001][20775:20780] CHIP:TOO: Type: 1 [1658474608.889020][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889040][20775:20780] CHIP:TOO: [1]: 10 - [1658474608.889056][20775:20780] CHIP:TOO: [2]: 11 + [1658474608.889040][20775:20780] CHIP:TOO: [1]: 9 + [1658474608.889056][20775:20780] CHIP:TOO: [2]: 10 [1658474608.889072][20775:20780] CHIP:TOO: } [1658474608.889099][20775:20780] CHIP:TOO: [2]: { [1658474608.889114][20775:20780] CHIP:TOO: EndpointListID: 57346 [1658474608.889128][20775:20780] CHIP:TOO: Name: Room 2 [1658474608.889142][20775:20780] CHIP:TOO: Type: 1 [1658474608.889159][20775:20780] CHIP:TOO: Endpoints: 2 entries - [1658474608.889175][20775:20780] CHIP:TOO: [1]: 12 - [1658474608.889191][20775:20780] CHIP:TOO: [2]: 13 + [1658474608.889175][20775:20780] CHIP:TOO: [1]: 11 + [1658474608.889191][20775:20780] CHIP:TOO: [2]: 12 [1658474608.889205][20775:20780] CHIP:TOO: } disabled: true @@ -240,7 +239,7 @@ tests: Via the TH (chip-tool), verify the ActionList attribute contains ActionStructs has 2 entries. [1658473018.104129][16539:16544] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 3292516604 - [1658473018.104215][16539:16544] CHIP:TOO: action list: 2 entries + [1658473018.104215][16539:16544] CHIP:TOO: ActionList: 2 entries [1658473018.104263][16539:16544] CHIP:TOO: [1]: { [1658473018.104728][16539:16544] CHIP:TOO: ActionID: 4097 [1658473018.104753][16539:16544] CHIP:TOO: Name: Room 1 On @@ -264,7 +263,7 @@ tests: Via the TH (chip-tool), Verify the name is present in each of the ActionStruct in the below log. [1658473018.104129][16539:16544] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 3292516604 - [1658473018.104215][16539:16544] CHIP:TOO: action list: 2 entries + [1658473018.104215][16539:16544] CHIP:TOO: ActionList: 2 entries [1658473018.104263][16539:16544] CHIP:TOO: [1]: { [1658473018.104728][16539:16544] CHIP:TOO: ActionID: 4097 [1658473018.104753][16539:16544] CHIP:TOO: Name: Room 1 On @@ -289,7 +288,7 @@ tests: Via the TH (chip-tool), Verify the type is present and valid for each of the ActionStruct in the below log. [1658473018.104129][16539:16544] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 3292516604 - [1658473018.104215][16539:16544] CHIP:TOO: action list: 2 entries + [1658473018.104215][16539:16544] CHIP:TOO: ActionList: 2 entries [1658473018.104263][16539:16544] CHIP:TOO: [1]: { [1658473018.104728][16539:16544] CHIP:TOO: ActionID: 4097 [1658473018.104753][16539:16544] CHIP:TOO: Name: Room 1 On @@ -347,7 +346,7 @@ tests: Via the TH (chip-tool), verify the State field is present and valid for each ActionStruct in the below log. [1658473018.104129][16539:16544] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 3292516604 - [1658473018.104215][16539:16544] CHIP:TOO: action list: 2 entries + [1658473018.104215][16539:16544] CHIP:TOO: ActionList: 2 entries [1658473018.104263][16539:16544] CHIP:TOO: [1]: { [1658473018.104728][16539:16544] CHIP:TOO: ActionID: 4097 [1658473018.104753][16539:16544] CHIP:TOO: Name: Room 1 On @@ -373,7 +372,7 @@ tests: Via the TH (chip-tool), Verify the ActionIDs of all ActionStructs are unique and no duplicates are found in the below log. [1658473018.104129][16539:16544] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 3292516604 - [1658473018.104215][16539:16544] CHIP:TOO: action list: 2 entries + [1658473018.104215][16539:16544] CHIP:TOO: ActionList 2 entries [1658473018.104263][16539:16544] CHIP:TOO: [1]: { [1658473018.104728][16539:16544] CHIP:TOO: ActionID: 4097 [1658473018.104753][16539:16544] CHIP:TOO: Name: Room 1 On @@ -401,7 +400,7 @@ tests: Via the TH (chip-tool), verify the information matches Name, Type and State against the name/type/state info for the action provided in below log. [1658473018.104129][16539:16544] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 3292516604 - [1658473018.104215][16539:16544] CHIP:TOO: action list: 2 entries + [1658473018.104215][16539:16544] CHIP:TOO: ActionList: 2 entries [1658473018.104263][16539:16544] CHIP:TOO: [1]: { [1658473018.104728][16539:16544] CHIP:TOO: ActionID: 4097 [1658473018.104753][16539:16544] CHIP:TOO: Name: Room 1 On @@ -430,7 +429,7 @@ tests: this is an optional attribute and it is implemented in RPI, it may vary based on DUT implementation. [1658473627.759830][18059:18064] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0002 DataVersion: 3292516604 - [1658473627.759880][18059:18064] CHIP:TOO: setup url: https://example.com + [1658473627.759880][18059:18064] CHIP:TOO: SetupURL: https://example.com disabled: true - label: "Step 6b: Verify that its syntax" @@ -438,7 +437,7 @@ tests: Via the TH (chip-tool), Verify the syntax as specified in RFC 3986, max. 512 ASCII characters in below log [1658473627.759830][18059:18064] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0002 DataVersion: 3292516604 - [1658473627.759880][18059:18064] CHIP:TOO: setup url: https://example.com + [1658473627.759880][18059:18064] CHIP:TOO: SetupURL: https://example.com disabled: true - label: @@ -448,7 +447,7 @@ tests: Via the TH (chip-tool), Verify SetupURL points to a site providing information about the actions in below log [1658473627.759830][18059:18064] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0002 DataVersion: 3292516604 - [1658473627.759880][18059:18064] CHIP:TOO: setup url: https://example.com + [1658473627.759880][18059:18064] CHIP:TOO: SetupURL: https://example.com disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_ACT_2_2.yaml b/src/app/tests/suites/certification/Test_TC_ACT_2_2.yaml old mode 100644 new mode 100755 index bc13c424587388..143290a78b99e7 --- a/src/app/tests/suites/certification/Test_TC_ACT_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACT_2_2.yaml @@ -46,22 +46,23 @@ tests: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. [1658426570.716289][16527:16532] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 3768747568 - [1658426570.716404][16527:16532] CHIP:TOO: endpoint list: 2 entries - [1658426570.716465][16527:16532] CHIP:TOO: [1]: { - [1658426570.716507][16527:16532] CHIP:TOO: EndpointListID: 0 - [1658426570.716534][16527:16532] CHIP:TOO: Name: living_room - [1658426570.716559][16527:16532] CHIP:TOO: Type: 1 - [1658426570.716588][16527:16532] CHIP:TOO: Endpoints: 2 entries - [1658426570.716617][16527:16532] CHIP:TOO: [1]: 2 - [1658426570.716646][16527:16532] CHIP:TOO: [2]: 3 - [1658426570.716673][16527:16532] CHIP:TOO: } - [1658426570.717133][16527:16532] CHIP:TOO: [2]: { - [1658426570.717160][16527:16532] CHIP:TOO: EndpointListID: 2 - [1658426570.717185][16527:16532] CHIP:TOO: Name: office - [1658426570.717209][16527:16532] CHIP:TOO: Type: 1 - [1658426570.717236][16527:16532] CHIP:TOO: Endpoints: 1 entries - [1658426570.717265][16527:16532] CHIP:TOO: [1]: 9 - [1658426570.717292][16527:16532] CHIP:TOO: } + [1692262148.439645][3623:3625] CHIP:TOO: EndpointLists: 2 entries + [1692262148.439718][3623:3625] CHIP:TOO: [1]: { + [1692262148.439742][3623:3625] CHIP:TOO: EndpointListID: 57345 + [1692262148.439765][3623:3625] CHIP:TOO: Name: Room 1 + [1692262148.439785][3623:3625] CHIP:TOO: Type: 1 + [1692262148.439808][3623:3625] CHIP:TOO: Endpoints: 2 entries + [1692262148.439833][3623:3625] CHIP:TOO: [1]: 9 + [1692262148.439857][3623:3625] CHIP:TOO: [2]: 10 + [1692262148.439879][3623:3625] CHIP:TOO: } + [1692262148.439908][3623:3625] CHIP:TOO: [2]: { + [1692262148.439930][3623:3625] CHIP:TOO: EndpointListID: 57346 + [1692262148.439950][3623:3625] CHIP:TOO: Name: Room 2 + [1692262148.439968][3623:3625] CHIP:TOO: Type: 1 + [1692262148.439990][3623:3625] CHIP:TOO: Endpoints: 2 entries + [1692262148.440013][3623:3625] CHIP:TOO: [1]: 11 + [1692262148.440036][3623:3625] CHIP:TOO: [2]: 12 + [1692262148.440056][3623:3625] CHIP:TOO: } disabled: true - label: @@ -70,7 +71,7 @@ tests: PICS: ACT.S.A0001 && ACT.S.M.FillEndpointLists verification: | press r in bridge-app to rename - (in the example, renamed "office" to "kitchen") + (in the example, renamed "Room 1" to "Room 1 renamed") disabled: true - label: "Step 2d: Read EndpointLists attribute again" @@ -81,22 +82,23 @@ tests: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. [1658408033.786811][14495:14500] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 3742844648 - [1658408033.786954][14495:14500] CHIP:TOO: endpoint list: 2 entries - [1658408033.787044][14495:14500] CHIP:TOO: [1]: { - [1658408033.787100][14495:14500] CHIP:TOO: EndpointListID: 0 - [1658408033.787135][14495:14500] CHIP:TOO: Name: living_room - [1658408033.787183][14495:14500] CHIP:TOO: Type: 1 - [1658408033.787220][14495:14500] CHIP:TOO: Endpoints: 2 entries - [1658408033.787274][14495:14500] CHIP:TOO: [1]: 2 - [1658408033.787312][14495:14500] CHIP:TOO: [2]: 3 - [1658408033.787343][14495:14500] CHIP:TOO: } - [1658408033.787407][14495:14500] CHIP:TOO: [2]: { - [1658408033.788089][14495:14500] CHIP:TOO: EndpointListID: 2 - [1658408033.788123][14495:14500] CHIP:TOO: Name: kitchen - [1658408033.788156][14495:14500] CHIP:TOO: Type: 1 - [1658408033.788191][14495:14500] CHIP:TOO: Endpoints: 1 entries - [1658408033.788243][14495:14500] CHIP:TOO: [1]: 9 - [1658408033.788278][14495:14500] CHIP:TOO: } + [1692262230.546573][3626:3628] CHIP:TOO: EndpointLists: 2 entries + [1692262230.546738][3626:3628] CHIP:TOO: [1]: { + [1692262230.546826][3626:3628] CHIP:TOO: EndpointListID: 57345 + [1692262230.546884][3626:3628] CHIP:TOO: Name: Room 1 renamed + [1692262230.546937][3626:3628] CHIP:TOO: Type: 1 + [1692262230.547022][3626:3628] CHIP:TOO: Endpoints: 2 entries + [1692262230.547206][3626:3628] CHIP:TOO: [1]: 9 + [1692262230.547270][3626:3628] CHIP:TOO: [2]: 10 + [1692262230.547327][3626:3628] CHIP:TOO: } + [1692262230.547595][3626:3628] CHIP:TOO: [2]: { + [1692262230.547658][3626:3628] CHIP:TOO: EndpointListID: 57346 + [1692262230.547783][3626:3628] CHIP:TOO: Name: Room 2 + [1692262230.547901][3626:3628] CHIP:TOO: Type: 1 + [1692262230.547966][3626:3628] CHIP:TOO: Endpoints: 2 entries + [1692262230.548027][3626:3628] CHIP:TOO: [1]: 11 + [1692262230.548156][3626:3628] CHIP:TOO: [2]: 12 + [1692262230.548218][3626:3628] CHIP:TOO: } disabled: true - label: "Step 2e: compare result of step 2d to what was read in step 2b" @@ -108,43 +110,45 @@ tests: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. [1658408033.786811][14495:14500] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 3742844648 - [1658408033.786954][14495:14500] CHIP:TOO: endpoint list: 2 entries - [1658408033.787044][14495:14500] CHIP:TOO: [1]: { - [1658408033.787100][14495:14500] CHIP:TOO: EndpointListID: 0 - [1658408033.787135][14495:14500] CHIP:TOO: Name: living_room - [1658408033.787183][14495:14500] CHIP:TOO: Type: 1 - [1658408033.787220][14495:14500] CHIP:TOO: Endpoints: 2 entries - [1658408033.787274][14495:14500] CHIP:TOO: [1]: 2 - [1658408033.787312][14495:14500] CHIP:TOO: [2]: 3 - [1658408033.787343][14495:14500] CHIP:TOO: } - [1658408033.787407][14495:14500] CHIP:TOO: [2]: { - [1658408033.788089][14495:14500] CHIP:TOO: EndpointListID: 2 - [1658408033.788123][14495:14500] CHIP:TOO: Name: kitchen - [1658408033.788156][14495:14500] CHIP:TOO: Type: 1 - [1658408033.788191][14495:14500] CHIP:TOO: Endpoints: 1 entries - [1658408033.788243][14495:14500] CHIP:TOO: [1]: 9 - [1658408033.788278][14495:14500] CHIP:TOO: } + [1692262230.546573][3626:3628] CHIP:TOO: EndpointLists: 2 entries + [1692262230.546738][3626:3628] CHIP:TOO: [1]: { + [1692262230.546826][3626:3628] CHIP:TOO: EndpointListID: 57345 + [1692262230.546884][3626:3628] CHIP:TOO: Name: Room 1 renamed + [1692262230.546937][3626:3628] CHIP:TOO: Type: 1 + [1692262230.547022][3626:3628] CHIP:TOO: Endpoints: 2 entries + [1692262230.547206][3626:3628] CHIP:TOO: [1]: 9 + [1692262230.547270][3626:3628] CHIP:TOO: [2]: 10 + [1692262230.547327][3626:3628] CHIP:TOO: } + [1692262230.547595][3626:3628] CHIP:TOO: [2]: { + [1692262230.547658][3626:3628] CHIP:TOO: EndpointListID: 57346 + [1692262230.547783][3626:3628] CHIP:TOO: Name: Room 2 + [1692262230.547901][3626:3628] CHIP:TOO: Type: 1 + [1692262230.547966][3626:3628] CHIP:TOO: Endpoints: 2 entries + [1692262230.548027][3626:3628] CHIP:TOO: [1]: 11 + [1692262230.548156][3626:3628] CHIP:TOO: [2]: 12 + [1692262230.548218][3626:3628] CHIP:TOO: } Step 2b log: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. [1658426570.716289][16527:16532] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 3768747568 - [1658426570.716404][16527:16532] CHIP:TOO: endpoint list: 2 entries - [1658426570.716465][16527:16532] CHIP:TOO: [1]: { - [1658426570.716507][16527:16532] CHIP:TOO: EndpointListID: 0 - [1658426570.716534][16527:16532] CHIP:TOO: Name: living_room - [1658426570.716559][16527:16532] CHIP:TOO: Type: 1 - [1658426570.716588][16527:16532] CHIP:TOO: Endpoints: 2 entries - [1658426570.716617][16527:16532] CHIP:TOO: [1]: 2 - [1658426570.716646][16527:16532] CHIP:TOO: [2]: 3 - [1658426570.716673][16527:16532] CHIP:TOO: } - [1658426570.717133][16527:16532] CHIP:TOO: [2]: { - [1658426570.717160][16527:16532] CHIP:TOO: EndpointListID: 2 - [1658426570.717185][16527:16532] CHIP:TOO: Name: office - [1658426570.717209][16527:16532] CHIP:TOO: Type: 1 - [1658426570.717236][16527:16532] CHIP:TOO: Endpoints: 1 entries - [1658426570.717265][16527:16532] CHIP:TOO: [1]: 9 - [1658426570.717292][16527:16532] CHIP:TOO: } + [1692262230.546573][3626:3628] CHIP:TOO: EndpointLists: 2 entries + [1692262230.546738][3626:3628] CHIP:TOO: [1]: { + [1692262230.546826][3626:3628] CHIP:TOO: EndpointListID: 57345 + [1692262230.546884][3626:3628] CHIP:TOO: Name: Room 1 + [1692262230.546937][3626:3628] CHIP:TOO: Type: 1 + [1692262230.547022][3626:3628] CHIP:TOO: Endpoints: 2 entries + [1692262230.547206][3626:3628] CHIP:TOO: [1]: 9 + [1692262230.547270][3626:3628] CHIP:TOO: [2]: 10 + [1692262230.547327][3626:3628] CHIP:TOO: } + [1692262230.547595][3626:3628] CHIP:TOO: [2]: { + [1692262230.547658][3626:3628] CHIP:TOO: EndpointListID: 57346 + [1692262230.547783][3626:3628] CHIP:TOO: Name: Room 2 + [1692262230.547901][3626:3628] CHIP:TOO: Type: 1 + [1692262230.547966][3626:3628] CHIP:TOO: Endpoints: 2 entries + [1692262230.548027][3626:3628] CHIP:TOO: [1]: 11 + [1692262230.548156][3626:3628] CHIP:TOO: [2]: 12 + [1692262230.548218][3626:3628] CHIP:TOO: } disabled: true - label: @@ -154,7 +158,7 @@ tests: verification: | Press f in bridge app to move one of the bridged devices (one endpoint) from one group to another group - (in the example, light at ep 3 was moved to kitchen) + (in the example, light at EP 11 was moved to Room 1 renamed) disabled: true - label: "Step 2g: Read EndpointLists attribute again" @@ -165,22 +169,23 @@ tests: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. [1658408033.786811][14495:14500] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 3742844648 - [1658408033.786954][14495:14500] CHIP:TOO: endpoint list: 2 entries - [1658408033.787044][14495:14500] CHIP:TOO: [1]: { - [1658408033.787100][14495:14500] CHIP:TOO: EndpointListID: 0 - [1658408033.787135][14495:14500] CHIP:TOO: Name: living_room - [1658408033.787183][14495:14500] CHIP:TOO: Type: 1 - [1658408033.787220][14495:14500] CHIP:TOO: Endpoints: 2 entries - [1658408033.787274][14495:14500] CHIP:TOO: [1]: 2 - [1658408033.787343][14495:14500] CHIP:TOO: } - [1658408033.787407][14495:14500] CHIP:TOO: [2]: { - [1658408033.788089][14495:14500] CHIP:TOO: EndpointListID: 2 - [1658408033.788123][14495:14500] CHIP:TOO: Name: kitchen - [1658408033.788156][14495:14500] CHIP:TOO: Type: 1 - [1658408033.788191][14495:14500] CHIP:TOO: Endpoints: 2 entries - [1658408033.788243][14495:14500] CHIP:TOO: [1]: 9 - [1658408033.787312][14495:14500] CHIP:TOO: [2]: 3 - [1658408033.788278][14495:14500] CHIP:TOO: } + [1692262498.402393][3670:3672] CHIP:TOO: EndpointLists: 2 entries + [1692262498.402483][3670:3672] CHIP:TOO: [1]: { + [1692262498.402526][3670:3672] CHIP:TOO: EndpointListID: 57345 + [1692262498.402555][3670:3672] CHIP:TOO: Name: Room 1 renamed + [1692262498.402582][3670:3672] CHIP:TOO: Type: 1 + [1692262498.402625][3670:3672] CHIP:TOO: Endpoints: 3 entries + [1692262498.402658][3670:3672] CHIP:TOO: [1]: 9 + [1692262498.402689][3670:3672] CHIP:TOO: [2]: 10 + [1692262498.402764][3670:3672] CHIP:TOO: [3]: 11 + [1692262498.402806][3670:3672] CHIP:TOO: } + [1692262498.402847][3670:3672] CHIP:TOO: [2]: { + [1692262498.402888][3670:3672] CHIP:TOO: EndpointListID: 57346 + [1692262498.402950][3670:3672] CHIP:TOO: Name: Room 2 + [1692262498.402988][3670:3672] CHIP:TOO: Type: 1 + [1692262498.403017][3670:3672] CHIP:TOO: Endpoints: 1 entries + [1692262498.403061][3670:3672] CHIP:TOO: [1]: 12 + [1692262498.403124][3670:3672] CHIP:TOO: } disabled: true - label: "Step 2h: compare result of step 2g to what was read in step 2d" @@ -207,14 +212,16 @@ tests: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. [1658426959.409374][16560:16565] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 3768747568 - [1658426959.409476][16560:16565] CHIP:TOO: endpoint list: 1 entries - [1658426959.409543][16560:16565] CHIP:TOO: [1]: { - [1658426959.409580][16560:16565] CHIP:TOO: EndpointListID: 0 - [1658426959.409604][16560:16565] CHIP:TOO: Name: living_room - [1658426959.409636][16560:16565] CHIP:TOO: Type: 1 - [1658426959.409691][16560:16565] CHIP:TOO: Endpoints: 1 entries - [1658426959.409730][16560:16565] CHIP:TOO: [1]: 2 - [1658426959.409755][16560:16565] CHIP:TOO: } + [1692262693.254145][3691:3693] CHIP:TOO: EndpointLists: 1 entries + [1692262693.254220][3691:3693] CHIP:TOO: [1]: { + [1692262693.254246][3691:3693] CHIP:TOO: EndpointListID: 57345 + [1692262693.254268][3691:3693] CHIP:TOO: Name: Room 1 renamed + [1692262693.254290][3691:3693] CHIP:TOO: Type: 1 + [1692262693.254315][3691:3693] CHIP:TOO: Endpoints: 3 entries + [1692262693.254342][3691:3693] CHIP:TOO: [1]: 9 + [1692262693.254366][3691:3693] CHIP:TOO: [2]: 10 + [1692262693.254390][3691:3693] CHIP:TOO: [3]: 11 + [1692262693.254414][3691:3693] CHIP:TOO: } disabled: true - label: "Step 2k: compare result of step 2j to what was read in step 2g" @@ -230,7 +237,7 @@ tests: PICS: ACT.S.A0001 && ACT.S.M.OverlappingEndpointLists verification: | press l in bridge-app - in this example, a zone was created with same light (ep 2) + in this example, a zone was created with same light (ep 10) disabled: true - label: "Step 2m: Read EndpointLists attribute again" @@ -240,22 +247,23 @@ tests: Via the TH (chip-tool), verify the EndpointLists attribute that contains EndpointListStructs. - 1658427088.316681][16578:16583] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0001 DataVersion: 3768747568 - [1658427088.316792][16578:16583] CHIP:TOO: endpoint list: 2 entries - [1658427088.316850][16578:16583] CHIP:TOO: [1]: { - [1658427088.316890][16578:16583] CHIP:TOO: EndpointListID: 0 - [1658427088.316915][16578:16583] CHIP:TOO: Name: living_room - [1658427088.316939][16578:16583] CHIP:TOO: Type: 1 - [1658427088.316965][16578:16583] CHIP:TOO: Endpoints: 1 entries - [1658427088.316993][16578:16583] CHIP:TOO: [1]: 2 - [1658427088.317019][16578:16583] CHIP:TOO: } - [1658427088.317558][16578:16583] CHIP:TOO: [2]: { - [1658427088.317583][16578:16583] CHIP:TOO: EndpointListID: 2 - [1658427088.317606][16578:16583] CHIP:TOO: Name: dining - [1658427088.317628][16578:16583] CHIP:TOO: Type: 2 - [1658427088.317652][16578:16583] CHIP:TOO: Endpoints: 1 entries - [1658427088.317679][16578:16583] CHIP:TOO: [1]: 2 - [1658427088.317705][16578:16583] CHIP:TOO: } + [1692262731.405553][3694:3696] CHIP:TOO: EndpointLists: 2 entries + [1692262731.405627][3694:3696] CHIP:TOO: [1]: { + [1692262731.405653][3694:3696] CHIP:TOO: EndpointListID: 57345 + [1692262731.405676][3694:3696] CHIP:TOO: Name: Room 1 renamed + [1692262731.405697][3694:3696] CHIP:TOO: Type: 1 + [1692262731.405723][3694:3696] CHIP:TOO: Endpoints: 3 entries + [1692262731.405749][3694:3696] CHIP:TOO: [1]: 9 + [1692262731.405774][3694:3696] CHIP:TOO: [2]: 10 + [1692262731.405797][3694:3696] CHIP:TOO: [3]: 11 + [1692262731.405820][3694:3696] CHIP:TOO: } + [1692262731.405851][3694:3696] CHIP:TOO: [2]: { + [1692262731.405874][3694:3696] CHIP:TOO: EndpointListID: 57347 + [1692262731.405895][3694:3696] CHIP:TOO: Name: Zone 3 + [1692262731.405915][3694:3696] CHIP:TOO: Type: 2 + [1692262731.405938][3694:3696] CHIP:TOO: Endpoints: 1 entries + [1692262731.405962][3694:3696] CHIP:TOO: [1]: 10 + [1692262731.405985][3694:3696] CHIP:TOO: } disabled: true - label: "Step 2n: compare result of step 2m to what was read in step 2j" @@ -281,14 +289,14 @@ tests: Via the TH (chip-tool), verify the ActionList attribute that contains ActionListStructs. [1658479958.699434][26130:26135] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 198994220 - [1658479958.699494][26130:26135] CHIP:TOO: action list: 2 entries + [1658479958.699494][26130:26135] CHIP:TOO: ActionList: 2 entries [1658479958.699549][26130:26135] CHIP:TOO: [1]: { [1658479958.699582][26130:26135] CHIP:TOO: ActionID: 4097 [1658479958.699597][26130:26135] CHIP:TOO: Name: Room 1 On [1658479958.699611][26130:26135] CHIP:TOO: Type: 3 [1658479958.699624][26130:26135] CHIP:TOO: EndpointListID: 57345 [1658479958.699638][26130:26135] CHIP:TOO: SupportedCommands: 1 - [1658479958.699652][26130:26135] CHIP:TOO: Status: 0 + [1658479958.699652][26130:26135] CHIP:TOO: State: 0 [1658479958.699665][26130:26135] CHIP:TOO: } [1658479958.699689][26130:26135] CHIP:TOO: [2]: { [1658479958.699702][26130:26135] CHIP:TOO: ActionID: 4098 @@ -296,7 +304,7 @@ tests: [1658479958.699727][26130:26135] CHIP:TOO: Type: 3 [1658479958.699740][26130:26135] CHIP:TOO: EndpointListID: 57346 [1658479958.699753][26130:26135] CHIP:TOO: SupportedCommands: 1 - [1658479958.699765][26130:26135] CHIP:TOO: Status: 0 + [1658479958.699765][26130:26135] CHIP:TOO: State: 0 [1658479958.699777][26130:26135] CHIP:TOO: } disabled: true @@ -316,14 +324,14 @@ tests: Via the TH (chip-tool), verify the ActionList attribute that contains ActionListStructs. [1658480004.064867][26153:26158] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 198994220 - [1658480004.064928][26153:26158] CHIP:TOO: action list: 2 entries + [1658480004.064928][26153:26158] CHIP:TOO: ActionList: 2 entries [1658480004.064992][26153:26158] CHIP:TOO: [1]: { [1658480004.065024][26153:26158] CHIP:TOO: ActionID: 4097 [1658480004.065041][26153:26158] CHIP:TOO: Name: Turn On Room 1 [1658480004.065057][26153:26158] CHIP:TOO: Type: 3 [1658480004.065073][26153:26158] CHIP:TOO: EndpointListID: 57345 [1658480004.065090][26153:26158] CHIP:TOO: SupportedCommands: 1 - [1658480004.065105][26153:26158] CHIP:TOO: Status: 0 + [1658480004.065105][26153:26158] CHIP:TOO: State: 0 [1658480004.065120][26153:26158] CHIP:TOO: } [1658480004.065148][26153:26158] CHIP:TOO: [2]: { [1658480004.065165][26153:26158] CHIP:TOO: ActionID: 4098 @@ -331,7 +339,7 @@ tests: [1658480004.065194][26153:26158] CHIP:TOO: Type: 3 [1658480004.065209][26153:26158] CHIP:TOO: EndpointListID: 57346 [1658480004.065223][26153:26158] CHIP:TOO: SupportedCommands: 1 - [1658480004.065238][26153:26158] CHIP:TOO: Status: 0 + [1658480004.065238][26153:26158] CHIP:TOO: State: 0 [1658480004.065252][26153:26158] CHIP:TOO: } disabled: true @@ -344,7 +352,7 @@ tests: Via the TH (chip-tool), verify the ActionList attribute that contains ActionListStructs. [1658480004.064867][26153:26158] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 198994220 - [1658480004.064928][26153:26158] CHIP:TOO: action list: 2 entries + [1658480004.064928][26153:26158] CHIP:TOO: ActionList: 2 entries [1658480004.064992][26153:26158] CHIP:TOO: [1]: { [1658480004.065024][26153:26158] CHIP:TOO: ActionID: 4097 [1658480004.065041][26153:26158] CHIP:TOO: Name: Turn On Room 1 @@ -359,14 +367,14 @@ tests: [1658480004.065194][26153:26158] CHIP:TOO: Type: 3 [1658480004.065209][26153:26158] CHIP:TOO: EndpointListID: 57346 [1658480004.065223][26153:26158] CHIP:TOO: SupportedCommands: 1 - [1658480004.065238][26153:26158] CHIP:TOO: Status: 0 + [1658480004.065238][26153:26158] CHIP:TOO: State: 0 [1658480004.065252][26153:26158] CHIP:TOO: } Step 3b Log: Via the TH (chip-tool), verify the ActionList attribute that contains ActionListStructs. [1658479958.699434][26130:26135] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 198994220 - [1658479958.699494][26130:26135] CHIP:TOO: action list: 2 entries + [1658479958.699494][26130:26135] CHIP:TOO: ActionList: 2 entries [1658479958.699549][26130:26135] CHIP:TOO: [1]: { [1658479958.699582][26130:26135] CHIP:TOO: ActionID: 4097 [1658479958.699597][26130:26135] CHIP:TOO: Name: Room 1 On @@ -381,7 +389,7 @@ tests: [1658479958.699727][26130:26135] CHIP:TOO: Type: 3 [1658479958.699740][26130:26135] CHIP:TOO: EndpointListID: 57346 [1658479958.699753][26130:26135] CHIP:TOO: SupportedCommands: 1 - [1658479958.699765][26130:26135] CHIP:TOO: Status: 0 + [1658479958.699765][26130:26135] CHIP:TOO: State: 0 [1658479958.699777][26130:26135] CHIP:TOO: } disabled: true @@ -399,14 +407,14 @@ tests: Via the TH (chip-tool), verify the ActionList attribute that contains ActionListStructs. [1658480039.164683][26172:26177] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 198994220 - [1658480039.164758][26172:26177] CHIP:TOO: action list: 1 entries + [1658480039.164758][26172:26177] CHIP:TOO: ActionList: 1 entries [1658480039.164815][26172:26177] CHIP:TOO: [1]: { [1658480039.164846][26172:26177] CHIP:TOO: ActionID: 4097 [1658480039.164872][26172:26177] CHIP:TOO: Name: Turn On Room 1 [1658480039.164897][26172:26177] CHIP:TOO: Type: 3 [1658480039.164920][26172:26177] CHIP:TOO: EndpointListID: 57345 [1658480039.164948][26172:26177] CHIP:TOO: SupportedCommands: 1 - [1658480039.164974][26172:26177] CHIP:TOO: Status: 0 + [1658480039.164974][26172:26177] CHIP:TOO: State: 0 [1658480039.164997][26172:26177] CHIP:TOO: } disabled: true @@ -430,14 +438,14 @@ tests: Via the TH (chip-tool), verify the ActionList attribute that contains ActionListStructs. [1658480059.199268][26178:26183] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 198994220 - [1658480059.199349][26178:26183] CHIP:TOO: action list: 2 entries + [1658480059.199349][26178:26183] CHIP:TOO: ActionList: 2 entries [1658480059.199410][26178:26183] CHIP:TOO: [1]: { [1658480059.199440][26178:26183] CHIP:TOO: ActionID: 4097 [1658480059.199457][26178:26183] CHIP:TOO: Name: Turn On Room 1 [1658480059.199473][26178:26183] CHIP:TOO: Type: 3 [1658480059.199488][26178:26183] CHIP:TOO: EndpointListID: 57345 [1658480059.199505][26178:26183] CHIP:TOO: SupportedCommands: 1 - [1658480059.199520][26178:26183] CHIP:TOO: Status: 0 + [1658480059.199520][26178:26183] CHIP:TOO: State: 0 [1658480059.199534][26178:26183] CHIP:TOO: } [1658480059.199562][26178:26183] CHIP:TOO: [2]: { [1658480059.199578][26178:26183] CHIP:TOO: ActionID: 4099 @@ -445,7 +453,7 @@ tests: [1658480059.199607][26178:26183] CHIP:TOO: Type: 3 [1658480059.199622][26178:26183] CHIP:TOO: EndpointListID: 57347 [1658480059.199636][26178:26183] CHIP:TOO: SupportedCommands: 1 - [1658480059.199651][26178:26183] CHIP:TOO: Status: 0 + [1658480059.199651][26178:26183] CHIP:TOO: State: 0 [1658480059.199665][26178:26183] CHIP:TOO: } disabled: true @@ -471,14 +479,14 @@ tests: Via the TH (chip-tool), verify the ActionList attribute that contains ActionListStructs. [1658480080.135069][26185:26190] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_0000 DataVersion: 198994220 - [1658480080.135130][26185:26190] CHIP:TOO: action list: 2 entries + [1658480080.135130][26185:26190] CHIP:TOO: ActionList: 2 entries [1658480080.135191][26185:26190] CHIP:TOO: [1]: { [1658480080.135222][26185:26190] CHIP:TOO: ActionID: 4097 [1658480080.135238][26185:26190] CHIP:TOO: Name: Turn On Room 1 [1658480080.135253][26185:26190] CHIP:TOO: Type: 3 [1658480080.135269][26185:26190] CHIP:TOO: EndpointListID: 57345 [1658480080.135285][26185:26190] CHIP:TOO: SupportedCommands: 1 - [1658480080.135300][26185:26190] CHIP:TOO: Status: 0 + [1658480080.135300][26185:26190] CHIP:TOO: State: 0 [1658480080.135315][26185:26190] CHIP:TOO: } [1658480080.135342][26185:26190] CHIP:TOO: [2]: { [1658480080.135357][26185:26190] CHIP:TOO: ActionID: 4099 @@ -486,7 +494,7 @@ tests: [1658480080.135386][26185:26190] CHIP:TOO: Type: 3 [1658480080.135400][26185:26190] CHIP:TOO: EndpointListID: 57347 [1658480080.135415][26185:26190] CHIP:TOO: SupportedCommands: 1 - [1658480080.135430][26185:26190] CHIP:TOO: Status: 0 + [1658480080.135430][26185:26190] CHIP:TOO: State: 0 [1658480080.135443][26185:26190] CHIP:TOO: } disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml index 4eb169f21ee29a..77dca1f2a1267d 100644 --- a/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml @@ -91,6 +91,7 @@ tests: command: "readAttribute" attribute: "DataModelRevision" response: + value: 17 saveAs: DataModelRevisionValue constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml index 52255fda9f1b09..a37f2954b1c75c 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml @@ -11,9 +11,8 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 130.2.1. [TC-BRBINFO-2.1] Attributes [DUT-Server] +name: 142.2.1. [TC-BRBINFO-2.1] Attributes [DUT-Server] PICS: - BRBINFO.S @@ -23,6 +22,8 @@ config: cluster: "Bridged Device Basic Information" endpoint: 3 + BRBINFO.ClusterId: 0x0039 + tests: - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" @@ -32,6 +33,22 @@ tests: - name: "nodeId" value: nodeId + - label: + "Step 2: TH reads attribute ID 0 from the DUT (matches in ID to + DataModelRevision in the parent cluster, but is absent on the + BridgedDeviceBasicInformation cluster)." + PICS: BRBINFO.S + cluster: "AnyCommands" + command: "ReadById" + arguments: + values: + - name: "ClusterId" + value: BRBINFO.ClusterId + - name: "AttributeId" + value: 0x0000 + response: + error: UNSUPPORTED_ATTRIBUTE + - label: "Step 5: TH reads VendorName from the DUT." PICS: BRBINFO.S.A0001 command: "readAttribute" @@ -123,6 +140,22 @@ tests: response: value: ProductNameValue + - label: + "Step 14: TH reads attribute ID 4 from the DUT (matches in ID to + ProductID in the parent cluster, but is absent on the + BridgedDeviceBasicInformation cluster)." + PICS: BRBINFO.S + cluster: "AnyCommands" + command: "ReadById" + arguments: + values: + - name: "ClusterId" + value: BRBINFO.ClusterId + - name: "AttributeId" + value: 0x0004 + response: + error: UNSUPPORTED_ATTRIBUTE + - label: "Step 17: TH reads NodeLabel from the DUT" PICS: BRBINFO.S.A0005 command: "readAttribute" @@ -180,6 +213,22 @@ tests: - name: "expectedValue" value: "y" + - label: + "Step 20: TH reads attribute ID 6 from the DUT (matches in ID to + Location in the parent cluster, but is absent on the + BridgedDeviceBasicInformation cluster)." + PICS: BRBINFO.S + cluster: "AnyCommands" + command: "ReadById" + arguments: + values: + - name: "ClusterId" + value: BRBINFO.ClusterId + - name: "AttributeId" + value: 0x0006 + response: + error: UNSUPPORTED_ATTRIBUTE + - label: "Step 21: TH reads HardwareVersion from the DUT" PICS: BRBINFO.S.A0007 command: "readAttribute" @@ -456,6 +505,22 @@ tests: response: value: SerialNumberValue + - label: + "Step 48: TH reads attribute ID 0x0010 from the DUT (matches in ID to + LocalConfigDisabled in the parent cluster, but is absent on the + BridgedDeviceBasicInformation cluster)." + PICS: BRBINFO.S + cluster: "AnyCommands" + command: "ReadById" + arguments: + values: + - name: "ClusterId" + value: BRBINFO.ClusterId + - name: "AttributeId" + value: 0x0010 + response: + error: UNSUPPORTED_ATTRIBUTE + - label: "Step 51: TH reads Reachable from the DUT." PICS: BRBINFO.S.A0011 command: "readAttribute" @@ -511,6 +576,22 @@ tests: response: value: UniqueIDValue + - label: + "Step 56: TH reads attribute ID 0x0013 from the DUT (matches in ID to + CapabilityMinima in the parent cluster, but is absent on the + BridgedDeviceBasicInformation cluster)." + PICS: BRBINFO.S + cluster: "AnyCommands" + command: "ReadById" + arguments: + values: + - name: "ClusterId" + value: BRBINFO.ClusterId + - name: "AttributeId" + value: 0x0013 + response: + error: UNSUPPORTED_ATTRIBUTE + - label: "Step 59: TH reads ProductAppearance from the DUT." PICS: BRBINFO.S.A0014 command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_BR_1.yaml b/src/app/tests/suites/certification/Test_TC_BR_1.yaml old mode 100644 new mode 100755 index 82a7eb749d8565..e710fc3f29ff03 --- a/src/app/tests/suites/certification/Test_TC_BR_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BR_1.yaml @@ -45,7 +45,7 @@ tests: [1666243894.572001][44943:44948] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4030820095 [1666243894.607978][44943:44948] CHIP:TOO: DeviceTypeList: 1 entries [1666243894.608027][44943:44948] CHIP:TOO: [1]: { - [1666243894.608071][44943:44948] CHIP:TOO: Type: 22 + [1666243894.608071][44943:44948] CHIP:TOO: DeviceType: 22 [1666243894.608096][44943:44948] CHIP:TOO: Revision: 1 [1666243894.608126][44943:44948] CHIP:TOO: } disabled: true @@ -57,10 +57,10 @@ tests: verification: | ./chip-tool descriptor read parts-list 1 0 - Via the TH (chip-tool), Verify the PartList that contains list with 12 entries. + Via the TH (chip-tool), Verify the PartList that contains list with 11 entries. [1657002201.045720][3893:3899] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3573910940 - [1657002201.045841][3893:3899] CHIP:TOO: parts list: 12 entries + [1657002201.045841][3893:3899] CHIP:TOO: PartsList: 11 entries [1657002201.045887][3893:3899] CHIP:TOO: [1]: 1 [1657002201.045925][3893:3899] CHIP:TOO: [2]: 3 [1657002201.045963][3893:3899] CHIP:TOO: [3]: 4 @@ -72,7 +72,6 @@ tests: [1657002201.046184][3893:3899] CHIP:TOO: [9]: 10 [1657002201.046221][3893:3899] CHIP:TOO: [10]: 11 [1657002201.046259][3893:3899] CHIP:TOO: [11]: 12 - [1657002201.046296][3893:3899] CHIP:TOO: [12]: 13 disabled: true - label: @@ -89,7 +88,7 @@ tests: 1666244345.296680][44990:44995] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 [1666244345.296742][44990:44995] CHIP:TOO: DeviceTypeList: 1 entries [1666244345.296800][44990:44995] CHIP:TOO: [1]: { - [1666244345.296846][44990:44995] CHIP:TOO: Type: 14 + [1666244345.296846][44990:44995] CHIP:TOO: DeviceType: 14 [1666244345.296874][44990:44995] CHIP:TOO: Revision: 1 [1666244345.296904][44990:44995] CHIP:TOO: } @@ -100,11 +99,11 @@ tests: [1666244839.544979][45200:45205] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1513076890 [1666244839.545006][45200:45205] CHIP:TOO: DeviceTypeList: 2 entries [1666244839.545019][45200:45205] CHIP:TOO: [1]: { - [1666244839.545027][45200:45205] CHIP:TOO: Type: 256 + [1666244839.545027][45200:45205] CHIP:TOO: DeviceType: 256 [1666244839.545035][45200:45205] CHIP:TOO: Revision: 1 [1666244839.545042][45200:45205] CHIP:TOO: } [1666244839.545051][45200:45205] CHIP:TOO: [2]: { - [1666244839.545058][45200:45205] CHIP:TOO: Type: 19 + [1666244839.545058][45200:45205] CHIP:TOO: DeviceType: 19 [1666244839.545066][45200:45205] CHIP:TOO: Revision: 1 [1666244839.545073][45200:45205] CHIP:TOO: } @@ -117,11 +116,11 @@ tests: [1666244925.833459][45215:45220] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 [1666244925.833553][45215:45220] CHIP:TOO: DeviceTypeList: 2 entries [1666244925.833599][45215:45220] CHIP:TOO: [1]: { - [1666244925.833627][45215:45220] CHIP:TOO: Type: 770 + [1666244925.833627][45215:45220] CHIP:TOO: DeviceType: 770 [1666244925.833658][45215:45220] CHIP:TOO: Revision: 1 [1666244925.833686][45215:45220] CHIP:TOO: } [1666244925.833726][45215:45220] CHIP:TOO: [2]: { - [1666244925.833752][45215:45220] CHIP:TOO: Type: 19 + [1666244925.833752][45215:45220] CHIP:TOO: DeviceType: 19 [1666244925.833781][45215:45220] CHIP:TOO: Revision: 1 [1666244925.833809][45215:45220] CHIP:TOO: } @@ -130,28 +129,35 @@ tests: Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 5. - [1666244984.115887][45249:45254] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1760060075 - [1666244984.115918][45249:45254] CHIP:TOO: DeviceTypeList: 2 entries - [1666244984.115939][45249:45254] CHIP:TOO: [1]: { - [1666244984.115954][45249:45254] CHIP:TOO: Type: 770 - [1666244984.115963][45249:45254] CHIP:TOO: Revision: 1 - [1666244984.115971][45249:45254] CHIP:TOO: } - [1666244984.115982][45249:45254] CHIP:TOO: [2]: { - [1666244984.115990][45249:45254] CHIP:TOO: Type: 19 - [1666244984.115997][45249:45254] CHIP:TOO: Revision: 1 - [1666244984.116005][45249:45254] CHIP:TOO: } + [1692170726.055153][8028:8031] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1085687870 + [1692170726.055261][8028:8031] CHIP:TOO: DeviceTypeList: 2 entries + [1692170726.055331][8028:8031] CHIP:TOO: [1]: { + [1692170726.055370][8028:8031] CHIP:TOO: DeviceType: 770 + [1692170726.055407][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055441][8028:8031] CHIP:TOO: } + [1692170726.055484][8028:8031] CHIP:TOO: [2]: { + [1692170726.055520][8028:8031] CHIP:TOO: DeviceType: 19 + [1692170726.055553][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055591][8028:8031] CHIP:TOO: } + + ./chip-tool descriptor read device-type-list 1 6 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 6. - [1666246675.944572][45787:45792] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3539120641 - [1666246675.944625][45787:45792] CHIP:TOO: DeviceTypeList: 1 entries - [1666246675.944679][45787:45792] CHIP:TOO: [1]: { - [1666246675.944722][45787:45792] CHIP:TOO: Type: 19 - [1666246675.944746][45787:45792] CHIP:TOO: Revision: 1 - [1666246675.944768][45787:45792] CHIP:TOO: } + [1692170742.458148][8033:8035] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2945297824 + [1692170742.458231][8033:8035] CHIP:TOO: DeviceTypeList: 2 entries + [1692170742.458282][8033:8035] CHIP:TOO: [1]: { + [1692170742.458310][8033:8035] CHIP:TOO: DeviceType: 19 + [1692170742.458348][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458372][8033:8035] CHIP:TOO: } + [1692170742.458412][8033:8035] CHIP:TOO: [2]: { + [1692170742.458437][8033:8035] CHIP:TOO: DeviceType: 17 + [1692170742.458461][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458526][8033:8035] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 7 @@ -161,7 +167,7 @@ tests: [1666246718.470591][45821:45826] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3285189124 [1666246718.470649][45821:45826] CHIP:TOO: DeviceTypeList: 1 entries [1666246718.470678][45821:45826] CHIP:TOO: [1]: { - [1666246718.470697][45821:45826] CHIP:TOO: Type: 770 + [1666246718.470697][45821:45826] CHIP:TOO: DeviceType: 770 [1666246718.470715][45821:45826] CHIP:TOO: Revision: 1 [1666246718.470733][45821:45826] CHIP:TOO: } @@ -173,7 +179,7 @@ tests: [1666246775.067195][45834:45839] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3210151050 [1666246775.067256][45834:45839] CHIP:TOO: DeviceTypeList: 1 entries [1666246775.067297][45834:45839] CHIP:TOO: [1]: { - [1666246775.067324][45834:45839] CHIP:TOO: Type: 770 + [1666246775.067324][45834:45839] CHIP:TOO: DeviceType: 770 [1666246775.067350][45834:45839] CHIP:TOO: Revision: 1 [1666246775.067375][45834:45839] CHIP:TOO: } @@ -182,12 +188,17 @@ tests: Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 9. - [1666246820.646933][45893:45898] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3716023031 - [1666246820.647028][45893:45898] CHIP:TOO: DeviceTypeList: 1 entries - [1666246820.647085][45893:45898] CHIP:TOO: [1]: { - [1666246820.647147][45893:45898] CHIP:TOO: Type: 17 - [1666246820.647186][45893:45898] CHIP:TOO: Revision: 1 - [1666246820.647214][45893:45898] CHIP:TOO: } + [1692170786.513524][8042:8044] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 133253296 + [1692170786.513603][8042:8044] CHIP:TOO: DeviceTypeList: 2 entries + [1692170786.513654][8042:8044] CHIP:TOO: [1]: { + [1692170786.513681][8042:8044] CHIP:TOO: DeviceType: 256 + [1692170786.513706][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513730][8042:8044] CHIP:TOO: } + [1692170786.513759][8042:8044] CHIP:TOO: [2]: { + [1692170786.513785][8042:8044] CHIP:TOO: DeviceType: 19 + [1692170786.513809][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513833][8042:8044] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 10 @@ -197,11 +208,11 @@ tests: [1666246866.935280][45904:45909] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 [1666246866.935412][45904:45909] CHIP:TOO: DeviceTypeList: 2 entries [1666246866.935484][45904:45909] CHIP:TOO: [1]: { - [1666246866.935538][45904:45909] CHIP:TOO: Type: 256 + [1666246866.935538][45904:45909] CHIP:TOO: DeviceType: 256 [1666246866.935564][45904:45909] CHIP:TOO: Revision: 1 [1666246866.935587][45904:45909] CHIP:TOO: } [1666246866.935620][45904:45909] CHIP:TOO: [2]: { - [1666246866.935644][45904:45909] CHIP:TOO: Type: 19 + [1666246866.935644][45904:45909] CHIP:TOO: DeviceType: 19 [1666246866.935668][45904:45909] CHIP:TOO: Revision: 1 [1666246866.935691][45904:45909] CHIP:TOO: } @@ -212,11 +223,11 @@ tests: [1666246922.797443][45920:45925] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 [1666246922.797466][45920:45925] CHIP:TOO: DeviceTypeList: 2 entries [1666246922.797484][45920:45925] CHIP:TOO: [1]: { - [1666246922.797497][45920:45925] CHIP:TOO: Type: 256 + [1666246922.797497][45920:45925] CHIP:TOO: DeviceType: 256 [1666246922.797504][45920:45925] CHIP:TOO: Revision: 1 [1666246922.797512][45920:45925] CHIP:TOO: } [1666246922.797521][45920:45925] CHIP:TOO: [2]: { - [1666246922.797527][45920:45925] CHIP:TOO: Type: 19 + [1666246922.797527][45920:45925] CHIP:TOO: DeviceType: 19 [1666246922.797533][45920:45925] CHIP:TOO: Revision: 1 [1666246922.797539][45920:45925] CHIP:TOO: } @@ -228,35 +239,20 @@ tests: [1666246970.442284][45932:45937] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 [1666246970.442340][45932:45937] CHIP:TOO: DeviceTypeList: 2 entries [1666246970.442386][45932:45937] CHIP:TOO: [1]: { - [1666246970.442414][45932:45937] CHIP:TOO: Type: 256 + [1666246970.442414][45932:45937] CHIP:TOO: DeviceType: 256 [1666246970.442446][45932:45937] CHIP:TOO: Revision: 1 [1666246970.442474][45932:45937] CHIP:TOO: } [1666246970.442513][45932:45937] CHIP:TOO: [2]: { - [1666246970.442541][45932:45937] CHIP:TOO: Type: 19 + [1666246970.442541][45932:45937] CHIP:TOO: DeviceType: 19 [1666246970.442570][45932:45937] CHIP:TOO: Revision: 1 [1666246970.442597][45932:45937] CHIP:TOO: } - - - ./chip-tool descriptor read device-type-list 1 13 - - Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 13. - - [1666247013.621248][45940:45945] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1009438523 - [1666247013.621381][45940:45945] CHIP:TOO: DeviceTypeList: 2 entries - [1666247013.621410][45940:45945] CHIP:TOO: [1]: { - [1666247013.621426][45940:45945] CHIP:TOO: Type: 256 - [1666247013.621442][45940:45945] CHIP:TOO: Revision: 1 - [1666247013.621458][45940:45945] CHIP:TOO: } - [1666247013.621478][45940:45945] CHIP:TOO: [2]: { - [1666247013.621492][45940:45945] CHIP:TOO: Type: 19 - [1666247013.621506][45940:45945] CHIP:TOO: Revision: 1 - [1666247013.621520][45940:45945] CHIP:TOO: } disabled: true - label: - "IF 0 endpoints found in step 1c, FAIL the test (no Aggregator device - type found). ELSE Execute test steps 2a..7d for each of the endpoints - found in step 1c (i.e. for each of the Aggregator device types)" + "Step 1d: If 0 endpoints found in step 1c, FAIL the test (no + Aggregator device type found). ELSE Execute test steps 2a..7d for each + of the endpoints found in step 1c (i.e. for each of the Aggregator + device types)" PICS: MCORE.BRIDGE verification: | From Step1c, list all the endpoints having the aggregator i.e., 0x000e=14 @@ -273,10 +269,10 @@ tests: ./chip-tool descriptor read parts-list 1 1 - Via the TH (chip-tool), Verify the PartList attribute that contains 11 entries. + Via the TH (chip-tool), Verify the PartList attribute that contains 10 entries. [1657002810.697118][4121:4126] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3021853414 - [1657002810.697276][4121:4126] CHIP:TOO: parts list: 11 entries + [1657002810.697276][4121:4126] CHIP:TOO: PartsList: 10 entries [1657002810.697312][4121:4126] CHIP:TOO: [1]: 3 [1657002810.697342][4121:4126] CHIP:TOO: [2]: 4 [1657002810.697370][4121:4126] CHIP:TOO: [3]: 5 @@ -287,7 +283,6 @@ tests: [1657002810.697508][4121:4126] CHIP:TOO: [8]: 10 [1657002810.697536][4121:4126] CHIP:TOO: [9]: 11 [1657002810.697564][4121:4126] CHIP:TOO: [10]: 12 - [1657002810.697592][4121:4126] CHIP:TOO: [11]: 13 disabled: true - label: @@ -302,159 +297,152 @@ tests: Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 3. - [1666248913.681607][46430:46435] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1513076890 - [1666248913.681690][46430:46435] CHIP:TOO: DeviceTypeList: 2 entries - [1666248913.681759][46430:46435] CHIP:TOO: [1]: { - [1666248913.681816][46430:46435] CHIP:TOO: Type: 256 - [1666248913.681852][46430:46435] CHIP:TOO: Revision: 1 - [1666248913.681945][46430:46435] CHIP:TOO: } - [1666248913.682016][46430:46435] CHIP:TOO: [2]: { - [1666248913.682084][46430:46435] CHIP:TOO: Type: 19 - [1666248913.682150][46430:46435] CHIP:TOO: Revision: 1 - [1666248913.682216][46430:46435] CHIP:TOO: } + [1692171059.950664][8067:8069] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3602148034 + [1692171059.950744][8067:8069] CHIP:TOO: DeviceTypeList: 2 entries + [1692171059.950794][8067:8069] CHIP:TOO: [1]: { + [1692171059.950821][8067:8069] CHIP:TOO: DeviceType: 256 + [1692171059.950847][8067:8069] CHIP:TOO: Revision: 1 + [1692171059.950871][8067:8069] CHIP:TOO: } + [1692171059.950900][8067:8069] CHIP:TOO: [2]: { + [1692171059.950925][8067:8069] CHIP:TOO: DeviceType: 19 + [1692171059.950950][8067:8069] CHIP:TOO: Revision: 1 + [1692171059.950973][8067:8069] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 4 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 4. - [1666249581.063940][46547:46552] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 - [1666249581.064029][46547:46552] CHIP:TOO: DeviceTypeList: 2 entries - [1666249581.064089][46547:46552] CHIP:TOO: [1]: { - [1666249581.064133][46547:46552] CHIP:TOO: Type: 770 - [1666249581.064160][46547:46552] CHIP:TOO: Revision: 1 - [1666249581.064193][46547:46552] CHIP:TOO: } - [1666249581.064238][46547:46552] CHIP:TOO: [2]: { - [1666249581.064266][46547:46552] CHIP:TOO: Type: 19 - [1666249581.064299][46547:46552] CHIP:TOO: Revision: 1 - [1666249581.064329][46547:46552] CHIP:TOO: } + [1692171076.310693][8071:8073] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2924004864 + [1692171076.310779][8071:8073] CHIP:TOO: DeviceTypeList: 2 entries + [1692171076.310836][8071:8073] CHIP:TOO: [1]: { + [1692171076.310866][8071:8073] CHIP:TOO: DeviceType: 770 + [1692171076.310895][8071:8073] CHIP:TOO: Revision: 1 + [1692171076.310921][8071:8073] CHIP:TOO: } + [1692171076.310954][8071:8073] CHIP:TOO: [2]: { + [1692171076.310982][8071:8073] CHIP:TOO: DeviceType: 19 + [1692171076.311006][8071:8073] CHIP:TOO: Revision: 1 + [1692171076.311031][8071:8073] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 5 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 5. - [1666249707.579997][46594:46599] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1760060075 - [1666249707.580060][46594:46599] CHIP:TOO: DeviceTypeList: 2 entries - [1666249707.580110][46594:46599] CHIP:TOO: [1]: { - [1666249707.580147][46594:46599] CHIP:TOO: Type: 770 - [1666249707.580169][46594:46599] CHIP:TOO: Revision: 1 - [1666249707.580190][46594:46599] CHIP:TOO: } - [1666249707.580227][46594:46599] CHIP:TOO: [2]: { - [1666249707.580254][46594:46599] CHIP:TOO: Type: 19 - [1666249707.580281][46594:46599] CHIP:TOO: Revision: 1 - [1666249707.580366][46594:46599] CHIP:TOO: } + [1692171088.637352][8075:8077] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1085687870 + [1692171088.637452][8075:8077] CHIP:TOO: DeviceTypeList: 2 entries + [1692171088.637518][8075:8077] CHIP:TOO: [1]: { + [1692171088.637554][8075:8077] CHIP:TOO: DeviceType: 770 + [1692171088.637588][8075:8077] CHIP:TOO: Revision: 1 + [1692171088.637619][8075:8077] CHIP:TOO: } + [1692171088.637657][8075:8077] CHIP:TOO: [2]: { + [1692171088.637690][8075:8077] CHIP:TOO: DeviceType: 19 + [1692171088.637722][8075:8077] CHIP:TOO: Revision: 1 + [1692171088.637752][8075:8077] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 6 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 6. - [1666249778.844305][46630:46635] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3539120641 - [1666249778.844394][46630:46635] CHIP:TOO: DeviceTypeList: 1 entries - [1666249778.844453][46630:46635] CHIP:TOO: [1]: { - [1666249778.844499][46630:46635] CHIP:TOO: Type: 19 - [1666249778.844532][46630:46635] CHIP:TOO: Revision: 1 - [1666249778.844560][46630:46635] CHIP:TOO: } + [1692171113.001178][8078:8080] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2945297824 + [1692171113.001257][8078:8080] CHIP:TOO: DeviceTypeList: 2 entries + [1692171113.001308][8078:8080] CHIP:TOO: [1]: { + [1692171113.001337][8078:8080] CHIP:TOO: DeviceType: 19 + [1692171113.001365][8078:8080] CHIP:TOO: Revision: 1 + [1692171113.001390][8078:8080] CHIP:TOO: } + [1692171113.001419][8078:8080] CHIP:TOO: [2]: { + [1692171113.001444][8078:8080] CHIP:TOO: DeviceType: 17 + [1692171113.001468][8078:8080] CHIP:TOO: Revision: 1 + [1692171113.001492][8078:8080] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 7 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 7. - [1666249851.031384][46650:46655] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3285189124 - [1666249851.031468][46650:46655] CHIP:TOO: DeviceTypeList: 1 entries - [1666249851.031525][46650:46655] CHIP:TOO: [1]: { - [1666249851.031566][46650:46655] CHIP:TOO: Type: 770 - [1666249851.031590][46650:46655] CHIP:TOO: Revision: 1 - [1666249851.031613][46650:46655] CHIP:TOO: } + [1692171129.359054][8081:8083] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3151093197 + [1692171129.359124][8081:8083] CHIP:TOO: DeviceTypeList: 1 entries + [1692171129.359173][8081:8083] CHIP:TOO: [1]: { + [1692171129.359201][8081:8083] CHIP:TOO: DeviceType: 770 + [1692171129.359225][8081:8083] CHIP:TOO: Revision: 1 + [1692171129.359248][8081:8083] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 8 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 8. - [1666249888.738349][46686:46691] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3210151050 - [1666249888.738375][46686:46691] CHIP:TOO: DeviceTypeList: 1 entries - [1666249888.738389][46686:46691] CHIP:TOO: [1]: { - [1666249888.738397][46686:46691] CHIP:TOO: Type: 770 - [1666249888.738407][46686:46691] CHIP:TOO: Revision: 1 - [1666249888.738415][46686:46691] CHIP:TOO: } + [1692171146.665631][8084:8086] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2174633081 + [1692171146.665698][8084:8086] CHIP:TOO: DeviceTypeList: 1 entries + [1692171146.665740][8084:8086] CHIP:TOO: [1]: { + [1692171146.665764][8084:8086] CHIP:TOO: DeviceType: 770 + [1692171146.665796][8084:8086] CHIP:TOO: Revision: 1 + [1692171146.665816][8084:8086] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 9 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 9. - [1666249928.585516][46696:46701] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3716023031 - [1666249928.585580][46696:46701] CHIP:TOO: DeviceTypeList: 1 entries - [1666249928.585625][46696:46701] CHIP:TOO: [1]: { - [1666249928.585658][46696:46701] CHIP:TOO: Type: 17 - [1666249928.585677][46696:46701] CHIP:TOO: Revision: 1 - [1666249928.585694][46696:46701] CHIP:TOO: } + [1692171159.436406][8087:8089] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 133253296 + [1692171159.436485][8087:8089] CHIP:TOO: DeviceTypeList: 2 entries + [1692171159.436536][8087:8089] CHIP:TOO: [1]: { + [1692171159.436564][8087:8089] CHIP:TOO: DeviceType: 256 + [1692171159.436590][8087:8089] CHIP:TOO: Revision: 1 + [1692171159.436614][8087:8089] CHIP:TOO: } + [1692171159.436643][8087:8089] CHIP:TOO: [2]: { + [1692171159.436667][8087:8089] CHIP:TOO: DeviceType: 19 + [1692171159.436691][8087:8089] CHIP:TOO: Revision: 1 + [1692171159.436713][8087:8089] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 10 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 10. - [1666250003.848251][46707:46712] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 - [1666250003.848342][46707:46712] CHIP:TOO: DeviceTypeList: 2 entries - [1666250003.848421][46707:46712] CHIP:TOO: [1]: { - [1666250003.848470][46707:46712] CHIP:TOO: Type: 256 - [1666250003.848499][46707:46712] CHIP:TOO: Revision: 1 - [1666250003.848524][46707:46712] CHIP:TOO: } - [1666250003.848559][46707:46712] CHIP:TOO: [2]: { - [1666250003.848586][46707:46712] CHIP:TOO: Type: 19 - [1666250003.848612][46707:46712] CHIP:TOO: Revision: 1 - [1666250003.848635][46707:46712] CHIP:TOO: } + [1692171176.286034][8090:8092] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1097961071 + [1692171176.286128][8090:8092] CHIP:TOO: DeviceTypeList: 2 entries + [1692171176.286187][8090:8092] CHIP:TOO: [1]: { + [1692171176.286222][8090:8092] CHIP:TOO: DeviceType: 256 + [1692171176.286252][8090:8092] CHIP:TOO: Revision: 1 + [1692171176.286284][8090:8092] CHIP:TOO: } + [1692171176.286319][8090:8092] CHIP:TOO: [2]: { + [1692171176.286348][8090:8092] CHIP:TOO: DeviceType: 19 + [1692171176.286374][8090:8092] CHIP:TOO: Revision: 1 + [1692171176.286403][8090:8092] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 11 + ./chip-tool descriptor read device-type-list 1 11 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 11. - [1666250205.808189][46800:46805] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 - [1666250205.808274][46800:46805] CHIP:TOO: DeviceTypeList: 2 entries - [1666250205.808355][46800:46805] CHIP:TOO: [1]: { - [1666250205.808406][46800:46805] CHIP:TOO: Type: 256 - [1666250205.808436][46800:46805] CHIP:TOO: Revision: 1 - [1666250205.808468][46800:46805] CHIP:TOO: } - [1666250205.808509][46800:46805] CHIP:TOO: [2]: { - [1666250205.808542][46800:46805] CHIP:TOO: Type: 19 - [1666250205.808574][46800:46805] CHIP:TOO: Revision: 1 - [1666250205.808603][46800:46805] CHIP:TOO: } + [1692171194.333493][8093:8095] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 429507522 + [1692171194.333569][8093:8095] CHIP:TOO: DeviceTypeList: 2 entries + [1692171194.333616][8093:8095] CHIP:TOO: [1]: { + [1692171194.333642][8093:8095] CHIP:TOO: DeviceType: 256 + [1692171194.333665][8093:8095] CHIP:TOO: Revision: 1 + [1692171194.333688][8093:8095] CHIP:TOO: } + [1692171194.333715][8093:8095] CHIP:TOO: [2]: { + [1692171194.333738][8093:8095] CHIP:TOO: DeviceType: 19 + [1692171194.333760][8093:8095] CHIP:TOO: Revision: 1 + [1692171194.333782][8093:8095] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 12 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 12. - [1666250398.116886][46821:46826] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 - [1666250398.116974][46821:46826] CHIP:TOO: DeviceTypeList: 2 entries - [1666250398.117056][46821:46826] CHIP:TOO: [1]: { - [1666250398.117107][46821:46826] CHIP:TOO: Type: 256 - [1666250398.117133][46821:46826] CHIP:TOO: Revision: 1 - [1666250398.117156][46821:46826] CHIP:TOO: } - [1666250398.117189][46821:46826] CHIP:TOO: [2]: { - [1666250398.117212][46821:46826] CHIP:TOO: Type: 19 - [1666250398.117235][46821:46826] CHIP:TOO: Revision: 1 - [1666250398.117296][46821:46826] CHIP:TOO: } - - - ./chip-tool descriptor read device-type-list 1 13 - - Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 13. - - [1666250472.105194][46833:46838] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1009438523 - [1666250472.105364][46833:46838] CHIP:TOO: DeviceTypeList: 2 entries - [1666250472.105428][46833:46838] CHIP:TOO: [1]: { - [1666250472.105472][46833:46838] CHIP:TOO: Type: 256 - [1666250472.105498][46833:46838] CHIP:TOO: Revision: 1 - [1666250472.105527][46833:46838] CHIP:TOO: } - [1666250472.105561][46833:46838] CHIP:TOO: [2]: { - [1666250472.105584][46833:46838] CHIP:TOO: Type: 19 - [1666250472.105608][46833:46838] CHIP:TOO: Revision: 1 - [1666250472.105630][46833:46838] CHIP:TOO: } + [1692171218.674782][8096:8098] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2573884958 + [1692171218.674856][8096:8098] CHIP:TOO: DeviceTypeList: 2 entries + [1692171218.674901][8096:8098] CHIP:TOO: [1]: { + [1692171218.674925][8096:8098] CHIP:TOO: DeviceType: 256 + [1692171218.674946][8096:8098] CHIP:TOO: Revision: 1 + [1692171218.674967][8096:8098] CHIP:TOO: } + [1692171218.674992][8096:8098] CHIP:TOO: [2]: { + [1692171218.675013][8096:8098] CHIP:TOO: DeviceType: 19 + [1692171218.675032][8096:8098] CHIP:TOO: Revision: 1 + [1692171218.675052][8096:8098] CHIP:TOO: } disabled: true - label: @@ -469,7 +457,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 3. [1657013905.333904][5805:5810] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 4168180 - [1657013905.333984][5805:5810] CHIP:TOO: parts list: 0 entries + [1657013905.333984][5805:5810] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 4 @@ -477,7 +465,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 4. [1657014011.276060][5822:5827] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2935336058 - [1657014011.276141][5822:5827] CHIP:TOO: parts list: 0 entries + [1657014011.276141][5822:5827] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 5 @@ -485,24 +473,23 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 5. [1657014034.298958][5829:5834] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3372622835 - [1657014034.299041][5829:5834] CHIP:TOO: parts list: 0 entries + [1657014034.299041][5829:5834] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 6 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 6. [1657014056.893995][5847:5852] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1565587733 - [1657014056.894072][5847:5852] CHIP:TOO: parts list: 3 entries + [1657014056.894072][5847:5852] CHIP:TOO: PartsList: 2 entries [1657014056.894104][5847:5852] CHIP:TOO: [1]: 7 [1657014056.894130][5847:5852] CHIP:TOO: [2]: 8 - [1657014056.894154][5847:5852] CHIP:TOO: [3]: 9 ./chip-tool descriptor read parts-list 1 7 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 7. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 8 @@ -542,14 +529,6 @@ tests: [1663236715.610271][5579:5584] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2445783348 [1663236715.610328][5579:5584] CHIP:TOO: PartsList: 0 entries - - - ./chip-tool descriptor read parts-list 1 13 - - Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 13. - - [1663236752.985450][5590:5595] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 4223376445 - [1663236752.985512][5590:5595] CHIP:TOO: PartsList: 0 entries disabled: true - label: @@ -605,123 +584,152 @@ tests: Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 3. - [1666250653.988384][46910:46915] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1513076890 - [1666250653.988484][46910:46915] CHIP:TOO: DeviceTypeList: 2 entries - [1666250653.988526][46910:46915] CHIP:TOO: [1]: { - [1666250653.988554][46910:46915] CHIP:TOO: Type: 256 - [1666250653.988580][46910:46915] CHIP:TOO: Revision: 1 - [1666250653.988605][46910:46915] CHIP:TOO: } - [1666250653.988643][46910:46915] CHIP:TOO: [2]: { - [1666250653.988668][46910:46915] CHIP:TOO: Type: 19 - [1666250653.988693][46910:46915] CHIP:TOO: Revision: 1 - [1666250653.988715][46910:46915] CHIP:TOO: } + [1692171059.950664][8067:8069] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3602148034 + [1692171059.950744][8067:8069] CHIP:TOO: DeviceTypeList: 2 entries + [1692171059.950794][8067:8069] CHIP:TOO: [1]: { + [1692171059.950821][8067:8069] CHIP:TOO: DeviceType: 256 + [1692171059.950847][8067:8069] CHIP:TOO: Revision: 1 + [1692171059.950871][8067:8069] CHIP:TOO: } + [1692171059.950900][8067:8069] CHIP:TOO: [2]: { + [1692171059.950925][8067:8069] CHIP:TOO: DeviceType: 19 + [1692171059.950950][8067:8069] CHIP:TOO: Revision: 1 + [1692171059.950973][8067:8069] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 4 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 4. - [1666250817.223402][46942:46947] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 - [1666250817.223467][46942:46947] CHIP:TOO: DeviceTypeList: 2 entries - [1666250817.223524][46942:46947] CHIP:TOO: [1]: { - [1666250817.223544][46942:46947] CHIP:TOO: Type: 770 - [1666250817.223563][46942:46947] CHIP:TOO: Revision: 1 - [1666250817.223581][46942:46947] CHIP:TOO: } - [1666250817.223603][46942:46947] CHIP:TOO: [2]: { - [1666250817.223620][46942:46947] CHIP:TOO: Type: 19 - [1666250817.223638][46942:46947] CHIP:TOO: Revision: 1 - [1666250817.223654][46942:46947] CHIP:TOO: } + [1692171076.310693][8071:8073] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2924004864 + [1692171076.310779][8071:8073] CHIP:TOO: DeviceTypeList: 2 entries + [1692171076.310836][8071:8073] CHIP:TOO: [1]: { + [1692171076.310866][8071:8073] CHIP:TOO: DeviceType: 770 + [1692171076.310895][8071:8073] CHIP:TOO: Revision: 1 + [1692171076.310921][8071:8073] CHIP:TOO: } + [1692171076.310954][8071:8073] CHIP:TOO: [2]: { + [1692171076.310982][8071:8073] CHIP:TOO: DeviceType: 19 + [1692171076.311006][8071:8073] CHIP:TOO: Revision: 1 + [1692171076.311031][8071:8073] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 5 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 5. - [1666250873.731351][46954:46959] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1760060075 - [1666250873.731439][46954:46959] CHIP:TOO: DeviceTypeList: 2 entries - [1666250873.731482][46954:46959] CHIP:TOO: [1]: { - [1666250873.731510][46954:46959] CHIP:TOO: Type: 770 - [1666250873.731539][46954:46959] CHIP:TOO: Revision: 1 - [1666250873.731565][46954:46959] CHIP:TOO: } - [1666250873.731598][46954:46959] CHIP:TOO: [2]: { - [1666250873.731623][46954:46959] CHIP:TOO: Type: 19 - [1666250873.731647][46954:46959] CHIP:TOO: Revision: 1 - [1666250873.731672][46954:46959] CHIP:TOO: } + [1692171088.637352][8075:8077] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1085687870 + [1692171088.637452][8075:8077] CHIP:TOO: DeviceTypeList: 2 entries + [1692171088.637518][8075:8077] CHIP:TOO: [1]: { + [1692171088.637554][8075:8077] CHIP:TOO: DeviceType: 770 + [1692171088.637588][8075:8077] CHIP:TOO: Revision: 1 + [1692171088.637619][8075:8077] CHIP:TOO: } + [1692171088.637657][8075:8077] CHIP:TOO: [2]: { + [1692171088.637690][8075:8077] CHIP:TOO: DeviceType: 19 + [1692171088.637722][8075:8077] CHIP:TOO: Revision: 1 + [1692171088.637752][8075:8077] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 6 + ./chip-tool descriptor read device-type-list 1 6 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 6. - [1666777557.437994][150164:150169] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3270810303 - [1666777557.438067][150164:150169] CHIP:TOO: DeviceTypeList: 1 entries - [1666777557.438105][150164:150169] CHIP:TOO: [1]: { - [1666777557.438156][150164:150169] CHIP:TOO: Type: 19 - [1666777557.438188][150164:150169] CHIP:TOO: Revision: 1 - [1666777557.438209][150164:150169] CHIP:TOO: } + [1692171113.001178][8078:8080] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2945297824 + [1692171113.001257][8078:8080] CHIP:TOO: DeviceTypeList: 2 entries + [1692171113.001308][8078:8080] CHIP:TOO: [1]: { + [1692171113.001337][8078:8080] CHIP:TOO: DeviceType: 19 + [1692171113.001365][8078:8080] CHIP:TOO: Revision: 1 + [1692171113.001390][8078:8080] CHIP:TOO: } + [1692171113.001419][8078:8080] CHIP:TOO: [2]: { + [1692171113.001444][8078:8080] CHIP:TOO: DeviceType: 17 + [1692171113.001468][8078:8080] CHIP:TOO: Revision: 1 + [1692171113.001492][8078:8080] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 7 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 7. + + [1692171129.359054][8081:8083] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3151093197 + [1692171129.359124][8081:8083] CHIP:TOO: DeviceTypeList: 1 entries + [1692171129.359173][8081:8083] CHIP:TOO: [1]: { + [1692171129.359201][8081:8083] CHIP:TOO: DeviceType: 770 + [1692171129.359225][8081:8083] CHIP:TOO: Revision: 1 + [1692171129.359248][8081:8083] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 8 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 8. + [1692171146.665631][8084:8086] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2174633081 + [1692171146.665698][8084:8086] CHIP:TOO: DeviceTypeList: 1 entries + [1692171146.665740][8084:8086] CHIP:TOO: [1]: { + [1692171146.665764][8084:8086] CHIP:TOO: DeviceType: 770 + [1692171146.665796][8084:8086] CHIP:TOO: Revision: 1 + [1692171146.665816][8084:8086] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 10 + + ./chip-tool descriptor read device-type-list 1 9 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 9. + + [1692171159.436406][8087:8089] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 133253296 + [1692171159.436485][8087:8089] CHIP:TOO: DeviceTypeList: 2 entries + [1692171159.436536][8087:8089] CHIP:TOO: [1]: { + [1692171159.436564][8087:8089] CHIP:TOO: DeviceType: 256 + [1692171159.436590][8087:8089] CHIP:TOO: Revision: 1 + [1692171159.436614][8087:8089] CHIP:TOO: } + [1692171159.436643][8087:8089] CHIP:TOO: [2]: { + [1692171159.436667][8087:8089] CHIP:TOO: DeviceType: 19 + [1692171159.436691][8087:8089] CHIP:TOO: Revision: 1 + [1692171159.436713][8087:8089] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 10 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 10. - [1666777615.234902][150178:150183] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2077823451 - [1666777615.235002][150178:150183] CHIP:TOO: DeviceTypeList: 2 entries - [1666777615.235078][150178:150183] CHIP:TOO: [1]: { - [1666777615.235114][150178:150183] CHIP:TOO: Type: 256 - [1666777615.235149][150178:150183] CHIP:TOO: Revision: 1 - [1666777615.235176][150178:150183] CHIP:TOO: } - [1666777615.235217][150178:150183] CHIP:TOO: [2]: { - [1666777615.235245][150178:150183] CHIP:TOO: Type: 19 - [1666777615.235273][150178:150183] CHIP:TOO: Revision: 1 - [1666777615.235307][150178:150183] CHIP:TOO: } + [1692171176.286034][8090:8092] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1097961071 + [1692171176.286128][8090:8092] CHIP:TOO: DeviceTypeList: 2 entries + [1692171176.286187][8090:8092] CHIP:TOO: [1]: { + [1692171176.286222][8090:8092] CHIP:TOO: DeviceType: 256 + [1692171176.286252][8090:8092] CHIP:TOO: Revision: 1 + [1692171176.286284][8090:8092] CHIP:TOO: } + [1692171176.286319][8090:8092] CHIP:TOO: [2]: { + [1692171176.286348][8090:8092] CHIP:TOO: DeviceType: 19 + [1692171176.286374][8090:8092] CHIP:TOO: Revision: 1 + [1692171176.286403][8090:8092] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 11 + ./chip-tool descriptor read device-type-list 1 11 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 11. - [1666777671.688839][150216:150221] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2814988377 - [1666777671.688927][150216:150221] CHIP:TOO: DeviceTypeList: 2 entries - [1666777671.689011][150216:150221] CHIP:TOO: [1]: { - [1666777671.689060][150216:150221] CHIP:TOO: Type: 256 - [1666777671.689089][150216:150221] CHIP:TOO: Revision: 1 - [1666777671.689133][150216:150221] CHIP:TOO: } - [1666777671.689164][150216:150221] CHIP:TOO: [2]: { - [1666777671.689197][150216:150221] CHIP:TOO: Type: 19 - [1666777671.689226][150216:150221] CHIP:TOO: Revision: 1 - [1666777671.689249][150216:150221] CHIP:TOO: } + [1692171194.333493][8093:8095] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 429507522 + [1692171194.333569][8093:8095] CHIP:TOO: DeviceTypeList: 2 entries + [1692171194.333616][8093:8095] CHIP:TOO: [1]: { + [1692171194.333642][8093:8095] CHIP:TOO: DeviceType: 256 + [1692171194.333665][8093:8095] CHIP:TOO: Revision: 1 + [1692171194.333688][8093:8095] CHIP:TOO: } + [1692171194.333715][8093:8095] CHIP:TOO: [2]: { + [1692171194.333738][8093:8095] CHIP:TOO: DeviceType: 19 + [1692171194.333760][8093:8095] CHIP:TOO: Revision: 1 + [1692171194.333782][8093:8095] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 12 + + ./chip-tool descriptor read device-type-list 1 12 Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 12. - [1666777714.615379][150259:150264] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 312494071 - [1666777714.615443][150259:150264] CHIP:TOO: DeviceTypeList: 2 entries - [1666777714.615483][150259:150264] CHIP:TOO: [1]: { - [1666777714.615503][150259:150264] CHIP:TOO: Type: 256 - [1666777714.615527][150259:150264] CHIP:TOO: Revision: 1 - [1666777714.615545][150259:150264] CHIP:TOO: } - [1666777714.615570][150259:150264] CHIP:TOO: [2]: { - [1666777714.615588][150259:150264] CHIP:TOO: Type: 19 - [1666777714.615606][150259:150264] CHIP:TOO: Revision: 1 - [1666777714.615622][150259:150264] CHIP:TOO: } - - - ./chip-tool descriptor read device-type-list 1 13 - - Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 13. - - [1666777780.917239][150295:150300] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2475792486 - [1666777780.917356][150295:150300] CHIP:TOO: DeviceTypeList: 2 entries - [1666777780.917400][150295:150300] CHIP:TOO: [1]: { - [1666777780.917428][150295:150300] CHIP:TOO: Type: 256 - [1666777780.917455][150295:150300] CHIP:TOO: Revision: 1 - [1666777780.917480][150295:150300] CHIP:TOO: } - [1666777780.917513][150295:150300] CHIP:TOO: [2]: { - [1666777780.917538][150295:150300] CHIP:TOO: Type: 19 - [1666777780.917563][150295:150300] CHIP:TOO: Revision: 1 - [1666777780.917585][150295:150300] CHIP:TOO: } + [1692171218.674782][8096:8098] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2573884958 + [1692171218.674856][8096:8098] CHIP:TOO: DeviceTypeList: 2 entries + [1692171218.674901][8096:8098] CHIP:TOO: [1]: { + [1692171218.674925][8096:8098] CHIP:TOO: DeviceType: 256 + [1692171218.674946][8096:8098] CHIP:TOO: Revision: 1 + [1692171218.674967][8096:8098] CHIP:TOO: } + [1692171218.674992][8096:8098] CHIP:TOO: [2]: { + [1692171218.675013][8096:8098] CHIP:TOO: DeviceType: 19 + [1692171218.675032][8096:8098] CHIP:TOO: Revision: 1 + [1692171218.675052][8096:8098] CHIP:TOO: } disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_BR_2.yaml b/src/app/tests/suites/certification/Test_TC_BR_2.yaml old mode 100644 new mode 100755 index 5dbf11eb592b99..6be70efe9e6446 --- a/src/app/tests/suites/certification/Test_TC_BR_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_BR_2.yaml @@ -46,7 +46,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 0. [1657004688.484502][4828:4833] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3573910940 - [1657004688.484597][4828:4833] CHIP:TOO: parts list: 12 entries + [1657004688.484597][4828:4833] CHIP:TOO: PartsList: 11 entries [1657004688.484633][4828:4833] CHIP:TOO: [1]: 1 [1657004688.484662][4828:4833] CHIP:TOO: [2]: 3 [1657004688.484690][4828:4833] CHIP:TOO: [3]: 4 @@ -58,25 +58,23 @@ tests: [1657004688.484859][4828:4833] CHIP:TOO: [9]: 10 [1657004688.484888][4828:4833] CHIP:TOO: [10]: 11 [1657004688.484916][4828:4833] CHIP:TOO: [11]: 12 - [1657004688.484944][4828:4833] CHIP:TOO: [12]: 13 ./chip-tool descriptor read parts-list 1 1 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 1. - [1657013897.304642][5792:5797] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1583672815 - [1657013897.304741][5792:5797] CHIP:TOO: parts list: 11 entries - [1657013897.304778][5792:5797] CHIP:TOO: [1]: 3 - [1657013897.304809][5792:5797] CHIP:TOO: [2]: 4 - [1657013897.304840][5792:5797] CHIP:TOO: [3]: 5 - [1657013897.304870][5792:5797] CHIP:TOO: [4]: 6 - [1657013897.304900][5792:5797] CHIP:TOO: [5]: 7 - [1657013897.304930][5792:5797] CHIP:TOO: [6]: 8 - [1657013897.304960][5792:5797] CHIP:TOO: [7]: 9 - [1657013897.304990][5792:5797] CHIP:TOO: [8]: 10 - [1657013897.305020][5792:5797] CHIP:TOO: [9]: 11 - [1657013897.305051][5792:5797] CHIP:TOO: [10]: 12 - [1657013897.305081][5792:5797] CHIP:TOO: [11]: 13 + [1692175283.188032][8237:8239] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 719095557 + [1692175283.188123][8237:8239] CHIP:TOO: PartsList: 10 entries + [1692175283.188205][8237:8239] CHIP:TOO: [1]: 3 + [1692175283.188239][8237:8239] CHIP:TOO: [2]: 4 + [1692175283.188272][8237:8239] CHIP:TOO: [3]: 5 + [1692175283.188303][8237:8239] CHIP:TOO: [4]: 6 + [1692175283.188333][8237:8239] CHIP:TOO: [5]: 7 + [1692175283.188364][8237:8239] CHIP:TOO: [6]: 8 + [1692175283.188395][8237:8239] CHIP:TOO: [7]: 9 + [1692175283.188426][8237:8239] CHIP:TOO: [8]: 10 + [1692175283.188457][8237:8239] CHIP:TOO: [9]: 11 + [1692175283.188488][8237:8239] CHIP:TOO: [10]: 12 ./chip-tool descriptor read parts-list 1 3 @@ -84,7 +82,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 3. [1657013905.333904][5805:5810] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 4168180 - [1657013905.333984][5805:5810] CHIP:TOO: parts list: 0 entries + [1657013905.333984][5805:5810] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 4 @@ -92,7 +90,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 4. [1657014011.276060][5822:5827] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2935336058 - [1657014011.276141][5822:5827] CHIP:TOO: parts list: 0 entries + [1657014011.276141][5822:5827] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 5 @@ -100,24 +98,24 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 5. [1657014034.298958][5829:5834] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3372622835 - [1657014034.299041][5829:5834] CHIP:TOO: parts list: 0 entries + [1657014034.299041][5829:5834] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 6 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 6. [1657014056.893995][5847:5852] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1565587733 - [1657014056.894072][5847:5852] CHIP:TOO: parts list: 3 entries + [1657014056.894072][5847:5852] CHIP:TOO: PartsList: 2 entries [1657014056.894104][5847:5852] CHIP:TOO: [1]: 7 [1657014056.894130][5847:5852] CHIP:TOO: [2]: 8 - [1657014056.894154][5847:5852] CHIP:TOO: [3]: 9 + ./chip-tool descriptor read parts-list 1 7 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 7. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 8 @@ -159,14 +157,6 @@ tests: [1663236715.610328][5579:5584] CHIP:TOO: PartsList: 0 entries - ./chip-tool descriptor read parts-list 1 13 - - Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 13. - - [1663236752.985450][5590:5595] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 4223376445 - [1663236752.985512][5590:5595] CHIP:TOO: PartsList: 0 entries - - ./chip-tool descriptor read device-type-list 1 0 @@ -175,7 +165,7 @@ tests: 1666250976.171198][46974:46979] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4030820095 [1666250976.171293][46974:46979] CHIP:TOO: DeviceTypeList: 1 entries [1666250976.171371][46974:46979] CHIP:TOO: [1]: { - [1666250976.171419][46974:46979] CHIP:TOO: Type: 22 + [1666250976.171419][46974:46979] CHIP:TOO: DeviceType: 22 [1666250976.171446][46974:46979] CHIP:TOO: Revision: 1 [1666250976.171472][46974:46979] CHIP:TOO: } @@ -183,135 +173,169 @@ tests: ./chip-tool descriptor read device-type-list 1 1 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 1. - - [1666251027.402704][46981:46986] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 - [1666251027.402805][46981:46986] CHIP:TOO: DeviceTypeList: 1 entries - [1666251027.402870][46981:46986] CHIP:TOO: [1]: { - [1666251027.402919][46981:46986] CHIP:TOO: Type: 14 - [1666251027.402948][46981:46986] CHIP:TOO: Revision: 1 - [1666251027.402974][46981:46986] CHIP:TOO: } + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 1. + 1666244345.296680][44990:44995] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 + [1666244345.296742][44990:44995] CHIP:TOO: DeviceTypeList: 1 entries + [1666244345.296800][44990:44995] CHIP:TOO: [1]: { + [1666244345.296846][44990:44995] CHIP:TOO: DeviceType: 14 + [1666244345.296874][44990:44995] CHIP:TOO: Revision: 1 + [1666244345.296904][44990:44995] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 3 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 3. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 3. + + [1666244839.544979][45200:45205] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1513076890 + [1666244839.545006][45200:45205] CHIP:TOO: DeviceTypeList: 2 entries + [1666244839.545019][45200:45205] CHIP:TOO: [1]: { + [1666244839.545027][45200:45205] CHIP:TOO: DeviceType: 256 + [1666244839.545035][45200:45205] CHIP:TOO: Revision: 1 + [1666244839.545042][45200:45205] CHIP:TOO: } + [1666244839.545051][45200:45205] CHIP:TOO: [2]: { + [1666244839.545058][45200:45205] CHIP:TOO: DeviceType: 19 + [1666244839.545066][45200:45205] CHIP:TOO: Revision: 1 + [1666244839.545073][45200:45205] CHIP:TOO: } + - [1666251082251388][46996:47001] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1513076890 - [1666251082.251476][46996:47001] CHIP:TOO: DeviceTypeList: 2 entries - [1666251082.251548][46996:47001] CHIP:TOO: [1]: { - [1666251082.251593][46996:47001] CHIP:TOO: Type: 256 - [1666251082.251622][46996:47001] CHIP:TOO: Revision: 1 - [1666251082.251650][46996:47001] CHIP:TOO: } - [1666251082.251691][46996:47001] CHIP:TOO: [2]: { - [1666251082.251717][46996:47001] CHIP:TOO: Type: 19 - [1666251082.251747][46996:47001] CHIP:TOO: Revision: 1 - [1666251082.251773][46996:47001] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 4 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 4. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 4. + + [1666244925.833459][45215:45220] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 + [1666244925.833553][45215:45220] CHIP:TOO: DeviceTypeList: 2 entries + [1666244925.833599][45215:45220] CHIP:TOO: [1]: { + [1666244925.833627][45215:45220] CHIP:TOO: DeviceType: 770 + [1666244925.833658][45215:45220] CHIP:TOO: Revision: 1 + [1666244925.833686][45215:45220] CHIP:TOO: } + [1666244925.833726][45215:45220] CHIP:TOO: [2]: { + [1666244925.833752][45215:45220] CHIP:TOO: DeviceType: 19 + [1666244925.833781][45215:45220] CHIP:TOO: Revision: 1 + [1666244925.833809][45215:45220] CHIP:TOO: } - [1666251158.590005][47007:47012] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 - [1666251158.590120][47007:47012] CHIP:TOO: DeviceTypeList: 2 entries - [1666251158.590188][47007:47012] CHIP:TOO: [1]: { - [1666251158.590234][47007:47012] CHIP:TOO: Type: 770 - [1666251158.590262][47007:47012] CHIP:TOO: Revision: 1 - [1666251158.590289][47007:47012] CHIP:TOO: } - [1666251158.590329][47007:47012] CHIP:TOO: [2]: { - [1666251158.590353][47007:47012] CHIP:TOO: Type: 19 - [1666251158.590381][47007:47012] CHIP:TOO: Revision: 1 - [1666251158.590407][47007:47012] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 5 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 5. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 5. + + [1692170726.055153][8028:8031] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1085687870 + [1692170726.055261][8028:8031] CHIP:TOO: DeviceTypeList: 2 entries + [1692170726.055331][8028:8031] CHIP:TOO: [1]: { + [1692170726.055370][8028:8031] CHIP:TOO: DeviceType: 770 + [1692170726.055407][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055441][8028:8031] CHIP:TOO: } + [1692170726.055484][8028:8031] CHIP:TOO: [2]: { + [1692170726.055520][8028:8031] CHIP:TOO: DeviceType: 19 + [1692170726.055553][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055591][8028:8031] CHIP:TOO: } + + - [1666251201.503157][47017:47022] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1760060075 - [1666251201.503273][47017:47022] CHIP:TOO: DeviceTypeList: 2 entries - [1666251201.503331][47017:47022] CHIP:TOO: [1]: { - [1666251201.503365][47017:47022] CHIP:TOO: Type: 770 - [1666251201.503400][47017:47022] CHIP:TOO: Revision: 1 - [1666251201.503434][47017:47022] CHIP:TOO: } - [1666251201.503482][47017:47022] CHIP:TOO: [2]: { - [1666251201.503514][47017:47022] CHIP:TOO: Type: 19 - [1666251201.503543][47017:47022] CHIP:TOO: Revision: 1 - [1666251201.503568][47017:47022] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 6 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 6. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 6. - [1666251387.430964][47094:47099] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3539120641 - [1666251387.431026][47094:47099] CHIP:TOO: DeviceTypeList: 1 entries - [1666251387.431080][47094:47099] CHIP:TOO: [1]: { - [1666251387.431121][47094:47099] CHIP:TOO: Type: 19 - [1666251387.431162][47094:47099] CHIP:TOO: Revision: 1 - [1666251387.431201][47094:47099] CHIP:TOO: } + [1692170742.458148][8033:8035] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2945297824 + [1692170742.458231][8033:8035] CHIP:TOO: DeviceTypeList: 2 entries + [1692170742.458282][8033:8035] CHIP:TOO: [1]: { + [1692170742.458310][8033:8035] CHIP:TOO: DeviceType: 19 + [1692170742.458348][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458372][8033:8035] CHIP:TOO: } + [1692170742.458412][8033:8035] CHIP:TOO: [2]: { + [1692170742.458437][8033:8035] CHIP:TOO: DeviceType: 17 + [1692170742.458461][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458526][8033:8035] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 10 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 10. + ./chip-tool descriptor read device-type-list 1 7 - [1666251412.907038][47102:47107] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 - [1666251412.907165][47102:47107] CHIP:TOO: DeviceTypeList: 2 entries - [1666251412.907216][47102:47107] CHIP:TOO: [1]: { - [1666251412.907245][47102:47107] CHIP:TOO: Type: 256 - [1666251412.907274][47102:47107] CHIP:TOO: Revision: 1 - [1666251412.907300][47102:47107] CHIP:TOO: } - [1666251412.907336][47102:47107] CHIP:TOO: [2]: { - [1666251412.907366][47102:47107] CHIP:TOO: Type: 19 - [1666251412.907394][47102:47107] CHIP:TOO: Revision: 1 - [1666251412.907412][47102:47107] CHIP:TOO: } + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 7. + [1666246718.470591][45821:45826] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3285189124 + [1666246718.470649][45821:45826] CHIP:TOO: DeviceTypeList: 1 entries + [1666246718.470678][45821:45826] CHIP:TOO: [1]: { + [1666246718.470697][45821:45826] CHIP:TOO: DeviceType: 770 + [1666246718.470715][45821:45826] CHIP:TOO: Revision: 1 + [1666246718.470733][45821:45826] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 11 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 11. + ./chip-tool descriptor read device-type-list 1 8 - [1666252002.412264][47368:47373] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 - [1666252002.412358][47368:47373] CHIP:TOO: DeviceTypeList: 2 entries - [1666252002.412418][47368:47373] CHIP:TOO: [1]: { - [1666252002.412465][47368:47373] CHIP:TOO: Type: 256 - [1666252002.412491][47368:47373] CHIP:TOO: Revision: 1 - [1666252002.412515][47368:47373] CHIP:TOO: } - [1666252002.412548][47368:47373] CHIP:TOO: [2]: { - [1666252002.412572][47368:47373] CHIP:TOO: Type: 19 - [1666252002.412596][47368:47373] CHIP:TOO: Revision: 1 - [1666252002.412618][47368:47373] CHIP:TOO: } + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 8. + [1666246775.067195][45834:45839] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3210151050 + [1666246775.067256][45834:45839] CHIP:TOO: DeviceTypeList: 1 entries + [1666246775.067297][45834:45839] CHIP:TOO: [1]: { + [1666246775.067324][45834:45839] CHIP:TOO: DeviceType: 770 + [1666246775.067350][45834:45839] CHIP:TOO: Revision: 1 + [1666246775.067375][45834:45839] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 12 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 12. + ./chip-tool descriptor read device-type-list 1 9 - [1666252081.956121][47409:47414] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 - [1666252081.956186][47409:47414] CHIP:TOO: DeviceTypeList: 2 entries - [1666252081.956224][47409:47414] CHIP:TOO: [1]: { - [1666252081.956249][47409:47414] CHIP:TOO: Type: 256 - [1666252081.956272][47409:47414] CHIP:TOO: Revision: 1 - [1666252081.956295][47409:47414] CHIP:TOO: } - [1666252081.956325][47409:47414] CHIP:TOO: [2]: { - [1666252081.956354][47409:47414] CHIP:TOO: Type: 19 - [1666252081.956376][47409:47414] CHIP:TOO: Revision: 1 - [1666252081.956397][47409:47414] CHIP:TOO: } + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 9. + [1692170786.513524][8042:8044] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 133253296 + [1692170786.513603][8042:8044] CHIP:TOO: DeviceTypeList: 2 entries + [1692170786.513654][8042:8044] CHIP:TOO: [1]: { + [1692170786.513681][8042:8044] CHIP:TOO: DeviceType: 256 + [1692170786.513706][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513730][8042:8044] CHIP:TOO: } + [1692170786.513759][8042:8044] CHIP:TOO: [2]: { + [1692170786.513785][8042:8044] CHIP:TOO: DeviceType: 19 + [1692170786.513809][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513833][8042:8044] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 13 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 12. - 1666252148.366524][47441:47446] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1009438523 - [1666252148.366610][47441:47446] CHIP:TOO: DeviceTypeList: 2 entries - [1666252148.366694][47441:47446] CHIP:TOO: [1]: { - [1666252148.366746][47441:47446] CHIP:TOO: Type: 256 - [1666252148.366774][47441:47446] CHIP:TOO: Revision: 1 - [1666252148.366798][47441:47446] CHIP:TOO: } - [1666252148.366837][47441:47446] CHIP:TOO: [2]: { - [1666252148.366865][47441:47446] CHIP:TOO: Type: 19 - [1666252148.366894][47441:47446] CHIP:TOO: Revision: 1 - [1666252148.366931][47441:47446] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 10 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 10. + + [1666246866.935280][45904:45909] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 + [1666246866.935412][45904:45909] CHIP:TOO: DeviceTypeList: 2 entries + [1666246866.935484][45904:45909] CHIP:TOO: [1]: { + [1666246866.935538][45904:45909] CHIP:TOO: DeviceType: 256 + [1666246866.935564][45904:45909] CHIP:TOO: Revision: 1 + [1666246866.935587][45904:45909] CHIP:TOO: } + [1666246866.935620][45904:45909] CHIP:TOO: [2]: { + [1666246866.935644][45904:45909] CHIP:TOO: DeviceType: 19 + [1666246866.935668][45904:45909] CHIP:TOO: Revision: 1 + [1666246866.935691][45904:45909] CHIP:TOO: } + + ./chip-tool descriptor read device-type-list 1 11 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 11. + + [1666246922.797443][45920:45925] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 + [1666246922.797466][45920:45925] CHIP:TOO: DeviceTypeList: 2 entries + [1666246922.797484][45920:45925] CHIP:TOO: [1]: { + [1666246922.797497][45920:45925] CHIP:TOO: DeviceType: 256 + [1666246922.797504][45920:45925] CHIP:TOO: Revision: 1 + [1666246922.797512][45920:45925] CHIP:TOO: } + [1666246922.797521][45920:45925] CHIP:TOO: [2]: { + [1666246922.797527][45920:45925] CHIP:TOO: DeviceType: 19 + [1666246922.797533][45920:45925] CHIP:TOO: Revision: 1 + [1666246922.797539][45920:45925] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 12 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 12. + + [1666246970.442284][45932:45937] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 + [1666246970.442340][45932:45937] CHIP:TOO: DeviceTypeList: 2 entries + [1666246970.442386][45932:45937] CHIP:TOO: [1]: { + [1666246970.442414][45932:45937] CHIP:TOO: DeviceType: 256 + [1666246970.442446][45932:45937] CHIP:TOO: Revision: 1 + [1666246970.442474][45932:45937] CHIP:TOO: } + [1666246970.442513][45932:45937] CHIP:TOO: [2]: { + [1666246970.442541][45932:45937] CHIP:TOO: DeviceType: 19 + [1666246970.442570][45932:45937] CHIP:TOO: Revision: 1 + [1666246970.442597][45932:45937] CHIP:TOO: } disabled: true - label: @@ -329,7 +353,7 @@ tests: [1666252195.610169][47476:47481] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 [1666252195.610228][47476:47481] CHIP:TOO: DeviceTypeList: 1 entries [1666252195.610264][47476:47481] CHIP:TOO: [1]: { - [1666252195.610286][47476:47481] CHIP:TOO: Type: 14 + [1666252195.610286][47476:47481] CHIP:TOO: DeviceType: 14 [1666252195.610306][47476:47481] CHIP:TOO: Revision: 1 [1666252195.610325][47476:47481] CHIP:TOO: } @@ -341,11 +365,11 @@ tests: [1666252254.182552][47485:47490] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1513076890 [1666252254.182649][47485:47490] CHIP:TOO: DeviceTypeList: 2 entries [1666252254.182709][47485:47490] CHIP:TOO: [1]: { - [1666252254.182751][47485:47490] CHIP:TOO: Type: 256 + [1666252254.182751][47485:47490] CHIP:TOO: DeviceType: 256 [1666252254.182774][47485:47490] CHIP:TOO: Revision: 1 [1666252254.182795][47485:47490] CHIP:TOO: } [1666252254.182827][47485:47490] CHIP:TOO: [2]: { - [1666252254.182847][47485:47490] CHIP:TOO: Type: 19 + [1666252254.182847][47485:47490] CHIP:TOO: DeviceType: 19 [1666252254.182868][47485:47490] CHIP:TOO: Revision: 1 [1666252254.182888][47485:47490] CHIP:TOO: } @@ -358,11 +382,11 @@ tests: [1666252341.032161][47529:47534] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 [1666252341.032246][47529:47534] CHIP:TOO: DeviceTypeList: 2 entries [1666252341.032289][47529:47534] CHIP:TOO: [1]: { - [1666252341.032337][47529:47534] CHIP:TOO: Type: 770 + [1666252341.032337][47529:47534] CHIP:TOO: DeviceType: 770 [1666252341.032364][47529:47534] CHIP:TOO: Revision: 1 [1666252341.032390][47529:47534] CHIP:TOO: } [1666252341.032422][47529:47534] CHIP:TOO: [2]: { - [1666252341.032447][47529:47534] CHIP:TOO: Type: 19 + [1666252341.032447][47529:47534] CHIP:TOO: DeviceType: 19 [1666252341.032471][47529:47534] CHIP:TOO: Revision: 1 [1666252341.032494][47529:47534] CHIP:TOO: } @@ -374,11 +398,11 @@ tests: [1666252401.412287][47601:47606] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1760060075 [1666252401.412377][47601:47606] CHIP:TOO: DeviceTypeList: 2 entries [1666252401.412421][47601:47606] CHIP:TOO: [1]: { - [1666252401.412476][47601:47606] CHIP:TOO: Type: 770 + [1666252401.412476][47601:47606] CHIP:TOO: DeviceType: 770 [1666252401.412506][47601:47606] CHIP:TOO: Revision: 1 [1666252401.412534][47601:47606] CHIP:TOO: } [1666252401.412569][47601:47606] CHIP:TOO: [2]: { - [1666252401.412593][47601:47606] CHIP:TOO: Type: 19 + [1666252401.412593][47601:47606] CHIP:TOO: DeviceType: 19 [1666252401.412618][47601:47606] CHIP:TOO: Revision: 1 [1666252401.412642][47601:47606] CHIP:TOO: } @@ -388,11 +412,16 @@ tests: Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 6. [1666252476.292638][47801:47806] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3539120641 - [1666252476.292713][47801:47806] CHIP:TOO: DeviceTypeList: 1 entries - [1666252476.292813][47801:47806] CHIP:TOO: [1]: { - [1666252476.292849][47801:47806] CHIP:TOO: Type: 19 - [1666252476.292922][47801:47806] CHIP:TOO: Revision: 1 - [1666252476.292974][47801:47806] CHIP:TOO: } + [1692175703.932439][8274:8276] CHIP:TOO: DeviceTypeList: 2 entries + [1692175703.932485][8274:8276] CHIP:TOO: [1]: { + [1692175703.932511][8274:8276] CHIP:TOO: DeviceType: 19 + [1692175703.932546][8274:8276] CHIP:TOO: Revision: 1 + [1692175703.932569][8274:8276] CHIP:TOO: } + [1692175703.932607][8274:8276] CHIP:TOO: [2]: { + [1692175703.932631][8274:8276] CHIP:TOO: DeviceType: 17 + [1692175703.932654][8274:8276] CHIP:TOO: Revision: 1 + [1692175703.932710][8274:8276] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 7 @@ -402,7 +431,7 @@ tests: [1666252509.843031][47813:47818] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3285189124 [1666252509.843104][47813:47818] CHIP:TOO: DeviceTypeList: 1 entries [1666252509.843152][47813:47818] CHIP:TOO: [1]: { - [1666252509.843185][47813:47818] CHIP:TOO: Type: 770 + [1666252509.843185][47813:47818] CHIP:TOO: DeviceType: 770 [1666252509.843211][47813:47818] CHIP:TOO: Revision: 1 [1666252509.843234][47813:47818] CHIP:TOO: } @@ -415,7 +444,7 @@ tests: [1666252562.087283][47822:47827] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3210151050 [1666252562.087347][47822:47827] CHIP:TOO: DeviceTypeList: 1 entries [1666252562.087399][47822:47827] CHIP:TOO: [1]: { - [1666252562.087458][47822:47827] CHIP:TOO: Type: 770 + [1666252562.087458][47822:47827] CHIP:TOO: DeviceType: 770 [1666252562.087492][47822:47827] CHIP:TOO: Revision: 1 [1666252562.087526][47822:47827] CHIP:TOO: } @@ -424,12 +453,17 @@ tests: Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 9. - [1666252723.595161][47851:47856] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3716023031 - [1666252723.595284][47851:47856] CHIP:TOO: DeviceTypeList: 1 entries - [1666252723.595371][47851:47856] CHIP:TOO: [1]: { - [1666252723.595449][47851:47856] CHIP:TOO: Type: 17 - [1666252723.595484][47851:47856] CHIP:TOO: Revision: 1 - [1666252723.595514][47851:47856] CHIP:TOO: } + [1692175663.768694][8264:8266] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1109780920 + [1692175663.768764][8264:8266] CHIP:TOO: DeviceTypeList: 2 entries + [1692175663.768808][8264:8266] CHIP:TOO: [1]: { + [1692175663.768832][8264:8266] CHIP:TOO: DeviceType: 256 + [1692175663.768854][8264:8266] CHIP:TOO: Revision: 1 + [1692175663.768874][8264:8266] CHIP:TOO: } + [1692175663.768899][8264:8266] CHIP:TOO: [2]: { + [1692175663.768921][8264:8266] CHIP:TOO: DeviceType: 19 + [1692175663.768941][8264:8266] CHIP:TOO: Revision: 1 + [1692175663.768961][8264:8266] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 10 @@ -439,11 +473,11 @@ tests: [1666252816.237844][47882:47887] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 [1666252816.237980][47882:47887] CHIP:TOO: DeviceTypeList: 2 entries [1666252816.238043][47882:47887] CHIP:TOO: [1]: { - [1666252816.238090][47882:47887] CHIP:TOO: Type: 256 + [1666252816.238090][47882:47887] CHIP:TOO: DeviceType: 256 [1666252816.238117][47882:47887] CHIP:TOO: Revision: 1 [1666252816.238143][47882:47887] CHIP:TOO: } [1666252816.238178][47882:47887] CHIP:TOO: [2]: { - [1666252816.238206][47882:47887] CHIP:TOO: Type: 19 + [1666252816.238206][47882:47887] CHIP:TOO: DeviceType: 19 [1666252816.238233][47882:47887] CHIP:TOO: Revision: 1 [1666252816.238256][47882:47887] CHIP:TOO: } @@ -456,11 +490,11 @@ tests: [1666252858.431544][47894:47899] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 [1666252858.431646][47894:47899] CHIP:TOO: DeviceTypeList: 2 entries [1666252858.431688][47894:47899] CHIP:TOO: [1]: { - [1666252858.431712][47894:47899] CHIP:TOO: Type: 256 + [1666252858.431712][47894:47899] CHIP:TOO: DeviceType: 256 [1666252858.431736][47894:47899] CHIP:TOO: Revision: 1 [1666252858.431758][47894:47899] CHIP:TOO: } [1666252858.431788][47894:47899] CHIP:TOO: [2]: { - [1666252858.431811][47894:47899] CHIP:TOO: Type: 19 + [1666252858.431811][47894:47899] CHIP:TOO: DeviceType: 19 [1666252858.431832][47894:47899] CHIP:TOO: Revision: 1 [1666252858.431851][47894:47899] CHIP:TOO: } @@ -472,30 +506,13 @@ tests: [1666253053.966809][47936:47941] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 [1666253053.966877][47936:47941] CHIP:TOO: DeviceTypeList: 2 entries [1666253053.966916][47936:47941] CHIP:TOO: [1]: { - [1666253053.966947][47936:47941] CHIP:TOO: Type: 256 + [1666253053.966947][47936:47941] CHIP:TOO: DeviceType: 256 [1666253053.966964][47936:47941] CHIP:TOO: Revision: 1 [1666253053.966981][47936:47941] CHIP:TOO: } [1666253053.967001][47936:47941] CHIP:TOO: [2]: { - [1666253053.967016][47936:47941] CHIP:TOO: Type: 19 + [1666253053.967016][47936:47941] CHIP:TOO: DeviceType: 19 [1666253053.967031][47936:47941] CHIP:TOO: Revision: 1 [1666253053.967046][47936:47941] CHIP:TOO: } - - - - ./chip-tool descriptor read device-type-list 1 13 - - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 13. - - [1666253095.919526][47946:47951] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1009438523 - [1666253095.919637][47946:47951] CHIP:TOO: DeviceTypeList: 2 entries - [1666253095.919720][47946:47951] CHIP:TOO: [1]: { - [1666253095.919747][47946:47951] CHIP:TOO: Type: 256 - [1666253095.919771][47946:47951] CHIP:TOO: Revision: 1 - [1666253095.919793][47946:47951] CHIP:TOO: } - [1666253095.919825][47946:47951] CHIP:TOO: [2]: { - [1666253095.919849][47946:47951] CHIP:TOO: Type: 19 - [1666253095.919872][47946:47951] CHIP:TOO: Revision: 1 - [1666253095.919894][47946:47951] CHIP:TOO: } disabled: true - label: @@ -518,7 +535,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 0. [1657004820.589511][4847:4853] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3573910941 - [1657004820.589607][4847:4853] CHIP:TOO: parts list: 13 entries + [1657004820.589607][4847:4853] CHIP:TOO: PartsList: 12 entries [1657004820.589641][4847:4853] CHIP:TOO: [1]: 1 [1657004820.589667][4847:4853] CHIP:TOO: [2]: 3 [1657004820.589692][4847:4853] CHIP:TOO: [3]: 4 @@ -531,7 +548,6 @@ tests: [1657004820.589863][4847:4853] CHIP:TOO: [10]: 11 [1657004820.589888][4847:4853] CHIP:TOO: [11]: 12 [1657004820.589912][4847:4853] CHIP:TOO: [12]: 13 - [1657004820.589937][4847:4853] CHIP:TOO: [13]: 14 @@ -542,7 +558,7 @@ tests: [1666258982.251127][49133:49138] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4030820095 [1666258982.251208][49133:49138] CHIP:TOO: DeviceTypeList: 1 entries [1666258982.251261][49133:49138] CHIP:TOO: [1]: { - [1666258982.251300][49133:49138] CHIP:TOO: Type: 22 + [1666258982.251300][49133:49138] CHIP:TOO: DeviceType: 22 [1666258982.251325][49133:49138] CHIP:TOO: Revision: 1 [1666258982.251347][49133:49138] CHIP:TOO: } disabled: true @@ -558,26 +574,25 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 1. [1657004854.903425][4855:4860] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3021853415 - [1657004854.903514][4855:4860] CHIP:TOO: parts list: 12 entries - [1657004854.903545][4855:4860] CHIP:TOO: [1]: 3 - [1657004854.903570][4855:4860] CHIP:TOO: [2]: 4 - [1657004854.903595][4855:4860] CHIP:TOO: [3]: 5 - [1657004854.903620][4855:4860] CHIP:TOO: [4]: 6 - [1657004854.903645][4855:4860] CHIP:TOO: [5]: 7 - [1657004854.903669][4855:4860] CHIP:TOO: [6]: 8 - [1657004854.903694][4855:4860] CHIP:TOO: [7]: 9 - [1657004854.903719][4855:4860] CHIP:TOO: [8]: 10 - [1657004854.903743][4855:4860] CHIP:TOO: [9]: 11 - [1657004854.903768][4855:4860] CHIP:TOO: [10]: 12 - [1657004854.903793][4855:4860] CHIP:TOO: [11]: 13 - [1657004854.903818][4855:4860] CHIP:TOO: [12]: 14 + [1692175784.628807][8283:8285] CHIP:TOO: PartsList: 11 entries + [1692175784.628858][8283:8285] CHIP:TOO: [1]: 3 + [1692175784.628890][8283:8285] CHIP:TOO: [2]: 4 + [1692175784.628934][8283:8285] CHIP:TOO: [3]: 5 + [1692175784.628963][8283:8285] CHIP:TOO: [4]: 6 + [1692175784.629003][8283:8285] CHIP:TOO: [5]: 7 + [1692175784.629086][8283:8285] CHIP:TOO: [6]: 8 + [1692175784.629149][8283:8285] CHIP:TOO: [7]: 9 + [1692175784.629221][8283:8285] CHIP:TOO: [8]: 10 + [1692175784.629267][8283:8285] CHIP:TOO: [9]: 11 + [1692175784.629342][8283:8285] CHIP:TOO: [10]: 12 + [1692175784.629405][8283:8285] CHIP:TOO: [11]: 13 + ./chip-tool descriptor read device-type-list 1 1 Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 1. - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 0. [1685005209.364316][4224:4226] CHIP:TOO: DeviceTypeList: 1 entries [1685005209.364397][4224:4226] CHIP:TOO: [1]: { [1685005209.364455][4224:4226] CHIP:TOO: DeviceType: 14 @@ -597,20 +612,20 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 0. [1657014360.649059][5991:5997] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2526005575 - [1657014360.649148][5991:5997] CHIP:TOO: parts list: 13 entries - [1657014360.649179][5991:5997] CHIP:TOO: [1]: 1 - [1657014360.649204][5991:5997] CHIP:TOO: [2]: 3 - [1657014360.649229][5991:5997] CHIP:TOO: [3]: 4 - [1657014360.649253][5991:5997] CHIP:TOO: [4]: 5 - [1657014360.649277][5991:5997] CHIP:TOO: [5]: 6 - [1657014360.649301][5991:5997] CHIP:TOO: [6]: 7 - [1657014360.649325][5991:5997] CHIP:TOO: [7]: 8 - [1657014360.649350][5991:5997] CHIP:TOO: [8]: 9 - [1657014360.649375][5991:5997] CHIP:TOO: [9]: 10 - [1657014360.649399][5991:5997] CHIP:TOO: [10]: 11 - [1657014360.649424][5991:5997] CHIP:TOO: [11]: 12 - [1657014360.649448][5991:5997] CHIP:TOO: [12]: 13 - [1657014360.649472][5991:5997] CHIP:TOO: [13]: 14 + [1692175824.548102][8292:8294] CHIP:TOO: PartsList: 12 entries + [1692175824.548185][8292:8294] CHIP:TOO: [1]: 1 + [1692175824.548220][8292:8294] CHIP:TOO: [2]: 3 + [1692175824.548253][8292:8294] CHIP:TOO: [3]: 4 + [1692175824.548284][8292:8294] CHIP:TOO: [4]: 5 + [1692175824.548315][8292:8294] CHIP:TOO: [5]: 6 + [1692175824.548346][8292:8294] CHIP:TOO: [6]: 7 + [1692175824.548377][8292:8294] CHIP:TOO: [7]: 8 + [1692175824.548408][8292:8294] CHIP:TOO: [8]: 9 + [1692175824.548439][8292:8294] CHIP:TOO: [9]: 10 + [1692175824.548471][8292:8294] CHIP:TOO: [10]: 11 + [1692175824.548501][8292:8294] CHIP:TOO: [11]: 12 + [1692175824.548532][8292:8294] CHIP:TOO: [12]: 13 + ./chip-tool descriptor read parts-list 1 1 @@ -618,19 +633,18 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 1. [1657014489.152608][6029:6034] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1583672816 - [1657014489.152708][6029:6034] CHIP:TOO: parts list: 12 entries - [1657014489.152745][6029:6034] CHIP:TOO: [1]: 3 - [1657014489.152776][6029:6034] CHIP:TOO: [2]: 4 - [1657014489.152807][6029:6034] CHIP:TOO: [3]: 5 - [1657014489.152838][6029:6034] CHIP:TOO: [4]: 6 - [1657014489.152868][6029:6034] CHIP:TOO: [5]: 7 - [1657014489.152899][6029:6034] CHIP:TOO: [6]: 8 - [1657014489.152930][6029:6034] CHIP:TOO: [7]: 9 - [1657014489.152960][6029:6034] CHIP:TOO: [8]: 10 - [1657014489.152991][6029:6034] CHIP:TOO: [9]: 11 - [1657014489.153022][6029:6034] CHIP:TOO: [10]: 12 - [1657014489.153052][6029:6034] CHIP:TOO: [11]: 13 - [1657014489.153083][6029:6034] CHIP:TOO: [12]: 14 + [1692175836.558306][8295:8297] CHIP:TOO: PartsList: 11 entries + [1692175836.558351][8295:8297] CHIP:TOO: [1]: 3 + [1692175836.558379][8295:8297] CHIP:TOO: [2]: 4 + [1692175836.558407][8295:8297] CHIP:TOO: [3]: 5 + [1692175836.558433][8295:8297] CHIP:TOO: [4]: 6 + [1692175836.558460][8295:8297] CHIP:TOO: [5]: 7 + [1692175836.558486][8295:8297] CHIP:TOO: [6]: 8 + [1692175836.558512][8295:8297] CHIP:TOO: [7]: 9 + [1692175836.558539][8295:8297] CHIP:TOO: [8]: 10 + [1692175836.558565][8295:8297] CHIP:TOO: [9]: 11 + [1692175836.558592][8295:8297] CHIP:TOO: [10]: 12 + [1692175836.558618][8295:8297] CHIP:TOO: [11]: 13 ./chip-tool descriptor read parts-list 1 3 @@ -638,7 +652,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 3. [1657013905.333904][5805:5810] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 4168180 - [1657013905.333984][5805:5810] CHIP:TOO: parts list: 0 entries + [1657013905.333984][5805:5810] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 4 @@ -646,7 +660,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 4. [1657014011.276060][5822:5827] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2935336058 - [1657014011.276141][5822:5827] CHIP:TOO: parts list: 0 entries + [1657014011.276141][5822:5827] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 5 @@ -654,24 +668,23 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 5. [1657014034.298958][5829:5834] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3372622835 - [1657014034.299041][5829:5834] CHIP:TOO: parts list: 0 entries + [1657014034.299041][5829:5834] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 6 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 6. [1657014056.893995][5847:5852] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1565587733 - [1657014056.894072][5847:5852] CHIP:TOO: parts list: 3 entries + [1657014056.894072][5847:5852] CHIP:TOO: PartsList: 2 entries [1657014056.894104][5847:5852] CHIP:TOO: [1]: 7 [1657014056.894130][5847:5852] CHIP:TOO: [2]: 8 - [1657014056.894154][5847:5852] CHIP:TOO: [3]: 9 ./chip-tool descriptor read parts-list 1 7 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 7. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 8 @@ -720,131 +733,170 @@ tests: [1663237070.228588][5642:5647] CHIP:TOO: PartsList: 0 entries - ./chip-tool descriptor read parts-list 1 14 - - Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 14. - - 1657014512.922645][6043:6048] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 503350386 - [1657014512.922742][6043:6048] CHIP:TOO: parts list: 0 entries - ./chip-tool descriptor read device-type-list 1 1 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 1. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 1. - [1666259443.940442][49193:49198] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 - [1666259443.940547][49193:49198] CHIP:TOO: DeviceTypeList: 1 entries - [1666259443.940616][49193:49198] CHIP:TOO: [1]: { - [1666259443.940666][49193:49198] CHIP:TOO: Type: 14 - [1666259443.940690][49193:49198] CHIP:TOO: Revision: 1 - [1666259443.940710][49193:49198] CHIP:TOO: } + 1666244345.296680][44990:44995] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 + [1666244345.296742][44990:44995] CHIP:TOO: DeviceTypeList: 1 entries + [1666244345.296800][44990:44995] CHIP:TOO: [1]: { + [1666244345.296846][44990:44995] CHIP:TOO: DeviceType: 14 + [1666244345.296874][44990:44995] CHIP:TOO: Revision: 1 + [1666244345.296904][44990:44995] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 3 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 3. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 3. - [1666338247.117097][53837:53842] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2862309133 - [1666338247.117198][53837:53842] CHIP:TOO: DeviceTypeList: 2 entries - [1666338247.117275][53837:53842] CHIP:TOO: [1]: { - [1666338247.117302][53837:53842] CHIP:TOO: Type: 256 - [1666338247.117346][53837:53842] CHIP:TOO: Revision: 1 - [1666338247.117370][53837:53842] CHIP:TOO: } - [1666338247.117402][53837:53842] CHIP:TOO: [2]: { - [1666338247.117425][53837:53842] CHIP:TOO: Type: 19 - [1666338247.117449][53837:53842] CHIP:TOO: Revision: 1 - [1666338247.117472][53837:53842] CHIP:TOO: } + [1666244839.544979][45200:45205] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1513076890 + [1666244839.545006][45200:45205] CHIP:TOO: DeviceTypeList: 2 entries + [1666244839.545019][45200:45205] CHIP:TOO: [1]: { + [1666244839.545027][45200:45205] CHIP:TOO: DeviceType: 256 + [1666244839.545035][45200:45205] CHIP:TOO: Revision: 1 + [1666244839.545042][45200:45205] CHIP:TOO: } + [1666244839.545051][45200:45205] CHIP:TOO: [2]: { + [1666244839.545058][45200:45205] CHIP:TOO: DeviceType: 19 + [1666244839.545066][45200:45205] CHIP:TOO: Revision: 1 + [1666244839.545073][45200:45205] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 4 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 4. - - [1666259669.219517][49250:49255] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 - [1666259669.219625][49250:49255] CHIP:TOO: DeviceTypeList: 2 entries - [1666259669.219670][49250:49255] CHIP:TOO: [1]: { - [1666259669.219698][49250:49255] CHIP:TOO: Type: 770 - [1666259669.219725][49250:49255] CHIP:TOO: Revision: 1 - [1666259669.219750][49250:49255] CHIP:TOO: } - [1666259669.219784][49250:49255] CHIP:TOO: [2]: { - [1666259669.219810][49250:49255] CHIP:TOO: Type: 19 - [1666259669.219834][49250:49255] CHIP:TOO: Revision: 1 - [1666259669.219858][49250:49255] CHIP:TOO: } + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 4. + [1666244925.833459][45215:45220] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 + [1666244925.833553][45215:45220] CHIP:TOO: DeviceTypeList: 2 entries + [1666244925.833599][45215:45220] CHIP:TOO: [1]: { + [1666244925.833627][45215:45220] CHIP:TOO: DeviceType: 770 + [1666244925.833658][45215:45220] CHIP:TOO: Revision: 1 + [1666244925.833686][45215:45220] CHIP:TOO: } + [1666244925.833726][45215:45220] CHIP:TOO: [2]: { + [1666244925.833752][45215:45220] CHIP:TOO: DeviceType: 19 + [1666244925.833781][45215:45220] CHIP:TOO: Revision: 1 + [1666244925.833809][45215:45220] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 5 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 5. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 5. - [1666259695.336104][49258:49263] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1760060075 - [1666259695.336266][49258:49263] CHIP:TOO: DeviceTypeList: 2 entries - [1666259695.336368][49258:49263] CHIP:TOO: [1]: { - [1666259695.336449][49258:49263] CHIP:TOO: Type: 770 - [1666259695.336500][49258:49263] CHIP:TOO: Revision: 1 - [1666259695.336551][49258:49263] CHIP:TOO: } - [1666259695.336622][49258:49263] CHIP:TOO: [2]: { - [1666259695.336659][49258:49263] CHIP:TOO: Type: 19 - [1666259695.336694][49258:49263] CHIP:TOO: Revision: 1 - [1666259695.336745][49258:49263] CHIP:TOO: } + [1692170726.055153][8028:8031] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1085687870 + [1692170726.055261][8028:8031] CHIP:TOO: DeviceTypeList: 2 entries + [1692170726.055331][8028:8031] CHIP:TOO: [1]: { + [1692170726.055370][8028:8031] CHIP:TOO: DeviceType: 770 + [1692170726.055407][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055441][8028:8031] CHIP:TOO: } + [1692170726.055484][8028:8031] CHIP:TOO: [2]: { + [1692170726.055520][8028:8031] CHIP:TOO: DeviceType: 19 + [1692170726.055553][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055591][8028:8031] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 6 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 6. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 6. - [1666259757.823150][49274:49279] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3539120641 - [1666259757.823220][49274:49279] CHIP:TOO: DeviceTypeList: 1 entries - [1666259757.823250][49274:49279] CHIP:TOO: [1]: { - [1666259757.823269][49274:49279] CHIP:TOO: Type: 19 - [1666259757.823287][49274:49279] CHIP:TOO: Revision: 1 - [1666259757.823304][49274:49279] CHIP:TOO: } + [1692170742.458148][8033:8035] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2945297824 + [1692170742.458231][8033:8035] CHIP:TOO: DeviceTypeList: 2 entries + [1692170742.458282][8033:8035] CHIP:TOO: [1]: { + [1692170742.458310][8033:8035] CHIP:TOO: DeviceType: 19 + [1692170742.458348][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458372][8033:8035] CHIP:TOO: } + [1692170742.458412][8033:8035] CHIP:TOO: [2]: { + [1692170742.458437][8033:8035] CHIP:TOO: DeviceType: 17 + [1692170742.458461][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458526][8033:8035] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 10 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 10. - [1666259819.548394][49296:49301] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 - [1666259819.548807][49296:49301] CHIP:TOO: DeviceTypeList: 2 entries - [1666259819.548995][49296:49301] CHIP:TOO: [1]: { - [1666259819.549025][49296:49301] CHIP:TOO: Type: 256 - [1666259819.549053][49296:49301] CHIP:TOO: Revision: 1 - [1666259819.549080][49296:49301] CHIP:TOO: } - [1666259819.549116][49296:49301] CHIP:TOO: [2]: { - [1666259819.549141][49296:49301] CHIP:TOO: Type: 19 - [1666259819.549165][49296:49301] CHIP:TOO: Revision: 1 - [1666259819.549191][49296:49301] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 7 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 7. + [1666246718.470591][45821:45826] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3285189124 + [1666246718.470649][45821:45826] CHIP:TOO: DeviceTypeList: 1 entries + [1666246718.470678][45821:45826] CHIP:TOO: [1]: { + [1666246718.470697][45821:45826] CHIP:TOO: DeviceType: 770 + [1666246718.470715][45821:45826] CHIP:TOO: Revision: 1 + [1666246718.470733][45821:45826] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 8 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 8. + + [1666246775.067195][45834:45839] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3210151050 + [1666246775.067256][45834:45839] CHIP:TOO: DeviceTypeList: 1 entries + [1666246775.067297][45834:45839] CHIP:TOO: [1]: { + [1666246775.067324][45834:45839] CHIP:TOO: DeviceType: 770 + [1666246775.067350][45834:45839] CHIP:TOO: Revision: 1 + [1666246775.067375][45834:45839] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 9 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 9. + + [1692170786.513524][8042:8044] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 133253296 + [1692170786.513603][8042:8044] CHIP:TOO: DeviceTypeList: 2 entries + [1692170786.513654][8042:8044] CHIP:TOO: [1]: { + [1692170786.513681][8042:8044] CHIP:TOO: DeviceType: 256 + [1692170786.513706][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513730][8042:8044] CHIP:TOO: } + [1692170786.513759][8042:8044] CHIP:TOO: [2]: { + [1692170786.513785][8042:8044] CHIP:TOO: DeviceType: 19 + [1692170786.513809][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513833][8042:8044] CHIP:TOO: } + + + + ./chip-tool descriptor read device-type-list 1 10 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 10. + + [1666246866.935280][45904:45909] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 + [1666246866.935412][45904:45909] CHIP:TOO: DeviceTypeList: 2 entries + [1666246866.935484][45904:45909] CHIP:TOO: [1]: { + [1666246866.935538][45904:45909] CHIP:TOO: DeviceType: 256 + [1666246866.935564][45904:45909] CHIP:TOO: Revision: 1 + [1666246866.935587][45904:45909] CHIP:TOO: } + [1666246866.935620][45904:45909] CHIP:TOO: [2]: { + [1666246866.935644][45904:45909] CHIP:TOO: DeviceType: 19 + [1666246866.935668][45904:45909] CHIP:TOO: Revision: 1 + [1666246866.935691][45904:45909] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 11 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 11. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 11. - [1666259853.748503][49306:49311] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 - [1666259853.748599][49306:49311] CHIP:TOO: DeviceTypeList: 2 entries - [1666259853.748676][49306:49311] CHIP:TOO: [1]: { - [1666259853.748703][49306:49311] CHIP:TOO: Type: 256 - [1666259853.748748][49306:49311] CHIP:TOO: Revision: 1 - [1666259853.748773][49306:49311] CHIP:TOO: } - [1666259853.748805][49306:49311] CHIP:TOO: [2]: { - [1666259853.748829][49306:49311] CHIP:TOO: Type: 19 - [1666259853.748852][49306:49311] CHIP:TOO: Revision: 1 - [1666259853.748875][49306:49311] CHIP:TOO: } + [1666246922.797443][45920:45925] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 + [1666246922.797466][45920:45925] CHIP:TOO: DeviceTypeList: 2 entries + [1666246922.797484][45920:45925] CHIP:TOO: [1]: { + [1666246922.797497][45920:45925] CHIP:TOO: DeviceType: 256 + [1666246922.797504][45920:45925] CHIP:TOO: Revision: 1 + [1666246922.797512][45920:45925] CHIP:TOO: } + [1666246922.797521][45920:45925] CHIP:TOO: [2]: { + [1666246922.797527][45920:45925] CHIP:TOO: DeviceType: 19 + [1666246922.797533][45920:45925] CHIP:TOO: Revision: 1 + [1666246922.797539][45920:45925] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 12 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 12. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 12. + + [1666246970.442284][45932:45937] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 + [1666246970.442340][45932:45937] CHIP:TOO: DeviceTypeList: 2 entries + [1666246970.442386][45932:45937] CHIP:TOO: [1]: { + [1666246970.442414][45932:45937] CHIP:TOO: DeviceType: 256 + [1666246970.442446][45932:45937] CHIP:TOO: Revision: 1 + [1666246970.442474][45932:45937] CHIP:TOO: } + [1666246970.442513][45932:45937] CHIP:TOO: [2]: { + [1666246970.442541][45932:45937] CHIP:TOO: DeviceType: 19 + [1666246970.442570][45932:45937] CHIP:TOO: Revision: 1 + [1666246970.442597][45932:45937] CHIP:TOO: } - [1666259896.402204][49317:49322] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 - [1666259896.402387][49317:49322] CHIP:TOO: DeviceTypeList: 2 entries - [1666259896.402454][49317:49322] CHIP:TOO: [1]: { - [1666259896.402499][49317:49322] CHIP:TOO: Type: 256 - [1666259896.402525][49317:49322] CHIP:TOO: Revision: 1 - [1666259896.402549][49317:49322] CHIP:TOO: } - [1666259896.402580][49317:49322] CHIP:TOO: [2]: { - [1666259896.402604][49317:49322] CHIP:TOO: Type: 19 - [1666259896.402627][49317:49322] CHIP:TOO: Revision: 1 - [1666259896.402649][49317:49322] CHIP:TOO: } @@ -855,29 +907,13 @@ tests: [1666259951.507848][49328:49333] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1009438523 [1666259951.507957][49328:49333] CHIP:TOO: DeviceTypeList: 2 entries [1666259951.508009][49328:49333] CHIP:TOO: [1]: { - [1666259951.508040][49328:49333] CHIP:TOO: Type: 256 + [1666259951.508040][49328:49333] CHIP:TOO: DeviceType: 256 [1666259951.508072][49328:49333] CHIP:TOO: Revision: 1 [1666259951.508100][49328:49333] CHIP:TOO: } [1666259951.508131][49328:49333] CHIP:TOO: [2]: { - [1666259951.508154][49328:49333] CHIP:TOO: Type: 19 + [1666259951.508154][49328:49333] CHIP:TOO: DeviceType: 19 [1666259951.508177][49328:49333] CHIP:TOO: Revision: 1 [1666259951.508200][49328:49333] CHIP:TOO: } - - - ./chip-tool descriptor read device-type-list 1 14 - - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 14. - - [1657014545.912534][6051:6056] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 503350386 - [1657014545.912595][6051:6056] CHIP:TOO: device list: 2 entries - [1657014545.912645][6051:6056] CHIP:TOO: [1]: { - [1657014545.912684][6051:6056] CHIP:TOO: Type: 256 - [1657014545.912710][6051:6056] CHIP:TOO: Revision: 1 - [1657014545.912735][6051:6056] CHIP:TOO: } - [1657014545.912764][6051:6056] CHIP:TOO: [2]: { - [1657014545.912789][6051:6056] CHIP:TOO: Type: 19 - [1657014545.912812][6051:6056] CHIP:TOO: Revision: 1 - [1657014545.912835][6051:6056] CHIP:TOO: } disabled: true - label: @@ -1004,19 +1040,19 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 0. [1657005165.790283][4885:4890] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3573910942 - [1657005165.790379][4885:4890] CHIP:TOO: parts list: 12 entries - [1657005165.790409][4885:4890] CHIP:TOO: [1]: 1 - [1657005165.790443][4885:4890] CHIP:TOO: [2]: 4 - [1657005165.790472][4885:4890] CHIP:TOO: [3]: 5 - [1657005165.790501][4885:4890] CHIP:TOO: [4]: 6 - [1657005165.790529][4885:4890] CHIP:TOO: [5]: 7 - [1657005165.790558][4885:4890] CHIP:TOO: [6]: 8 - [1657005165.790585][4885:4890] CHIP:TOO: [7]: 9 - [1657005165.790613][4885:4890] CHIP:TOO: [8]: 10 - [1657005165.790641][4885:4890] CHIP:TOO: [9]: 11 - [1657005165.790670][4885:4890] CHIP:TOO: [10]: 12 - [1657005165.790698][4885:4890] CHIP:TOO: [11]: 13 - [1657005165.790727][4885:4890] CHIP:TOO: [12]: 14 + [1692176279.763458][8337:8339] CHIP:TOO: PartsList: 11 entries + [1692176279.763500][8337:8339] CHIP:TOO: [1]: 1 + [1692176279.763528][8337:8339] CHIP:TOO: [2]: 4 + [1692176279.763554][8337:8339] CHIP:TOO: [3]: 5 + [1692176279.763579][8337:8339] CHIP:TOO: [4]: 6 + [1692176279.763603][8337:8339] CHIP:TOO: [5]: 7 + [1692176279.763628][8337:8339] CHIP:TOO: [6]: 8 + [1692176279.763653][8337:8339] CHIP:TOO: [7]: 9 + [1692176279.763678][8337:8339] CHIP:TOO: [8]: 10 + [1692176279.763702][8337:8339] CHIP:TOO: [9]: 11 + [1692176279.763727][8337:8339] CHIP:TOO: [10]: 12 + [1692176279.763752][8337:8339] CHIP:TOO: [11]: 13 + ./chip-tool descriptor read device-type-list 1 0 @@ -1026,7 +1062,7 @@ tests: [1666260216.664281][49376:49381] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4030820095 [1666260216.664352][49376:49381] CHIP:TOO: DeviceTypeList: 1 entries [1666260216.664420][49376:49381] CHIP:TOO: [1]: { - [1666260216.664474][49376:49381] CHIP:TOO: Type: 22 + [1666260216.664474][49376:49381] CHIP:TOO: DeviceType: 22 [1666260216.664504][49376:49381] CHIP:TOO: Revision: 1 [1666260216.664531][49376:49381] CHIP:TOO: } disabled: true @@ -1042,18 +1078,18 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 1. [1657005188.474784][4893:4898] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3021853416 - [1657005188.474879][4893:4898] CHIP:TOO: parts list: 11 entries - [1657005188.474914][4893:4898] CHIP:TOO: [1]: 4 - [1657005188.474954][4893:4898] CHIP:TOO: [2]: 5 - [1657005188.474983][4893:4898] CHIP:TOO: [3]: 6 - [1657005188.475048][4893:4898] CHIP:TOO: [4]: 7 - [1657005188.475079][4893:4898] CHIP:TOO: [5]: 8 - [1657005188.475107][4893:4898] CHIP:TOO: [6]: 9 - [1657005188.475147][4893:4898] CHIP:TOO: [7]: 10 - [1657005188.475175][4893:4898] CHIP:TOO: [8]: 11 - [1657005188.475213][4893:4898] CHIP:TOO: [9]: 12 - [1657005188.475242][4893:4898] CHIP:TOO: [10]: 13 - [1657005188.475279][4893:4898] CHIP:TOO: [11]: 14 + [1692176318.919081][8344:8347] CHIP:TOO: PartsList: 10 entries + [1692176318.919174][8344:8347] CHIP:TOO: [1]: 4 + [1692176318.919238][8344:8347] CHIP:TOO: [2]: 5 + [1692176318.919296][8344:8347] CHIP:TOO: [3]: 6 + [1692176318.919353][8344:8347] CHIP:TOO: [4]: 7 + [1692176318.919410][8344:8347] CHIP:TOO: [5]: 8 + [1692176318.919467][8344:8347] CHIP:TOO: [6]: 9 + [1692176318.919524][8344:8347] CHIP:TOO: [7]: 10 + [1692176318.919581][8344:8347] CHIP:TOO: [8]: 11 + [1692176318.919639][8344:8347] CHIP:TOO: [9]: 12 + [1692176318.919696][8344:8347] CHIP:TOO: [10]: 13 + ./chip-tool descriptor read device-type-list 1 1 @@ -1063,7 +1099,7 @@ tests: [1666260297.215137][49388:49393] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 [1666260297.215199][49388:49393] CHIP:TOO: DeviceTypeList: 1 entries [1666260297.215234][49388:49393] CHIP:TOO: [1]: { - [1666260297.215270][49388:49393] CHIP:TOO: Type: 14 + [1666260297.215270][49388:49393] CHIP:TOO: DeviceType: 14 [1666260297.215292][49388:49393] CHIP:TOO: Revision: 1 [1666260297.215312][49388:49393] CHIP:TOO: } disabled: true @@ -1080,19 +1116,19 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 0. [1657014638.415060][6061:6066] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2526005576 - [1657014638.415201][6061:6066] CHIP:TOO: parts list: 12 entries - [1657014638.415237][6061:6066] CHIP:TOO: [1]: 1 - [1657014638.415266][6061:6066] CHIP:TOO: [2]: 4 - [1657014638.415294][6061:6066] CHIP:TOO: [3]: 5 - [1657014638.415322][6061:6066] CHIP:TOO: [4]: 6 - [1657014638.415350][6061:6066] CHIP:TOO: [5]: 7 - [1657014638.415378][6061:6066] CHIP:TOO: [6]: 8 - [1657014638.415406][6061:6066] CHIP:TOO: [7]: 9 - [1657014638.415434][6061:6066] CHIP:TOO: [8]: 10 - [1657014638.415462][6061:6066] CHIP:TOO: [9]: 11 - [1657014638.415490][6061:6066] CHIP:TOO: [10]: 12 - [1657014638.415519][6061:6066] CHIP:TOO: [11]: 13 - [1657014638.415547][6061:6066] CHIP:TOO: [12]: 14 + [1692176352.929813][8353:8355] CHIP:TOO: PartsList: 11 entries + [1692176352.929883][8353:8355] CHIP:TOO: [1]: 1 + [1692176352.929930][8353:8355] CHIP:TOO: [2]: 4 + [1692176352.929975][8353:8355] CHIP:TOO: [3]: 5 + [1692176352.930017][8353:8355] CHIP:TOO: [4]: 6 + [1692176352.930060][8353:8355] CHIP:TOO: [5]: 7 + [1692176352.930102][8353:8355] CHIP:TOO: [6]: 8 + [1692176352.930145][8353:8355] CHIP:TOO: [7]: 9 + [1692176352.930188][8353:8355] CHIP:TOO: [8]: 10 + [1692176352.930231][8353:8355] CHIP:TOO: [9]: 11 + [1692176352.930274][8353:8355] CHIP:TOO: [10]: 12 + [1692176352.930317][8353:8355] CHIP:TOO: [11]: 13 + @@ -1101,19 +1137,17 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 1. [1657014672.768932][6068:6073] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1583672817 - [1657014672.769082][6068:6073] CHIP:TOO: parts list: 11 entries - [1657014672.769119][6068:6073] CHIP:TOO: [1]: 4 - [1657014672.769148][6068:6073] CHIP:TOO: [2]: 5 - [1657014672.769176][6068:6073] CHIP:TOO: [3]: 6 - [1657014672.769205][6068:6073] CHIP:TOO: [4]: 7 - [1657014672.769233][6068:6073] CHIP:TOO: [5]: 8 - [1657014672.769260][6068:6073] CHIP:TOO: [6]: 9 - [1657014672.769289][6068:6073] CHIP:TOO: [7]: 10 - [1657014672.769318][6068:6073] CHIP:TOO: [8]: 11 - [1657014672.769346][6068:6073] CHIP:TOO: [9]: 12 - [1657014672.769375][6068:6073] CHIP:TOO: [10]: 13 - [1657014672.769403][6068:6073] CHIP:TOO: [11]: 14 - + [1692176363.254493][8356:8358] CHIP:TOO: PartsList: 10 entries + [1692176363.254585][8356:8358] CHIP:TOO: [1]: 4 + [1692176363.254648][8356:8358] CHIP:TOO: [2]: 5 + [1692176363.254709][8356:8358] CHIP:TOO: [3]: 6 + [1692176363.254766][8356:8358] CHIP:TOO: [4]: 7 + [1692176363.254824][8356:8358] CHIP:TOO: [5]: 8 + [1692176363.254883][8356:8358] CHIP:TOO: [6]: 9 + [1692176363.254940][8356:8358] CHIP:TOO: [7]: 10 + [1692176363.254997][8356:8358] CHIP:TOO: [8]: 11 + [1692176363.255054][8356:8358] CHIP:TOO: [9]: 12 + [1692176363.255111][8356:8358] CHIP:TOO: [10]: 13 ./chip-tool descriptor read parts-list 1 4 @@ -1121,7 +1155,7 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 4. [1657014011.276060][5822:5827] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2935336058 - [1657014011.276141][5822:5827] CHIP:TOO: parts list: 0 entries + [1657014011.276141][5822:5827] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 5 @@ -1129,209 +1163,234 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 5. [1657014034.298958][5829:5834] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3372622835 - [1657014034.299041][5829:5834] CHIP:TOO: parts list: 0 entries + [1657014034.299041][5829:5834] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 6 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 6. [1657014056.893995][5847:5852] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1565587733 - [1657014056.894072][5847:5852] CHIP:TOO: parts list: 3 entries + [1657014056.894072][5847:5852] CHIP:TOO: PartsList: 2 entries [1657014056.894104][5847:5852] CHIP:TOO: [1]: 7 [1657014056.894130][5847:5852] CHIP:TOO: [2]: 8 - [1657014056.894154][5847:5852] CHIP:TOO: [3]: 9 ./chip-tool descriptor read parts-list 1 7 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 7. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 8 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 8. - [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1663236927.299795][5601:5606] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 310 + [1663236927.299849][5601:5606] CHIP:TOO: PartsList: 0 entries + ./chip-tool descriptor read parts-list 1 9 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 9. - [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1663236962.433335][5608:5613] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3304459819 + [1663236962.433395][5608:5613] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 10 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 10. - [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1663236993.718577][5615:5620] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2389378730 + [1663236993.718639][5615:5620] CHIP:TOO: PartsList: 0 entries + ./chip-tool descriptor read parts-list 1 11 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 11. - [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + 1663237029.086031][5627:5632] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3007496001 + [1663237029.086097][5627:5632] CHIP:TOO: PartsList: 0 entries + ./chip-tool descriptor read parts-list 1 12 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 12. - [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1663237048.194842][5636:5641] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2445783348 + [1663237048.194910][5636:5641] CHIP:TOO: PartsList: 0 entries + ./chip-tool descriptor read parts-list 1 13 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 13. - [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + 1663237070.228529][5642:5647] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 4223376445 + [1663237070.228588][5642:5647] CHIP:TOO: PartsList: 0 entries - ./chip-tool descriptor read parts-list 1 14 - Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 14. + ./chip-tool descriptor read device-type-list 1 1 - 1657014512.922645][6043:6048] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 503350386 - [1657014512.922742][6043:6048] CHIP:TOO: parts list: 0 entries + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 1. - ./chip-tool descriptor read device-type-list 1 1 + 1666244345.296680][44990:44995] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3968445751 + [1666244345.296742][44990:44995] CHIP:TOO: DeviceTypeList: 1 entries + [1666244345.296800][44990:44995] CHIP:TOO: [1]: { + [1666244345.296846][44990:44995] CHIP:TOO: DeviceType: 14 + [1666244345.296874][44990:44995] CHIP:TOO: Revision: 1 + [1666244345.296904][44990:44995] CHIP:TOO: } - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 1. - [1666338959.159031][54089:54094] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4153437440 - [1666338959.159104][54089:54094] CHIP:TOO: DeviceTypeList: 1 entries - [1666338959.159177][54089:54094] CHIP:TOO: [1]: { - [1666338959.159226][54089:54094] CHIP:TOO: Type: 14 - [1666338959.159253][54089:54094] CHIP:TOO: Revision: 1 - [1666338959.159277][54089:54094] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 4 - ./chip-tool descriptor read device-type-list 1 4 + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 4. - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 4. + [1666244925.833459][45215:45220] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1944707282 + [1666244925.833553][45215:45220] CHIP:TOO: DeviceTypeList: 2 entries + [1666244925.833599][45215:45220] CHIP:TOO: [1]: { + [1666244925.833627][45215:45220] CHIP:TOO: DeviceType: 770 + [1666244925.833658][45215:45220] CHIP:TOO: Revision: 1 + [1666244925.833686][45215:45220] CHIP:TOO: } + [1666244925.833726][45215:45220] CHIP:TOO: [2]: { + [1666244925.833752][45215:45220] CHIP:TOO: DeviceType: 19 + [1666244925.833781][45215:45220] CHIP:TOO: Revision: 1 + [1666244925.833809][45215:45220] CHIP:TOO: } - [1666339056.791288][54121:54126] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2823994112 - [1666339056.791391][54121:54126] CHIP:TOO: DeviceTypeList: 2 entries - [1666339056.791438][54121:54126] CHIP:TOO: [1]: { - [1666339056.791465][54121:54126] CHIP:TOO: Type: 770 - [1666339056.791496][54121:54126] CHIP:TOO: Revision: 1 - [1666339056.791525][54121:54126] CHIP:TOO: } - [1666339056.791568][54121:54126] CHIP:TOO: [2]: { - [1666339056.791596][54121:54126] CHIP:TOO: Type: 19 - [1666339056.791626][54121:54126] CHIP:TOO: Revision: 1 - [1666339056.791653][54121:54126] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 5 - ./chip-tool descriptor read device-type-list 1 5 + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 5. - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 5. + [1692170726.055153][8028:8031] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1085687870 + [1692170726.055261][8028:8031] CHIP:TOO: DeviceTypeList: 2 entries + [1692170726.055331][8028:8031] CHIP:TOO: [1]: { + [1692170726.055370][8028:8031] CHIP:TOO: DeviceType: 770 + [1692170726.055407][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055441][8028:8031] CHIP:TOO: } + [1692170726.055484][8028:8031] CHIP:TOO: [2]: { + [1692170726.055520][8028:8031] CHIP:TOO: DeviceType: 19 + [1692170726.055553][8028:8031] CHIP:TOO: Revision: 1 + [1692170726.055591][8028:8031] CHIP:TOO: } - [1666339133.924066][54135:54140] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1185270366 - [1666339133.924157][54135:54140] CHIP:TOO: DeviceTypeList: 2 entries - [1666339133.924202][54135:54140] CHIP:TOO: [1]: { - [1666339133.924230][54135:54140] CHIP:TOO: Type: 770 - [1666339133.924261][54135:54140] CHIP:TOO: Revision: 1 - [1666339133.924290][54135:54140] CHIP:TOO: } - [1666339133.924331][54135:54140] CHIP:TOO: [2]: { - [1666339133.924357][54135:54140] CHIP:TOO: Type: 19 - [1666339133.924386][54135:54140] CHIP:TOO: Revision: 1 - [1666339133.924413][54135:54140] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 6 + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 6. - ./chip-tool descriptor read device-type-list 1 6 + [1692170742.458148][8033:8035] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2945297824 + [1692170742.458231][8033:8035] CHIP:TOO: DeviceTypeList: 2 entries + [1692170742.458282][8033:8035] CHIP:TOO: [1]: { + [1692170742.458310][8033:8035] CHIP:TOO: DeviceType: 19 + [1692170742.458348][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458372][8033:8035] CHIP:TOO: } + [1692170742.458412][8033:8035] CHIP:TOO: [2]: { + [1692170742.458437][8033:8035] CHIP:TOO: DeviceType: 17 + [1692170742.458461][8033:8035] CHIP:TOO: Revision: 1 + [1692170742.458526][8033:8035] CHIP:TOO: } - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 6. - [1666339192.765667][54150:54155] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3019197104 - [1666339192.765681][54150:54155] CHIP:TOO: DeviceTypeList: 1 entries - [1666339192.765702][54150:54155] CHIP:TOO: [1]: { - [1666339192.765717][54150:54155] CHIP:TOO: Type: 19 - [1666339192.765726][54150:54155] CHIP:TOO: Revision: 1 - [1666339192.765735][54150:54155] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 10 + ./chip-tool descriptor read device-type-list 1 7 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 10. + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 7. - [1666339247.022099][54172:54177] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3847761018 - [1666339247.022167][54172:54177] CHIP:TOO: DeviceTypeList: 2 entries - [1666339247.022205][54172:54177] CHIP:TOO: [1]: { - [1666339247.022231][54172:54177] CHIP:TOO: Type: 256 - [1666339247.022257][54172:54177] CHIP:TOO: Revision: 1 - [1666339247.022281][54172:54177] CHIP:TOO: } - [1666339247.022313][54172:54177] CHIP:TOO: [2]: { - [1666339247.022336][54172:54177] CHIP:TOO: Type: 19 - [1666339247.022360][54172:54177] CHIP:TOO: Revision: 1 - [1666339247.022383][54172:54177] CHIP:TOO: } + [1666246718.470591][45821:45826] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3285189124 + [1666246718.470649][45821:45826] CHIP:TOO: DeviceTypeList: 1 entries + [1666246718.470678][45821:45826] CHIP:TOO: [1]: { + [1666246718.470697][45821:45826] CHIP:TOO: DeviceType: 770 + [1666246718.470715][45821:45826] CHIP:TOO: Revision: 1 + [1666246718.470733][45821:45826] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 11 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 11. + ./chip-tool descriptor read device-type-list 1 8 - [1666339310.168000][54182:54187] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4158444484 - [1666339310.168098][54182:54187] CHIP:TOO: DeviceTypeList: 2 entries - [1666339310.168171][54182:54187] CHIP:TOO: [1]: { - [1666339310.168224][54182:54187] CHIP:TOO: Type: 256 - [1666339310.168258][54182:54187] CHIP:TOO: Revision: 1 - [1666339310.168289][54182:54187] CHIP:TOO: } - [1666339310.168333][54182:54187] CHIP:TOO: [2]: { - [1666339310.168364][54182:54187] CHIP:TOO: Type: 19 - [1666339310.168397][54182:54187] CHIP:TOO: Revision: 1 - [1666339310.168427][54182:54187] CHIP:TOO: } + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 8. + [1666246775.067195][45834:45839] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3210151050 + [1666246775.067256][45834:45839] CHIP:TOO: DeviceTypeList: 1 entries + [1666246775.067297][45834:45839] CHIP:TOO: [1]: { + [1666246775.067324][45834:45839] CHIP:TOO: DeviceType: 770 + [1666246775.067350][45834:45839] CHIP:TOO: Revision: 1 + [1666246775.067375][45834:45839] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 12 + ./chip-tool descriptor read device-type-list 1 9 + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 9. - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 12. + [1692170786.513524][8042:8044] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 133253296 + [1692170786.513603][8042:8044] CHIP:TOO: DeviceTypeList: 2 entries + [1692170786.513654][8042:8044] CHIP:TOO: [1]: { + [1692170786.513681][8042:8044] CHIP:TOO: DeviceType: 256 + [1692170786.513706][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513730][8042:8044] CHIP:TOO: } + [1692170786.513759][8042:8044] CHIP:TOO: [2]: { + [1692170786.513785][8042:8044] CHIP:TOO: DeviceType: 19 + [1692170786.513809][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513833][8042:8044] CHIP:TOO: } - [1666339370.827538][54193:54198] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2979677803 - [1666339370.827566][54193:54198] CHIP:TOO: DeviceTypeList: 2 entries - [1666339370.827593][54193:54198] CHIP:TOO: [1]: { - [1666339370.827603][54193:54198] CHIP:TOO: Type: 256 - [1666339370.827612][54193:54198] CHIP:TOO: Revision: 1 - [1666339370.827620][54193:54198] CHIP:TOO: } - [1666339370.827632][54193:54198] CHIP:TOO: [2]: { - [1666339370.827640][54193:54198] CHIP:TOO: Type: 19 - [1666339370.827649][54193:54198] CHIP:TOO: Revision: 1 - [1666339370.827657][54193:54198] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 13 + ./chip-tool descriptor read device-type-list 1 10 + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 10. - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 13. + [1666246866.935280][45904:45909] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4193039876 + [1666246866.935412][45904:45909] CHIP:TOO: DeviceTypeList: 2 entries + [1666246866.935484][45904:45909] CHIP:TOO: [1]: { + [1666246866.935538][45904:45909] CHIP:TOO: DeviceType: 256 + [1666246866.935564][45904:45909] CHIP:TOO: Revision: 1 + [1666246866.935587][45904:45909] CHIP:TOO: } + [1666246866.935620][45904:45909] CHIP:TOO: [2]: { + [1666246866.935644][45904:45909] CHIP:TOO: DeviceType: 19 + [1666246866.935668][45904:45909] CHIP:TOO: Revision: 1 + [1666246866.935691][45904:45909] CHIP:TOO: } - [1666339413.453432][54201:54206] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 825842769 - [1666339413.453493][54201:54206] CHIP:TOO: DeviceTypeList: 2 entries - [1666339413.453527][54201:54206] CHIP:TOO: [1]: { - [1666339413.453547][54201:54206] CHIP:TOO: Type: 256 - [1666339413.453567][54201:54206] CHIP:TOO: Revision: 1 - [1666339413.453585][54201:54206] CHIP:TOO: } - [1666339413.453611][54201:54206] CHIP:TOO: [2]: { - [1666339413.453629][54201:54206] CHIP:TOO: Type: 19 - [1666339413.453647][54201:54206] CHIP:TOO: Revision: 1 - [1666339413.453664][54201:54206] CHIP:TOO: } + ./chip-tool descriptor read device-type-list 1 11 + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 11. - ./chip-tool descriptor read device-type-list 1 14 + [1666246922.797443][45920:45925] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2632191905 + [1666246922.797466][45920:45925] CHIP:TOO: DeviceTypeList: 2 entries + [1666246922.797484][45920:45925] CHIP:TOO: [1]: { + [1666246922.797497][45920:45925] CHIP:TOO: DeviceType: 256 + [1666246922.797504][45920:45925] CHIP:TOO: Revision: 1 + [1666246922.797512][45920:45925] CHIP:TOO: } + [1666246922.797521][45920:45925] CHIP:TOO: [2]: { + [1666246922.797527][45920:45925] CHIP:TOO: DeviceType: 19 + [1666246922.797533][45920:45925] CHIP:TOO: Revision: 1 + [1666246922.797539][45920:45925] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 12 - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 14. - - [1666339467.335722][54212:54217] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3691015272 - [1666339467.335748][54212:54217] CHIP:TOO: DeviceTypeList: 2 entries - [1666339467.335768][54212:54217] CHIP:TOO: [1]: { - [1666339467.335775][54212:54217] CHIP:TOO: Type: 256 - [1666339467.335783][54212:54217] CHIP:TOO: Revision: 1 - [1666339467.335790][54212:54217] CHIP:TOO: } - [1666339467.335801][54212:54217] CHIP:TOO: [2]: { - [1666339467.335808][54212:54217] CHIP:TOO: Type: 19 - [1666339467.335815][54212:54217] CHIP:TOO: Revision: 1 - [1666339467.335822][54212:54217] CHIP:TOO: } + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 12. + + [1666246970.442284][45932:45937] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 494395813 + [1666246970.442340][45932:45937] CHIP:TOO: DeviceTypeList: 2 entries + [1666246970.442386][45932:45937] CHIP:TOO: [1]: { + [1666246970.442414][45932:45937] CHIP:TOO: DeviceType: 256 + [1666246970.442446][45932:45937] CHIP:TOO: Revision: 1 + [1666246970.442474][45932:45937] CHIP:TOO: } + [1666246970.442513][45932:45937] CHIP:TOO: [2]: { + [1666246970.442541][45932:45937] CHIP:TOO: DeviceType: 19 + [1666246970.442570][45932:45937] CHIP:TOO: Revision: 1 + [1666246970.442597][45932:45937] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 13 + + Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 13. + + [1666259951.507848][49328:49333] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1009438523 + [1666259951.507957][49328:49333] CHIP:TOO: DeviceTypeList: 2 entries + [1666259951.508009][49328:49333] CHIP:TOO: [1]: { + [1666259951.508040][49328:49333] CHIP:TOO: DeviceType: 256 + [1666259951.508072][49328:49333] CHIP:TOO: Revision: 1 + [1666259951.508100][49328:49333] CHIP:TOO: } + [1666259951.508131][49328:49333] CHIP:TOO: [2]: { + [1666259951.508154][49328:49333] CHIP:TOO: DeviceType: 19 + [1666259951.508177][49328:49333] CHIP:TOO: Revision: 1 + [1666259951.508200][49328:49333] CHIP:TOO: } disabled: true - label: "Step 4z: Restart the DUT" @@ -1359,20 +1418,20 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 0. [1657005275.756668][4900:4905] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3573910943 - [1657005275.756770][4900:4905] CHIP:TOO: parts list: 13 entries - [1657005275.756808][4900:4905] CHIP:TOO: [1]: 1 - [1657005275.756840][4900:4905] CHIP:TOO: [2]: 15 - [1657005275.756871][4900:4905] CHIP:TOO: [3]: 4 - [1657005275.756902][4900:4905] CHIP:TOO: [4]: 5 - [1657005275.756933][4900:4905] CHIP:TOO: [5]: 6 - [1657005275.756963][4900:4905] CHIP:TOO: [6]: 7 - [1657005275.756993][4900:4905] CHIP:TOO: [7]: 8 - [1657005275.757024][4900:4905] CHIP:TOO: [8]: 9 - [1657005275.757054][4900:4905] CHIP:TOO: [9]: 10 - [1657005275.757085][4900:4905] CHIP:TOO: [10]: 11 - [1657005275.757116][4900:4905] CHIP:TOO: [11]: 12 - [1657005275.757146][4900:4905] CHIP:TOO: [12]: 13 - [1657005275.757177][4900:4905] CHIP:TOO: [13]: 14 + [1692176798.195451][8370:8373] CHIP:TOO: PartsList: 12 entries + [1692176798.195489][8370:8373] CHIP:TOO: [1]: 1 + [1692176798.195514][8370:8373] CHIP:TOO: [2]: 14 + [1692176798.195547][8370:8373] CHIP:TOO: [3]: 4 + [1692176798.195570][8370:8373] CHIP:TOO: [4]: 5 + [1692176798.195601][8370:8373] CHIP:TOO: [5]: 6 + [1692176798.195623][8370:8373] CHIP:TOO: [6]: 7 + [1692176798.195696][8370:8373] CHIP:TOO: [7]: 8 + [1692176798.195729][8370:8373] CHIP:TOO: [8]: 9 + [1692176798.195774][8370:8373] CHIP:TOO: [9]: 10 + [1692176798.195808][8370:8373] CHIP:TOO: [10]: 11 + [1692176798.195856][8370:8373] CHIP:TOO: [11]: 12 + [1692176798.195904][8370:8373] CHIP:TOO: [12]: 13 + ./chip-tool descriptor read device-type-list 1 0 @@ -1399,19 +1458,19 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 1. [1657005310.589940][4938:4943] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3021853417 - [1657005310.590033][4938:4943] CHIP:TOO: parts list: 12 entries - [1657005310.590066][4938:4943] CHIP:TOO: [1]: 15 - [1657005310.590092][4938:4943] CHIP:TOO: [2]: 4 - [1657005310.590117][4938:4943] CHIP:TOO: [3]: 5 - [1657005310.590142][4938:4943] CHIP:TOO: [4]: 6 - [1657005310.590167][4938:4943] CHIP:TOO: [5]: 7 - [1657005310.590191][4938:4943] CHIP:TOO: [6]: 8 - [1657005310.590216][4938:4943] CHIP:TOO: [7]: 9 - [1657005310.590241][4938:4943] CHIP:TOO: [8]: 10 - [1657005310.590266][4938:4943] CHIP:TOO: [9]: 11 - [1657005310.590291][4938:4943] CHIP:TOO: [10]: 12 - [1657005310.590316][4938:4943] CHIP:TOO: [11]: 13 - [1657005310.590341][4938:4943] CHIP:TOO: [12]: 14 + [1692176828.083072][8379:8381] CHIP:TOO: PartsList: 11 entries + [1692176828.083125][8379:8381] CHIP:TOO: [1]: 14 + [1692176828.083160][8379:8381] CHIP:TOO: [2]: 4 + [1692176828.083208][8379:8381] CHIP:TOO: [3]: 5 + [1692176828.083241][8379:8381] CHIP:TOO: [4]: 6 + [1692176828.083286][8379:8381] CHIP:TOO: [5]: 7 + [1692176828.083317][8379:8381] CHIP:TOO: [6]: 8 + [1692176828.083348][8379:8381] CHIP:TOO: [7]: 9 + [1692176828.083425][8379:8381] CHIP:TOO: [8]: 10 + [1692176828.083470][8379:8381] CHIP:TOO: [9]: 11 + [1692176828.083503][8379:8381] CHIP:TOO: [10]: 12 + [1692176828.083534][8379:8381] CHIP:TOO: [11]: 13 + ./chip-tool descriptor read device-type-list 1 1 @@ -1420,7 +1479,7 @@ tests: [1657514252.212456][15958:15963] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2755694332 [1666260348.181193][49397:49402] CHIP:TOO: DeviceTypeList: 1 entries [1666260348.181241][49397:49402] CHIP:TOO: [1]: { - [1666260348.181327][49397:49402] CHIP:TOO: Type: 14 + [1666260348.181327][49397:49402] CHIP:TOO: DeviceType: 14 [1666260348.181351][49397:49402] CHIP:TOO: Revision: 1 [1666260348.181372][49397:49402] CHIP:TOO: } disabled: true @@ -1435,20 +1494,20 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 0. [1657005275.756668][4900:4905] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3573910943 - [1657005275.756770][4900:4905] CHIP:TOO: parts list: 13 entries - [1657005275.756808][4900:4905] CHIP:TOO: [1]: 1 - [1657005275.756840][4900:4905] CHIP:TOO: [2]: 15 - [1657005275.756871][4900:4905] CHIP:TOO: [3]: 4 - [1657005275.756902][4900:4905] CHIP:TOO: [4]: 5 - [1657005275.756933][4900:4905] CHIP:TOO: [5]: 6 - [1657005275.756963][4900:4905] CHIP:TOO: [6]: 7 - [1657005275.756993][4900:4905] CHIP:TOO: [7]: 8 - [1657005275.757024][4900:4905] CHIP:TOO: [8]: 9 - [1657005275.757054][4900:4905] CHIP:TOO: [9]: 10 - [1657005275.757085][4900:4905] CHIP:TOO: [10]: 11 - [1657005275.757116][4900:4905] CHIP:TOO: [11]: 12 - [1657005275.757146][4900:4905] CHIP:TOO: [12]: 13 - [1657005275.757177][4900:4905] CHIP:TOO: [13]: 14 + [1692176850.157717][8385:8387] CHIP:TOO: PartsList: 12 entries + [1692176850.157758][8385:8387] CHIP:TOO: [1]: 1 + [1692176850.157783][8385:8387] CHIP:TOO: [2]: 14 + [1692176850.157816][8385:8387] CHIP:TOO: [3]: 4 + [1692176850.157840][8385:8387] CHIP:TOO: [4]: 5 + [1692176850.157874][8385:8387] CHIP:TOO: [5]: 6 + [1692176850.157897][8385:8387] CHIP:TOO: [6]: 7 + [1692176850.157920][8385:8387] CHIP:TOO: [7]: 8 + [1692176850.158025][8385:8387] CHIP:TOO: [8]: 9 + [1692176850.158053][8385:8387] CHIP:TOO: [9]: 10 + [1692176850.158111][8385:8387] CHIP:TOO: [10]: 11 + [1692176850.158167][8385:8387] CHIP:TOO: [11]: 12 + [1692176850.158193][8385:8387] CHIP:TOO: [12]: 13 + ./chip-tool descriptor read parts-list 1 1 @@ -1456,35 +1515,35 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 1. [1657005310.589940][4938:4943] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3021853417 - [1657005310.590033][4938:4943] CHIP:TOO: parts list: 12 entries - [1657005310.590066][4938:4943] CHIP:TOO: [1]: 15 - [1657005310.590092][4938:4943] CHIP:TOO: [2]: 4 - [1657005310.590117][4938:4943] CHIP:TOO: [3]: 5 - [1657005310.590142][4938:4943] CHIP:TOO: [4]: 6 - [1657005310.590167][4938:4943] CHIP:TOO: [5]: 7 - [1657005310.590191][4938:4943] CHIP:TOO: [6]: 8 - [1657005310.590216][4938:4943] CHIP:TOO: [7]: 9 - [1657005310.590241][4938:4943] CHIP:TOO: [8]: 10 - [1657005310.590266][4938:4943] CHIP:TOO: [9]: 11 - [1657005310.590291][4938:4943] CHIP:TOO: [10]: 12 - [1657005310.590316][4938:4943] CHIP:TOO: [11]: 13 - [1657005310.590341][4938:4943] CHIP:TOO: [12]: 14 + [1692176860.087637][8388:8390] CHIP:TOO: PartsList: 11 entries + [1692176860.087687][8388:8390] CHIP:TOO: [1]: 14 + [1692176860.087718][8388:8390] CHIP:TOO: [2]: 4 + [1692176860.087749][8388:8390] CHIP:TOO: [3]: 5 + [1692176860.087777][8388:8390] CHIP:TOO: [4]: 6 + [1692176860.087806][8388:8390] CHIP:TOO: [5]: 7 + [1692176860.087834][8388:8390] CHIP:TOO: [6]: 8 + [1692176860.087863][8388:8390] CHIP:TOO: [7]: 9 + [1692176860.087892][8388:8390] CHIP:TOO: [8]: 10 + [1692176860.087920][8388:8390] CHIP:TOO: [9]: 11 + [1692176860.087948][8388:8390] CHIP:TOO: [10]: 12 + [1692176860.087977][8388:8390] CHIP:TOO: [11]: 13 - ./chip-tool descriptor read parts-list 1 15 - Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 15. + ./chip-tool descriptor read parts-list 1 14 + + Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 14. - [1657014783.484273][6118:6123] CHIP:TOO: Endpoint: 15 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2738912500 - [1657014783.484345][6118:6123] CHIP:TOO: parts list: 0 entries + [1657014783.484273][6118:6123] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2738912500 + [1657014783.484345][6118:6123] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 4 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 4. [1657014011.276060][5822:5827] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2935336058 - [1657014011.276141][5822:5827] CHIP:TOO: parts list: 0 entries + [1657014011.276141][5822:5827] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 5 @@ -1492,87 +1551,78 @@ tests: Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 5. [1657014034.298958][5829:5834] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 3372622835 - [1657014034.299041][5829:5834] CHIP:TOO: parts list: 0 entries + [1657014034.299041][5829:5834] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 6 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 6. [1657014056.893995][5847:5852] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1565587733 - [1657014056.894072][5847:5852] CHIP:TOO: parts list: 3 entries + [1657014056.894072][5847:5852] CHIP:TOO: PartsList: 2 entries [1657014056.894104][5847:5852] CHIP:TOO: [1]: 7 [1657014056.894130][5847:5852] CHIP:TOO: [2]: 8 - [1657014056.894154][5847:5852] CHIP:TOO: [3]: 9 ./chip-tool descriptor read parts-list 1 7 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 7. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 8 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 8. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 9 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 9. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 10 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 10. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 11 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 11. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 12 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 12. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries ./chip-tool descriptor read parts-list 1 13 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 13. [1657014071.347535][5854:5859] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1352552269 - [1657014071.347611][5854:5859] CHIP:TOO: parts list: 0 entries + [1657014071.347611][5854:5859] CHIP:TOO: PartsList: 0 entries - ./chip-tool descriptor read parts-list 1 14 + ./chip-tool descriptor read device-type-list 1 14 Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 14. - 1657014512.922645][6043:6048] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 503350386 - [1657014512.922742][6043:6048] CHIP:TOO: parts list: 0 entries - - - ./chip-tool descriptor read device-type-list 1 15 - - Via the TH (chip-tool), Verify the PartsList attribute entries with endpoint 15. - - [1657014818.210651][6132:6137] CHIP:TOO: Endpoint: 15 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2738912500 + [1657014818.210651][6132:6137] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2738912500 [1657014818.210711][6132:6137] CHIP:TOO: device list: 2 entries [1657014818.210759][6132:6137] CHIP:TOO: [1]: { - [1657014818.210795][6132:6137] CHIP:TOO: Type: 256 + [1657014818.210795][6132:6137] CHIP:TOO: DeviceType: 256 [1657014818.210821][6132:6137] CHIP:TOO: Revision: 1 [1657014818.210844][6132:6137] CHIP:TOO: } [1657014818.210871][6132:6137] CHIP:TOO: [2]: { - [1657014818.210894][6132:6137] CHIP:TOO: Type: 19 + [1657014818.210894][6132:6137] CHIP:TOO: DeviceType: 19 [1657014818.210917][6132:6137] CHIP:TOO: Revision: 1 [1657014818.210939][6132:6137] CHIP:TOO: } @@ -1583,7 +1633,7 @@ tests: [1666781135.580037][154035:154040] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1939805432 [1666781135.580104][154035:154040] CHIP:TOO: DeviceTypeList: 1 entries [1666781135.580139][154035:154040] CHIP:TOO: [1]: { - [1666781135.580161][154035:154040] CHIP:TOO: Type: 14 + [1666781135.580161][154035:154040] CHIP:TOO: DeviceType: 14 [1666781135.580183][154035:154040] CHIP:TOO: Revision: 1 [1666781135.580202][154035:154040] CHIP:TOO: } @@ -1596,11 +1646,11 @@ tests: [[1666781249.506822][154135:154140] CHIP:TOO: Endpoint: 4 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3384622383 [1666781249.506936][154135:154140] CHIP:TOO: DeviceTypeList: 2 entries [1666781249.507000][154135:154140] CHIP:TOO: [1]: { - [1666781249.507053][154135:154140] CHIP:TOO: Type: 770 + [1666781249.507053][154135:154140] CHIP:TOO: DeviceType: 770 [1666781249.507081][154135:154140] CHIP:TOO: Revision: 1 [1666781249.507106][154135:154140] CHIP:TOO: } [1666781249.507139][154135:154140] CHIP:TOO: [2]: { - [1666781249.507159][154135:154140] CHIP:TOO: Type: 19 + [1666781249.507159][154135:154140] CHIP:TOO: DeviceType: 19 [1666781249.507181][154135:154140] CHIP:TOO: Revision: 1 [1666781249.507205][154135:154140] CHIP:TOO: } @@ -1612,11 +1662,11 @@ tests: [1666781295.814357][154186:154191] CHIP:TOO: Endpoint: 5 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1586047503 [1666781295.814477][154186:154191] CHIP:TOO: DeviceTypeList: 2 entries [1666781295.814517][154186:154191] CHIP:TOO: [1]: { - [1666781295.814573][154186:154191] CHIP:TOO: Type: 770 + [1666781295.814573][154186:154191] CHIP:TOO: DeviceType: 770 [1666781295.814597][154186:154191] CHIP:TOO: Revision: 1 [1666781295.814612][154186:154191] CHIP:TOO: } [1666781295.814636][154186:154191] CHIP:TOO: [2]: { - [1666781295.814656][154186:154191] CHIP:TOO: Type: 19 + [1666781295.814656][154186:154191] CHIP:TOO: DeviceType: 19 [1666781295.814670][154186:154191] CHIP:TOO: Revision: 1 [1666781295.814687][154186:154191] CHIP:TOO: } @@ -1625,11 +1675,55 @@ tests: Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 6. [1666781352.226403][154237:154242] CHIP:TOO: Endpoint: 6 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3245051896 - [1666781352.226485][154237:154242] CHIP:TOO: DeviceTypeList: 1 entries - [1666781352.226823][154237:154242] CHIP:TOO: [1]: { - [1666781352.226862][154237:154242] CHIP:TOO: Type: 19 - [1666781352.226898][154237:154242] CHIP:TOO: Revision: 1 - [1666781352.226934][154237:154242] CHIP:TOO: } + [1692177069.905827][8447:8449] CHIP:TOO: DeviceTypeList: 2 entries + [1692177069.905932][8447:8449] CHIP:TOO: [1]: { + [1692177069.905990][8447:8449] CHIP:TOO: DeviceType: 19 + [1692177069.906046][8447:8449] CHIP:TOO: Revision: 1 + [1692177069.906098][8447:8449] CHIP:TOO: } + [1692177069.906163][8447:8449] CHIP:TOO: [2]: { + [1692177069.906217][8447:8449] CHIP:TOO: DeviceType: 17 + [1692177069.906269][8447:8449] CHIP:TOO: Revision: 1 + [1692177069.906320][8447:8449] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 7 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 7. + + [1666246718.470591][45821:45826] CHIP:TOO: Endpoint: 7 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3285189124 + [1666246718.470649][45821:45826] CHIP:TOO: DeviceTypeList: 1 entries + [1666246718.470678][45821:45826] CHIP:TOO: [1]: { + [1666246718.470697][45821:45826] CHIP:TOO: DeviceType: 770 + [1666246718.470715][45821:45826] CHIP:TOO: Revision: 1 + [1666246718.470733][45821:45826] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 8 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 8. + + [1666246775.067195][45834:45839] CHIP:TOO: Endpoint: 8 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3210151050 + [1666246775.067256][45834:45839] CHIP:TOO: DeviceTypeList: 1 entries + [1666246775.067297][45834:45839] CHIP:TOO: [1]: { + [1666246775.067324][45834:45839] CHIP:TOO: DeviceType: 770 + [1666246775.067350][45834:45839] CHIP:TOO: Revision: 1 + [1666246775.067375][45834:45839] CHIP:TOO: } + + + ./chip-tool descriptor read device-type-list 1 9 + + Via the TH (chip-tool), Verify the DeviceTypeList entries with endpoint 9. + + [1692170786.513524][8042:8044] CHIP:TOO: Endpoint: 9 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 133253296 + [1692170786.513603][8042:8044] CHIP:TOO: DeviceTypeList: 2 entries + [1692170786.513654][8042:8044] CHIP:TOO: [1]: { + [1692170786.513681][8042:8044] CHIP:TOO: DeviceType: 256 + [1692170786.513706][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513730][8042:8044] CHIP:TOO: } + [1692170786.513759][8042:8044] CHIP:TOO: [2]: { + [1692170786.513785][8042:8044] CHIP:TOO: DeviceType: 19 + [1692170786.513809][8042:8044] CHIP:TOO: Revision: 1 + [1692170786.513833][8042:8044] CHIP:TOO: } ./chip-tool descriptor read device-type-list 1 10 @@ -1639,11 +1733,11 @@ tests: [1666781396.648375][154274:154279] CHIP:TOO: Endpoint: 10 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1293946708 [1666781396.648475][154274:154279] CHIP:TOO: DeviceTypeList: 2 entries [1666781396.648540][154274:154279] CHIP:TOO: [1]: { - [1666781396.648593][154274:154279] CHIP:TOO: Type: 256 + [1666781396.648593][154274:154279] CHIP:TOO: DeviceType: 256 [1666781396.648624][154274:154279] CHIP:TOO: Revision: 1 [1666781396.648649][154274:154279] CHIP:TOO: } [1666781396.648686][154274:154279] CHIP:TOO: [2]: { - [1666781396.648715][154274:154279] CHIP:TOO: Type: 19 + [1666781396.648715][154274:154279] CHIP:TOO: DeviceType: 19 [1666781396.648742][154274:154279] CHIP:TOO: Revision: 1 [1666781396.648764][154274:154279] CHIP:TOO: } @@ -1655,11 +1749,11 @@ tests: [1666781437.491909][154304:154309] CHIP:TOO: Endpoint: 11 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 731418355 [1666781437.492152][154304:154309] CHIP:TOO: DeviceTypeList: 2 entries [1666781437.492274][154304:154309] CHIP:TOO: [1]: { - [1666781437.492303][154304:154309] CHIP:TOO: Type: 256 + [1666781437.492303][154304:154309] CHIP:TOO: DeviceType: 256 [1666781437.492388][154304:154309] CHIP:TOO: Revision: 1 [1666781437.492417][154304:154309] CHIP:TOO: } [1666781437.492567][154304:154309] CHIP:TOO: [2]: { - [1666781437.492599][154304:154309] CHIP:TOO: Type: 19 + [1666781437.492599][154304:154309] CHIP:TOO: DeviceType: 19 [1666781437.492682][154304:154309] CHIP:TOO: Revision: 1 [1666781437.492764][154304:154309] CHIP:TOO: } @@ -1671,11 +1765,11 @@ tests: [1666781478.247115][154348:154353] CHIP:TOO: Endpoint: 12 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4056704360 [1666781478.247242][154348:154353] CHIP:TOO: DeviceTypeList: 2 entries [1666781478.247280][154348:154353] CHIP:TOO: [1]: { - [1666781478.247303][154348:154353] CHIP:TOO: Type: 256 + [1666781478.247303][154348:154353] CHIP:TOO: DeviceType: 256 [1666781478.247326][154348:154353] CHIP:TOO: Revision: 1 [1666781478.247347][154348:154353] CHIP:TOO: } [1666781478.247376][154348:154353] CHIP:TOO: [2]: { - [1666781478.247400][154348:154353] CHIP:TOO: Type: 19 + [1666781478.247400][154348:154353] CHIP:TOO: DeviceType: 19 [1666781478.247422][154348:154353] CHIP:TOO: Revision: 1 [1666781478.247444][154348:154353] CHIP:TOO: } @@ -1686,28 +1780,11 @@ tests: [1666781551.887253][154449:154454] CHIP:TOO: Endpoint: 13 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 3945074678 [1666781551.887323][154449:154454] CHIP:TOO: DeviceTypeList: 2 entries [1666781551.887384][154449:154454] CHIP:TOO: [1]: { - [1666781551.887437][154449:154454] CHIP:TOO: Type: 256 + [1666781551.887437][154449:154454] CHIP:TOO: DeviceType: 256 [1666781551.887475][154449:154454] CHIP:TOO: Revision: 1 [1666781551.887493][154449:154454] CHIP:TOO: } [1666781551.887521][154449:154454] CHIP:TOO: [2]: { - [1666781551.887538][154449:154454] CHIP:TOO: Type: 19 + [1666781551.887538][154449:154454] CHIP:TOO: DeviceType: 19 [1666781551.887553][154449:154454] CHIP:TOO: Revision: 1 [1666781551.887570][154449:154454] CHIP:TOO: } - - - - ./chip-tool descriptor read device-type-list 1 14 - - Via the TH (chip-tool), Verify the DeviceTypeList attribute entries with endpoint 14. - - [1666781570.445039][154457:154462] CHIP:TOO: Endpoint: 14 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1672133809 - [1666781570.445138][154457:154462] CHIP:TOO: DeviceTypeList: 2 entries - [1666781570.445179][154457:154462] CHIP:TOO: [1]: { - [1666781570.445200][154457:154462] CHIP:TOO: Type: 256 - [1666781570.445220][154457:154462] CHIP:TOO: Revision: 1 - [1666781570.445240][154457:154462] CHIP:TOO: } - [1666781570.445273][154457:154462] CHIP:TOO: [2]: { - [1666781570.445298][154457:154462] CHIP:TOO: Type: 19 - [1666781570.445324][154457:154462] CHIP:TOO: Revision: 1 - [1666781570.445346][154457:154462] CHIP:TOO: } disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_BR_4.yaml b/src/app/tests/suites/certification/Test_TC_BR_4.yaml index 167d8966c58c3f..15d01deed0434d 100644 --- a/src/app/tests/suites/certification/Test_TC_BR_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_BR_4.yaml @@ -44,6113 +44,5353 @@ tests: ./chip-tool descriptor read device-type-list 1 1 - Verify the DeviceTypeList attribute response with endpoint 1 On TH(bridge-app) Log: - - [1666960977.561385][218195:218195] CHIP:IM: Received Read request - [1666960977.561428][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666960977.561438][218195:218195] CHIP:DMG: { - [1666960977.561447][218195:218195] CHIP:DMG: AttributePathIBs = - [1666960977.561459][218195:218195] CHIP:DMG: [ - [1666960977.561468][218195:218195] CHIP:DMG: AttributePathIB = - [1666960977.561480][218195:218195] CHIP:DMG: { - [1666960977.561491][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666960977.561502][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666960977.561513][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666960977.561523][218195:218195] CHIP:DMG: } - [1666960977.561536][218195:218195] CHIP:DMG: - [1666960977.561545][218195:218195] CHIP:DMG: ], - [1666960977.561558][218195:218195] CHIP:DMG: - [1666960977.561569][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666960977.561579][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666960977.561589][218195:218195] CHIP:DMG: }, - [1666960977.561628][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666960977.561663][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666960977.561674][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666960977.561684][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0000 (expanded=0) - [1666960977.561699][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v - [1666960977.561715][218195:218195] CHIP:DMG: AccessControl: allowed - [1666960977.561742][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... - [1666960977.561915][218195:218195] CHIP:EM: <<< [E:19859r M:66858920 (Ack:246619441)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666960977.561936][218195:218195] CHIP:IN: (S) Sending msg 66858920 on secure session with LSID: 51698 - [1666960977.562174][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:50021 | 66858920 | [Interaction Model (1) / Report Data (0x05) / Session = 21485 / Exchange = 19859] - [1666960977.562195][218195:218195] CHIP:DMG: Header Flags = - [1666960977.562203][218195:218195] CHIP:DMG: { - [1666960977.562224][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666960977.562233][218195:218195] CHIP:DMG: { - [1666960977.571149][218195:218195] CHIP:DMG: AckMsg = 246619441 - [1666960977.571171][218195:218195] CHIP:DMG: NeedsAck = true - [1666960977.571182][218195:218195] CHIP:DMG: } - [1666960977.571201][218195:218195] CHIP:DMG: } - [1666960977.571210][218195:218195] CHIP:DMG: - [1666960977.571227][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = - [1666960977.571236][218195:218195] CHIP:DMG: { - [1666960977.571246][218195:218195] CHIP:DMG: data = 00ed5300a82ffc0337a52e258f659192777c3fadf81100acb86097c2bea918d8e138754797c4ae4527571aa330996cef214c3db379588b2e869e461467568c1778cefd252b3962d5e5af522edf6a23860e1a3d443093f8d6345dd2244d69fa3b5e3720f1b7321a1f - [1666960977.571257][218195:218195] CHIP:DMG: buffer_ptr = 94136416758448 - [1666960977.571266][218195:218195] CHIP:DMG: } - [1666960977.571274][218195:218195] CHIP:DMG: - [1666960977.571290][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = - [1666960977.571299][218195:218195] CHIP:DMG: { - [1666960977.571308][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404001836021818181535012600189f3e59370124020124031d240400340518350224000e24010118181818290424ff0118 - [1666960977.571317][218195:218195] CHIP:DMG: } - [1666960977.571325][218195:218195] CHIP:DMG: - [1666960977.571382][218195:218195] CHIP:DMG: ReportDataMessage = - [1666960977.571398][218195:218195] CHIP:DMG: { - [1666960977.571406][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666960977.571420][218195:218195] CHIP:DMG: [ - [1666960977.571427][218195:218195] CHIP:DMG: AttributeReportIB = - [1666960977.571440][218195:218195] CHIP:DMG: { - [1666960977.571455][218195:218195] CHIP:DMG: AttributeDataIB = - [1666960977.571470][218195:218195] CHIP:DMG: { - [1666960977.571484][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666960977.571495][218195:218195] CHIP:DMG: AttributePathIB = - [1666960977.571505][218195:218195] CHIP:DMG: { - [1666960977.571516][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666960977.571528][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666960977.571542][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666960977.571552][218195:218195] CHIP:DMG: } - [1666960977.571565][218195:218195] CHIP:DMG: - [1666960977.571576][218195:218195] CHIP:DMG: Data = [ - [1666960977.571588][218195:218195] CHIP:DMG: - [1666960977.571599][218195:218195] CHIP:DMG: ], - [1666960977.571608][218195:218195] CHIP:DMG: }, - [1666960977.571622][218195:218195] CHIP:DMG: - [1666960977.571631][218195:218195] CHIP:DMG: }, - [1666960977.571650][218195:218195] CHIP:DMG: - [1666960977.571659][218195:218195] CHIP:DMG: AttributeReportIB = - [1666960977.571674][218195:218195] CHIP:DMG: { - [1666960977.571683][218195:218195] CHIP:DMG: AttributeDataIB = - [1666960977.571693][218195:218195] CHIP:DMG: { - [1666960977.571703][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666960977.571713][218195:218195] CHIP:DMG: AttributePathIB = - [1666960977.571724][218195:218195] CHIP:DMG: { - [1666960977.571735][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666960977.571746][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666960977.571757][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666960977.571767][218195:218195] CHIP:DMG: ListIndex = Null, - [1666960977.571777][218195:218195] CHIP:DMG: } - [1666960977.571789][218195:218195] CHIP:DMG: - [1666960977.571799][218195:218195] CHIP:DMG: Data = - [1666960977.571811][218195:218195] CHIP:DMG: { - [1666960977.571822][218195:218195] CHIP:DMG: 0x0 = 14, - [1666960977.571833][218195:218195] CHIP:DMG: 0x1 = 1, - [1666960977.571845][218195:218195] CHIP:DMG: }, - [1666960977.571855][218195:218195] CHIP:DMG: }, - [1666960977.571868][218195:218195] CHIP:DMG: - [1666960977.571877][218195:218195] CHIP:DMG: }, - [1666960977.571891][218195:218195] CHIP:DMG: - [1666960977.571900][218195:218195] CHIP:DMG: ], - [1666960977.571918][218195:218195] CHIP:DMG: - [1666960977.571929][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666960977.571939][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666960977.571948][218195:218195] CHIP:DMG: } - - ./chip-tool descriptor read device-type-list 1 2 - - Verify the DeviceTypeList attribute response with endpoint 2 On TH(bridge-app) Log: - - [1666961027.989897][218195:218195] CHIP:IM: Received Read request - [1666961027.989925][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961027.989932][218195:218195] CHIP:DMG: { - [1666961027.989938][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961027.989945][218195:218195] CHIP:DMG: [ - [1666961027.989951][218195:218195] CHIP:DMG: AttributePathIB = - [1666961027.989958][218195:218195] CHIP:DMG: { - [1666961027.989965][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666961027.989971][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961027.989978][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961027.989984][218195:218195] CHIP:DMG: } - [1666961027.989991][218195:218195] CHIP:DMG: - [1666961027.989997][218195:218195] CHIP:DMG: ], - [1666961027.990007][218195:218195] CHIP:DMG: - [1666961027.990013][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961027.990019][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961027.990025][218195:218195] CHIP:DMG: }, - [1666961027.990049][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961027.990075][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961027.990084][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961027.990090][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=2 AttributeId=0x0000_0000 (expanded=0) - [1666961027.990105][218195:218195] CHIP:DMG: Sending report (payload has 33 bytes)... - [1666961027.990205][218195:218195] CHIP:EM: <<< [E:25377r M:99613400 (Ack:20435852)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961027.990220][218195:218195] CHIP:IN: (S) Sending msg 99613400 on secure session with LSID: 51699 - [1666961027.990335][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:59337 | 99613400 | [Interaction Model (1) / Report Data (0x05) / Session = 25530 / Exchange = 25377] - [1666961027.990350][218195:218195] CHIP:DMG: Header Flags = - [1666961027.990356][218195:218195] CHIP:DMG: { - [1666961027.990368][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961027.990374][218195:218195] CHIP:DMG: { - [1666961027.990380][218195:218195] CHIP:DMG: AckMsg = 20435852 - [1666961027.990385][218195:218195] CHIP:DMG: NeedsAck = true - [1666961027.990391][218195:218195] CHIP:DMG: } - [1666961027.990400][218195:218195] CHIP:DMG: } - [1666961027.990406][218195:218195] CHIP:DMG: - [1666961027.990414][218195:218195] CHIP:DMG: Encrypted Payload (67 bytes) = - [1666961027.990420][218195:218195] CHIP:DMG: { - [1666961027.990425][218195:218195] CHIP:DMG: data = 00ba6300d8faef05a3171dc2f01fdfeb17482c05dff74f84b12f10b422b3d9f698cfa5e53a094002e2a28de508c04cfa811aaf4bf156fabd7fbf11fadd813d59acb663 - [1666961027.990431][218195:218195] CHIP:DMG: buffer_ptr = 94136416758992 - [1666961027.990437][218195:218195] CHIP:DMG: } - [1666961027.990443][218195:218195] CHIP:DMG: - [1666961027.990452][218195:218195] CHIP:DMG: Decrypted Payload (33 bytes) = - [1666961027.990457][218195:218195] CHIP:DMG: { - [1666961027.990463][218195:218195] CHIP:DMG: data = 153601153500370024020224031d24040018350124007f18181818290424ff0118 - [1666961027.990469][218195:218195] CHIP:DMG: } - [1666961027.990474][218195:218195] CHIP:DMG: - [1666961027.990495][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961027.990502][218195:218195] CHIP:DMG: { - [1666961027.990508][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961027.990517][218195:218195] CHIP:DMG: [ - [1666961027.990523][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961027.990533][218195:218195] CHIP:DMG: { - [1666961027.990540][218195:218195] CHIP:DMG: AttributeStatusIB = - [1666961027.990547][218195:218195] CHIP:DMG: { - [1666961027.990553][218195:218195] CHIP:DMG: AttributePathIB = - [1666961027.990561][218195:218195] CHIP:DMG: { - [1666961027.990568][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666961027.990575][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961027.990583][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961027.990593][218195:218195] CHIP:DMG: } - [1666961027.990603][218195:218195] CHIP:DMG: - [1666961027.990613][218195:218195] CHIP:DMG: StatusIB = - [1666961027.990621][218195:218195] CHIP:DMG: { - [1666961027.990629][218195:218195] CHIP:DMG: status = 0x7f (UNSUPPORTED_ENDPOINT), - [1666961027.990635][218195:218195] CHIP:DMG: }, - [1666961027.990643][218195:218195] CHIP:DMG: - [1666961027.990649][218195:218195] CHIP:DMG: }, - [1666961027.990657][218195:218195] CHIP:DMG: - [1666961027.990663][218195:218195] CHIP:DMG: }, - [1666961027.990672][218195:218195] CHIP:DMG: - [1666961027.990678][218195:218195] CHIP:DMG: ], - [1666961027.990687][218195:218195] CHIP:DMG: - [1666961027.990693][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961027.990700][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961027.990705][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 1 On TH(bridge-app) Log: + + [1666960977.561385][218195:218195] CHIP:IM: Received Read request + [1666960977.561428][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666960977.561438][218195:218195] CHIP:DMG: { + [1666960977.561447][218195:218195] CHIP:DMG: AttributePathIBs = + [1666960977.561459][218195:218195] CHIP:DMG: [ + [1666960977.561468][218195:218195] CHIP:DMG: AttributePathIB = + [1666960977.561480][218195:218195] CHIP:DMG: { + [1666960977.561491][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666960977.561502][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666960977.561513][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666960977.561523][218195:218195] CHIP:DMG: } + [1666960977.561536][218195:218195] CHIP:DMG: + [1666960977.561545][218195:218195] CHIP:DMG: ], + [1666960977.561558][218195:218195] CHIP:DMG: + [1666960977.561569][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666960977.561579][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666960977.561589][218195:218195] CHIP:DMG: }, + [1666960977.561628][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666960977.561663][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666960977.561674][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666960977.561684][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1666960977.561699][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v + [1666960977.561715][218195:218195] CHIP:DMG: AccessControl: allowed + [1666960977.561742][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... + [1666960977.561915][218195:218195] CHIP:EM: <<< [E:19859r M:66858920 (Ack:246619441)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666960977.561936][218195:218195] CHIP:IN: (S) Sending msg 66858920 on secure session with LSID: 51698 + [1666960977.562174][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:50021 | 66858920 | [Interaction Model (1) / Report Data (0x05) / Session = 21485 / Exchange = 19859] + [1666960977.562195][218195:218195] CHIP:DMG: Header Flags = + [1666960977.562203][218195:218195] CHIP:DMG: { + [1666960977.562224][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666960977.562233][218195:218195] CHIP:DMG: { + [1666960977.571149][218195:218195] CHIP:DMG: AckMsg = 246619441 + [1666960977.571171][218195:218195] CHIP:DMG: NeedsAck = true + [1666960977.571182][218195:218195] CHIP:DMG: } + [1666960977.571201][218195:218195] CHIP:DMG: } + [1666960977.571210][218195:218195] CHIP:DMG: + [1666960977.571227][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = + [1666960977.571236][218195:218195] CHIP:DMG: { + [1666960977.571246][218195:218195] CHIP:DMG: data = 00ed5300a82ffc0337a52e258f659192777c3fadf81100acb86097c2bea918d8e138754797c4ae4527571aa330996cef214c3db379588b2e869e461467568c1778cefd252b3962d5e5af522edf6a23860e1a3d443093f8d6345dd2244d69fa3b5e3720f1b7321a1f + [1666960977.571257][218195:218195] CHIP:DMG: buffer_ptr = 94136416758448 + [1666960977.571266][218195:218195] CHIP:DMG: } + [1666960977.571274][218195:218195] CHIP:DMG: + [1666960977.571290][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = + [1666960977.571299][218195:218195] CHIP:DMG: { + [1666960977.571308][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404001836021818181535012600189f3e59370124020124031d240400340518350224000e24010118181818290424ff0118 + [1666960977.571317][218195:218195] CHIP:DMG: } + [1666960977.571325][218195:218195] CHIP:DMG: + [1666960977.571382][218195:218195] CHIP:DMG: ReportDataMessage = + [1666960977.571398][218195:218195] CHIP:DMG: { + [1666960977.571406][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666960977.571420][218195:218195] CHIP:DMG: [ + [1666960977.571427][218195:218195] CHIP:DMG: AttributeReportIB = + [1666960977.571440][218195:218195] CHIP:DMG: { + [1666960977.571455][218195:218195] CHIP:DMG: AttributeDataIB = + [1666960977.571470][218195:218195] CHIP:DMG: { + [1666960977.571484][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666960977.571495][218195:218195] CHIP:DMG: AttributePathIB = + [1666960977.571505][218195:218195] CHIP:DMG: { + [1666960977.571516][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666960977.571528][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666960977.571542][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666960977.571552][218195:218195] CHIP:DMG: } + [1666960977.571565][218195:218195] CHIP:DMG: + [1666960977.571576][218195:218195] CHIP:DMG: Data = [ + [1666960977.571588][218195:218195] CHIP:DMG: + [1666960977.571599][218195:218195] CHIP:DMG: ], + [1666960977.571608][218195:218195] CHIP:DMG: }, + [1666960977.571622][218195:218195] CHIP:DMG: + [1666960977.571631][218195:218195] CHIP:DMG: }, + [1666960977.571650][218195:218195] CHIP:DMG: + [1666960977.571659][218195:218195] CHIP:DMG: AttributeReportIB = + [1666960977.571674][218195:218195] CHIP:DMG: { + [1666960977.571683][218195:218195] CHIP:DMG: AttributeDataIB = + [1666960977.571693][218195:218195] CHIP:DMG: { + [1666960977.571703][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666960977.571713][218195:218195] CHIP:DMG: AttributePathIB = + [1666960977.571724][218195:218195] CHIP:DMG: { + [1666960977.571735][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666960977.571746][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666960977.571757][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666960977.571767][218195:218195] CHIP:DMG: ListIndex = Null, + [1666960977.571777][218195:218195] CHIP:DMG: } + [1666960977.571789][218195:218195] CHIP:DMG: + [1666960977.571799][218195:218195] CHIP:DMG: Data = + [1666960977.571811][218195:218195] CHIP:DMG: { + [1666960977.571822][218195:218195] CHIP:DMG: 0x0 = 14, + [1666960977.571833][218195:218195] CHIP:DMG: 0x1 = 1, + [1666960977.571845][218195:218195] CHIP:DMG: }, + [1666960977.571855][218195:218195] CHIP:DMG: }, + [1666960977.571868][218195:218195] CHIP:DMG: + [1666960977.571877][218195:218195] CHIP:DMG: }, + [1666960977.571891][218195:218195] CHIP:DMG: + [1666960977.571900][218195:218195] CHIP:DMG: ], + [1666960977.571918][218195:218195] CHIP:DMG: + [1666960977.571929][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666960977.571939][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666960977.571948][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 3 - Verify the DeviceTypeList attribute response with endpoint 3 On TH(bridge-app) Log: - - [1666961101.342071][218195:218195] CHIP:IM: Received Read request - [1666961101.342101][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961101.342108][218195:218195] CHIP:DMG: { - [1666961101.342114][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961101.342121][218195:218195] CHIP:DMG: [ - [1666961101.342127][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.342134][218195:218195] CHIP:DMG: { - [1666961101.342142][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.342149][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.342157][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.342163][218195:218195] CHIP:DMG: } - [1666961101.342171][218195:218195] CHIP:DMG: - [1666961101.342177][218195:218195] CHIP:DMG: ], - [1666961101.342185][218195:218195] CHIP:DMG: - [1666961101.342191][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961101.342197][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961101.342203][218195:218195] CHIP:DMG: }, - [1666961101.342228][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961101.342255][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961101.342265][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961101.342271][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0000 (expanded=0) - [1666961101.342282][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v - [1666961101.342293][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961101.342318][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961101.342441][218195:218195] CHIP:EM: <<< [E:3417r M:212393572 (Ack:105083298)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961101.342459][218195:218195] CHIP:IN: (S) Sending msg 212393572 on secure session with LSID: 51700 - [1666961101.342589][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44267 | 212393572 | [Interaction Model (1) / Report Data (0x05) / Session = 11791 / Exchange = 3417] - [1666961101.342604][218195:218195] CHIP:DMG: Header Flags = - [1666961101.342611][218195:218195] CHIP:DMG: { - [1666961101.342622][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961101.342628][218195:218195] CHIP:DMG: { - [1666961101.342634][218195:218195] CHIP:DMG: AckMsg = 105083298 - [1666961101.342641][218195:218195] CHIP:DMG: NeedsAck = true - [1666961101.342648][218195:218195] CHIP:DMG: } - [1666961101.342659][218195:218195] CHIP:DMG: } - [1666961101.342667][218195:218195] CHIP:DMG: - [1666961101.342678][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961101.342684][218195:218195] CHIP:DMG: { - [1666961101.342691][218195:218195] CHIP:DMG: data = 000f2e0064dea80c8cfef495c5759ac96f27191961a9c1afd0a1cab14789f583fb3854a360f8d9271d5559eb5fb212b5b719e7dd276609906f33b528a21c8b2a827a87e3592e0f676065663d9251ac776805d148faa12589f780dd5f1ef0ba4f48487cea1f0b1ec8b9e706830d4f1b1536473018479f5ee5722f7738ecf5e210d08ac0471989aa4649a179 - [1666961101.342700][218195:218195] CHIP:DMG: buffer_ptr = 94136416759072 - [1666961101.342708][218195:218195] CHIP:DMG: } - [1666961101.342714][218195:218195] CHIP:DMG: - [1666961101.342726][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961101.342734][218195:218195] CHIP:DMG: { - [1666961101.342744][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d2404001836021818181535012600378216b4370124020324031d2404003405183502250000012401011818181535012600378216b4370124020324031d240400340518350224001324010118181818290424ff0118 - [1666961101.342752][218195:218195] CHIP:DMG: } - [1666961101.342759][218195:218195] CHIP:DMG: - [1666961101.342810][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961101.342818][218195:218195] CHIP:DMG: { - [1666961101.342824][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961101.342836][218195:218195] CHIP:DMG: [ - [1666961101.342844][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961101.342855][218195:218195] CHIP:DMG: { - [1666961101.342862][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961101.342870][218195:218195] CHIP:DMG: { - [1666961101.342878][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666961101.342888][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.342897][218195:218195] CHIP:DMG: { - [1666961101.342905][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.342914][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.342925][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.342933][218195:218195] CHIP:DMG: } - [1666961101.342943][218195:218195] CHIP:DMG: - [1666961101.342951][218195:218195] CHIP:DMG: Data = [ - [1666961101.342959][218195:218195] CHIP:DMG: - [1666961101.342971][218195:218195] CHIP:DMG: ], - [1666961101.342977][218195:218195] CHIP:DMG: }, - [1666961101.342986][218195:218195] CHIP:DMG: - [1666961101.342991][218195:218195] CHIP:DMG: }, - [1666961101.343005][218195:218195] CHIP:DMG: - [1666961101.343011][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961101.343022][218195:218195] CHIP:DMG: { - [1666961101.343029][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961101.343037][218195:218195] CHIP:DMG: { - [1666961101.343044][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666961101.343051][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.343059][218195:218195] CHIP:DMG: { - [1666961101.343067][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.343075][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.343084][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.343109][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961101.343119][218195:218195] CHIP:DMG: } - [1666961101.343127][218195:218195] CHIP:DMG: - [1666961101.343135][218195:218195] CHIP:DMG: Data = - [1666961101.343143][218195:218195] CHIP:DMG: { - [1666961101.343150][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961101.343162][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961101.343170][218195:218195] CHIP:DMG: }, - [1666961101.343177][218195:218195] CHIP:DMG: }, - [1666961101.343186][218195:218195] CHIP:DMG: - [1666961101.343194][218195:218195] CHIP:DMG: }, - [1666961101.343210][218195:218195] CHIP:DMG: - [1666961101.343216][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961101.343226][218195:218195] CHIP:DMG: { - [1666961101.343231][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961101.343238][218195:218195] CHIP:DMG: { - [1666961101.343244][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666961101.343250][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.343256][218195:218195] CHIP:DMG: { - [1666961101.343263][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.343270][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.343276][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.343283][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961101.343289][218195:218195] CHIP:DMG: } - [1666961101.343297][218195:218195] CHIP:DMG: - [1666961101.343303][218195:218195] CHIP:DMG: Data = - [1666961101.343309][218195:218195] CHIP:DMG: { - [1666961101.343316][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961101.343323][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961101.343330][218195:218195] CHIP:DMG: }, - [1666961101.343335][218195:218195] CHIP:DMG: }, - [1666961101.343344][218195:218195] CHIP:DMG: - [1666961101.343349][218195:218195] CHIP:DMG: }, - [1666961101.343358][218195:218195] CHIP:DMG: - [1666961101.343364][218195:218195] CHIP:DMG: ], - [1666961101.343379][218195:218195] CHIP:DMG: - [1666961101.343385][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961101.343391][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961101.343395][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 3 On TH(bridge-app) Log: + + [1666961101.342071][218195:218195] CHIP:IM: Received Read request + [1666961101.342101][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961101.342108][218195:218195] CHIP:DMG: { + [1666961101.342114][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961101.342121][218195:218195] CHIP:DMG: [ + [1666961101.342127][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.342134][218195:218195] CHIP:DMG: { + [1666961101.342142][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.342149][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.342157][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.342163][218195:218195] CHIP:DMG: } + [1666961101.342171][218195:218195] CHIP:DMG: + [1666961101.342177][218195:218195] CHIP:DMG: ], + [1666961101.342185][218195:218195] CHIP:DMG: + [1666961101.342191][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961101.342197][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961101.342203][218195:218195] CHIP:DMG: }, + [1666961101.342228][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961101.342255][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961101.342265][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961101.342271][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0000 (expanded=0) + [1666961101.342282][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v + [1666961101.342293][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961101.342318][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961101.342441][218195:218195] CHIP:EM: <<< [E:3417r M:212393572 (Ack:105083298)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961101.342459][218195:218195] CHIP:IN: (S) Sending msg 212393572 on secure session with LSID: 51700 + [1666961101.342589][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44267 | 212393572 | [Interaction Model (1) / Report Data (0x05) / Session = 11791 / Exchange = 3417] + [1666961101.342604][218195:218195] CHIP:DMG: Header Flags = + [1666961101.342611][218195:218195] CHIP:DMG: { + [1666961101.342622][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961101.342628][218195:218195] CHIP:DMG: { + [1666961101.342634][218195:218195] CHIP:DMG: AckMsg = 105083298 + [1666961101.342641][218195:218195] CHIP:DMG: NeedsAck = true + [1666961101.342648][218195:218195] CHIP:DMG: } + [1666961101.342659][218195:218195] CHIP:DMG: } + [1666961101.342667][218195:218195] CHIP:DMG: + [1666961101.342678][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961101.342684][218195:218195] CHIP:DMG: { + [1666961101.342691][218195:218195] CHIP:DMG: data = 000f2e0064dea80c8cfef495c5759ac96f27191961a9c1afd0a1cab14789f583fb3854a360f8d9271d5559eb5fb212b5b719e7dd276609906f33b528a21c8b2a827a87e3592e0f676065663d9251ac776805d148faa12589f780dd5f1ef0ba4f48487cea1f0b1ec8b9e706830d4f1b1536473018479f5ee5722f7738ecf5e210d08ac0471989aa4649a179 + [1666961101.342700][218195:218195] CHIP:DMG: buffer_ptr = 94136416759072 + [1666961101.342708][218195:218195] CHIP:DMG: } + [1666961101.342714][218195:218195] CHIP:DMG: + [1666961101.342726][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961101.342734][218195:218195] CHIP:DMG: { + [1666961101.342744][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d2404001836021818181535012600378216b4370124020324031d2404003405183502250000012401011818181535012600378216b4370124020324031d240400340518350224001324010118181818290424ff0118 + [1666961101.342752][218195:218195] CHIP:DMG: } + [1666961101.342759][218195:218195] CHIP:DMG: + [1666961101.342810][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961101.342818][218195:218195] CHIP:DMG: { + [1666961101.342824][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961101.342836][218195:218195] CHIP:DMG: [ + [1666961101.342844][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961101.342855][218195:218195] CHIP:DMG: { + [1666961101.342862][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961101.342870][218195:218195] CHIP:DMG: { + [1666961101.342878][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666961101.342888][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.342897][218195:218195] CHIP:DMG: { + [1666961101.342905][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.342914][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.342925][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.342933][218195:218195] CHIP:DMG: } + [1666961101.342943][218195:218195] CHIP:DMG: + [1666961101.342951][218195:218195] CHIP:DMG: Data = [ + [1666961101.342959][218195:218195] CHIP:DMG: + [1666961101.342971][218195:218195] CHIP:DMG: ], + [1666961101.342977][218195:218195] CHIP:DMG: }, + [1666961101.342986][218195:218195] CHIP:DMG: + [1666961101.342991][218195:218195] CHIP:DMG: }, + [1666961101.343005][218195:218195] CHIP:DMG: + [1666961101.343011][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961101.343022][218195:218195] CHIP:DMG: { + [1666961101.343029][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961101.343037][218195:218195] CHIP:DMG: { + [1666961101.343044][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666961101.343051][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.343059][218195:218195] CHIP:DMG: { + [1666961101.343067][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.343075][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.343084][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.343109][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961101.343119][218195:218195] CHIP:DMG: } + [1666961101.343127][218195:218195] CHIP:DMG: + [1666961101.343135][218195:218195] CHIP:DMG: Data = + [1666961101.343143][218195:218195] CHIP:DMG: { + [1666961101.343150][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961101.343162][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961101.343170][218195:218195] CHIP:DMG: }, + [1666961101.343177][218195:218195] CHIP:DMG: }, + [1666961101.343186][218195:218195] CHIP:DMG: + [1666961101.343194][218195:218195] CHIP:DMG: }, + [1666961101.343210][218195:218195] CHIP:DMG: + [1666961101.343216][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961101.343226][218195:218195] CHIP:DMG: { + [1666961101.343231][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961101.343238][218195:218195] CHIP:DMG: { + [1666961101.343244][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666961101.343250][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.343256][218195:218195] CHIP:DMG: { + [1666961101.343263][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.343270][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.343276][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.343283][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961101.343289][218195:218195] CHIP:DMG: } + [1666961101.343297][218195:218195] CHIP:DMG: + [1666961101.343303][218195:218195] CHIP:DMG: Data = + [1666961101.343309][218195:218195] CHIP:DMG: { + [1666961101.343316][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961101.343323][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961101.343330][218195:218195] CHIP:DMG: }, + [1666961101.343335][218195:218195] CHIP:DMG: }, + [1666961101.343344][218195:218195] CHIP:DMG: + [1666961101.343349][218195:218195] CHIP:DMG: }, + [1666961101.343358][218195:218195] CHIP:DMG: + [1666961101.343364][218195:218195] CHIP:DMG: ], + [1666961101.343379][218195:218195] CHIP:DMG: + [1666961101.343385][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961101.343391][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961101.343395][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 4 - Verify the DeviceTypeList attribute response with endpoint 4 On TH(bridge-app) Log: - - 1666961162.773915][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961162.773928][218195:218195] CHIP:DMG: { - [1666961162.773939][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961162.773952][218195:218195] CHIP:DMG: [ - [1666961162.773961][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.773973][218195:218195] CHIP:DMG: { - [1666961162.773986][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.773997][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.774008][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.774018][218195:218195] CHIP:DMG: } - [1666961162.774030][218195:218195] CHIP:DMG: - [1666961162.774043][218195:218195] CHIP:DMG: ], - [1666961162.774055][218195:218195] CHIP:DMG: - [1666961162.774066][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961162.774075][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961162.774084][218195:218195] CHIP:DMG: }, - [1666961162.774126][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961162.774176][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961162.774195][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961162.774204][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0000 (expanded=0) - [1666961162.774219][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v - [1666961162.774238][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961162.774277][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961162.774481][218195:218195] CHIP:EM: <<< [E:60120r M:2398263 (Ack:82187971)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961162.774510][218195:218195] CHIP:IN: (S) Sending msg 2398263 on secure session with LSID: 51701 - [1666961162.774763][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:56820 | 2398263 | [Interaction Model (1) / Report Data (0x05) / Session = 49517 / Exchange = 60120] - [1666961162.774791][218195:218195] CHIP:DMG: Header Flags = - [1666961162.774804][218195:218195] CHIP:DMG: { - [1666961162.774826][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961162.774837][218195:218195] CHIP:DMG: { - [1666961162.781902][218195:218195] CHIP:DMG: AckMsg = 82187971 - [1666961162.781929][218195:218195] CHIP:DMG: NeedsAck = true - [1666961162.781944][218195:218195] CHIP:DMG: } - [1666961162.781971][218195:218195] CHIP:DMG: } - [1666961162.781984][218195:218195] CHIP:DMG: - [1666961162.782007][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961162.782020][218195:218195] CHIP:DMG: { - [1666961162.782035][218195:218195] CHIP:DMG: data = 006dc10037982400ac494faea33b4f6e6ff3bea20c93b1b9b7dda5acfd39645a7b9a894ca6185ac94e00f1e59f38049f09c83c9288f15822eccf2438108e9f7592087d73d86b9a9387ef12051e0e613d8f68a37185ac6f8e73fc042d19dbd8714ee61fc1cb3466ae2e059145362db76158d6748fff4a6ff044e7fdad0d952f29867ace2b92e4bac30c4536 - [1666961162.782052][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 - [1666961162.782066][218195:218195] CHIP:DMG: } - [1666961162.782079][218195:218195] CHIP:DMG: - [1666961162.782105][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961162.782119][218195:218195] CHIP:DMG: { - [1666961162.782137][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d2404001836021818181535012600c90e9a3a370124020424031d2404003405183502250002032401011818181535012600c90e9a3a370124020424031d240400340518350224001324010118181818290424ff0118 - [1666961162.782151][218195:218195] CHIP:DMG: } - [1666961162.782159][218195:218195] CHIP:DMG: - [1666961162.782248][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961162.782264][218195:218195] CHIP:DMG: { - [1666961162.782273][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961162.782289][218195:218195] CHIP:DMG: [ - [1666961162.782299][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961162.782316][218195:218195] CHIP:DMG: { - [1666961162.782328][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961162.782343][218195:218195] CHIP:DMG: { - [1666961162.782358][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666961162.782378][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.782395][218195:218195] CHIP:DMG: { - [1666961162.782412][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.782429][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.782446][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.782463][218195:218195] CHIP:DMG: } - [1666961162.782482][218195:218195] CHIP:DMG: - [1666961162.782498][218195:218195] CHIP:DMG: Data = [ - [1666961162.782515][218195:218195] CHIP:DMG: - [1666961162.782533][218195:218195] CHIP:DMG: ], - [1666961162.782551][218195:218195] CHIP:DMG: }, - [1666961162.782572][218195:218195] CHIP:DMG: - [1666961162.782588][218195:218195] CHIP:DMG: }, - [1666961162.782616][218195:218195] CHIP:DMG: - [1666961162.782630][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961162.782654][218195:218195] CHIP:DMG: { - [1666961162.782669][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961162.782689][218195:218195] CHIP:DMG: { - [1666961162.782706][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666961162.782722][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.782741][218195:218195] CHIP:DMG: { - [1666961162.782759][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.782777][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.782795][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.782824][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961162.782838][218195:218195] CHIP:DMG: } - [1666961162.782853][218195:218195] CHIP:DMG: - [1666961162.782865][218195:218195] CHIP:DMG: Data = - [1666961162.782878][218195:218195] CHIP:DMG: { - [1666961162.782892][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961162.782908][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961162.782922][218195:218195] CHIP:DMG: }, - [1666961162.782933][218195:218195] CHIP:DMG: }, - [1666961162.782950][218195:218195] CHIP:DMG: - [1666961162.782961][218195:218195] CHIP:DMG: }, - [1666961162.782993][218195:218195] CHIP:DMG: - [1666961162.783004][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961162.783022][218195:218195] CHIP:DMG: { - [1666961162.783037][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961162.783050][218195:218195] CHIP:DMG: { - [1666961162.783065][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666961162.783077][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.783141][218195:218195] CHIP:DMG: { - [1666961162.783155][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.783167][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.783180][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.783196][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961162.783208][218195:218195] CHIP:DMG: } - [1666961162.783238][218195:218195] CHIP:DMG: - [1666961162.783257][218195:218195] CHIP:DMG: Data = - [1666961162.783274][218195:218195] CHIP:DMG: { - [1666961162.783291][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961162.783308][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961162.783324][218195:218195] CHIP:DMG: }, - [1666961162.783338][218195:218195] CHIP:DMG: }, - [1666961162.783358][218195:218195] CHIP:DMG: - [1666961162.783372][218195:218195] CHIP:DMG: }, - [1666961162.783392][218195:218195] CHIP:DMG: - [1666961162.783407][218195:218195] CHIP:DMG: ], - [1666961162.783435][218195:218195] CHIP:DMG: - [1666961162.783447][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961162.783458][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961162.783468][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 4 On TH(bridge-app) Log: + + 1666961162.773915][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961162.773928][218195:218195] CHIP:DMG: { + [1666961162.773939][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961162.773952][218195:218195] CHIP:DMG: [ + [1666961162.773961][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.773973][218195:218195] CHIP:DMG: { + [1666961162.773986][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.773997][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.774008][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.774018][218195:218195] CHIP:DMG: } + [1666961162.774030][218195:218195] CHIP:DMG: + [1666961162.774043][218195:218195] CHIP:DMG: ], + [1666961162.774055][218195:218195] CHIP:DMG: + [1666961162.774066][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961162.774075][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961162.774084][218195:218195] CHIP:DMG: }, + [1666961162.774126][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961162.774176][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961162.774195][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961162.774204][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0000 (expanded=0) + [1666961162.774219][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v + [1666961162.774238][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961162.774277][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961162.774481][218195:218195] CHIP:EM: <<< [E:60120r M:2398263 (Ack:82187971)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961162.774510][218195:218195] CHIP:IN: (S) Sending msg 2398263 on secure session with LSID: 51701 + [1666961162.774763][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:56820 | 2398263 | [Interaction Model (1) / Report Data (0x05) / Session = 49517 / Exchange = 60120] + [1666961162.774791][218195:218195] CHIP:DMG: Header Flags = + [1666961162.774804][218195:218195] CHIP:DMG: { + [1666961162.774826][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961162.774837][218195:218195] CHIP:DMG: { + [1666961162.781902][218195:218195] CHIP:DMG: AckMsg = 82187971 + [1666961162.781929][218195:218195] CHIP:DMG: NeedsAck = true + [1666961162.781944][218195:218195] CHIP:DMG: } + [1666961162.781971][218195:218195] CHIP:DMG: } + [1666961162.781984][218195:218195] CHIP:DMG: + [1666961162.782007][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961162.782020][218195:218195] CHIP:DMG: { + [1666961162.782035][218195:218195] CHIP:DMG: data = 006dc10037982400ac494faea33b4f6e6ff3bea20c93b1b9b7dda5acfd39645a7b9a894ca6185ac94e00f1e59f38049f09c83c9288f15822eccf2438108e9f7592087d73d86b9a9387ef12051e0e613d8f68a37185ac6f8e73fc042d19dbd8714ee61fc1cb3466ae2e059145362db76158d6748fff4a6ff044e7fdad0d952f29867ace2b92e4bac30c4536 + [1666961162.782052][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 + [1666961162.782066][218195:218195] CHIP:DMG: } + [1666961162.782079][218195:218195] CHIP:DMG: + [1666961162.782105][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961162.782119][218195:218195] CHIP:DMG: { + [1666961162.782137][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d2404001836021818181535012600c90e9a3a370124020424031d2404003405183502250002032401011818181535012600c90e9a3a370124020424031d240400340518350224001324010118181818290424ff0118 + [1666961162.782151][218195:218195] CHIP:DMG: } + [1666961162.782159][218195:218195] CHIP:DMG: + [1666961162.782248][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961162.782264][218195:218195] CHIP:DMG: { + [1666961162.782273][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961162.782289][218195:218195] CHIP:DMG: [ + [1666961162.782299][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961162.782316][218195:218195] CHIP:DMG: { + [1666961162.782328][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961162.782343][218195:218195] CHIP:DMG: { + [1666961162.782358][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666961162.782378][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.782395][218195:218195] CHIP:DMG: { + [1666961162.782412][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.782429][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.782446][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.782463][218195:218195] CHIP:DMG: } + [1666961162.782482][218195:218195] CHIP:DMG: + [1666961162.782498][218195:218195] CHIP:DMG: Data = [ + [1666961162.782515][218195:218195] CHIP:DMG: + [1666961162.782533][218195:218195] CHIP:DMG: ], + [1666961162.782551][218195:218195] CHIP:DMG: }, + [1666961162.782572][218195:218195] CHIP:DMG: + [1666961162.782588][218195:218195] CHIP:DMG: }, + [1666961162.782616][218195:218195] CHIP:DMG: + [1666961162.782630][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961162.782654][218195:218195] CHIP:DMG: { + [1666961162.782669][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961162.782689][218195:218195] CHIP:DMG: { + [1666961162.782706][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666961162.782722][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.782741][218195:218195] CHIP:DMG: { + [1666961162.782759][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.782777][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.782795][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.782824][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961162.782838][218195:218195] CHIP:DMG: } + [1666961162.782853][218195:218195] CHIP:DMG: + [1666961162.782865][218195:218195] CHIP:DMG: Data = + [1666961162.782878][218195:218195] CHIP:DMG: { + [1666961162.782892][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961162.782908][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961162.782922][218195:218195] CHIP:DMG: }, + [1666961162.782933][218195:218195] CHIP:DMG: }, + [1666961162.782950][218195:218195] CHIP:DMG: + [1666961162.782961][218195:218195] CHIP:DMG: }, + [1666961162.782993][218195:218195] CHIP:DMG: + [1666961162.783004][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961162.783022][218195:218195] CHIP:DMG: { + [1666961162.783037][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961162.783050][218195:218195] CHIP:DMG: { + [1666961162.783065][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666961162.783077][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.783141][218195:218195] CHIP:DMG: { + [1666961162.783155][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.783167][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.783180][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.783196][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961162.783208][218195:218195] CHIP:DMG: } + [1666961162.783238][218195:218195] CHIP:DMG: + [1666961162.783257][218195:218195] CHIP:DMG: Data = + [1666961162.783274][218195:218195] CHIP:DMG: { + [1666961162.783291][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961162.783308][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961162.783324][218195:218195] CHIP:DMG: }, + [1666961162.783338][218195:218195] CHIP:DMG: }, + [1666961162.783358][218195:218195] CHIP:DMG: + [1666961162.783372][218195:218195] CHIP:DMG: }, + [1666961162.783392][218195:218195] CHIP:DMG: + [1666961162.783407][218195:218195] CHIP:DMG: ], + [1666961162.783435][218195:218195] CHIP:DMG: + [1666961162.783447][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961162.783458][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961162.783468][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 5 - Verify the DeviceTypeList attribute response with endpoint 5 On TH(bridge-app) Log: - - [1666961235.484701][218195:218195] CHIP:IM: Received Read request - [1666961235.484743][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961235.484753][218195:218195] CHIP:DMG: { - [1666961235.484761][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961235.484771][218195:218195] CHIP:DMG: [ - [1666961235.484779][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.484789][218195:218195] CHIP:DMG: { - [1666961235.484799][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.484810][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.484821][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.484830][218195:218195] CHIP:DMG: } - [1666961235.484841][218195:218195] CHIP:DMG: - [1666961235.484850][218195:218195] CHIP:DMG: ], - [1666961235.484861][218195:218195] CHIP:DMG: - [1666961235.484871][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961235.484880][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961235.484888][218195:218195] CHIP:DMG: }, - [1666961235.484925][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961235.484960][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961235.484972][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961235.484980][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0000 (expanded=0) - [1666961235.484992][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v - [1666961235.485007][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961235.485037][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961235.485186][218195:218195] CHIP:EM: <<< [E:50203r M:208940516 (Ack:32767592)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961235.485206][218195:218195] CHIP:IN: (S) Sending msg 208940516 on secure session with LSID: 51702 - [1666961235.485386][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43440 | 208940516 | [Interaction Model (1) / Report Data (0x05) / Session = 6556 / Exchange = 50203] - [1666961235.485405][218195:218195] CHIP:DMG: Header Flags = - [1666961235.485413][218195:218195] CHIP:DMG: { - [1666961235.485431][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961235.485439][218195:218195] CHIP:DMG: { - [1666961235.485449][218195:218195] CHIP:DMG: AckMsg = 32767592 - [1666961235.485457][218195:218195] CHIP:DMG: NeedsAck = true - [1666961235.485465][218195:218195] CHIP:DMG: } - [1666961235.485478][218195:218195] CHIP:DMG: } - [1666961235.485486][218195:218195] CHIP:DMG: - [1666961235.485498][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961235.485506][218195:218195] CHIP:DMG: { - [1666961235.485514][218195:218195] CHIP:DMG: data = 009c1900e42d740c5e046660bfb2ae8cc6e84b9c4e5700d100371ff13de7dac8d901ed191ec2e3ff333574e183ca5b915f2e3241b193db787a57de9a6c389514ab3f309b97254a5298bd6845c465ebceb9190538155101797132a13763688b7c375deeb09647eb0bfdec374315c43a3272f4e2eb0bc79b661cd513823e973904316cbf54e63ac9385227a7 - [1666961235.490016][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 - [1666961235.490039][218195:218195] CHIP:DMG: } - [1666961235.490050][218195:218195] CHIP:DMG: - [1666961235.490079][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961235.490089][218195:218195] CHIP:DMG: { - [1666961235.490098][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d2404001836021818181535012600dc5a8687370124020524031d2404003405183502250002032401011818181535012600dc5a8687370124020524031d240400340518350224001324010118181818290424ff0118 - [1666961235.490109][218195:218195] CHIP:DMG: } - [1666961235.490118][218195:218195] CHIP:DMG: - [1666961235.490196][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961235.490209][218195:218195] CHIP:DMG: { - [1666961235.490218][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961235.490235][218195:218195] CHIP:DMG: [ - [1666961235.490246][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961235.490264][218195:218195] CHIP:DMG: { - [1666961235.490276][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961235.490290][218195:218195] CHIP:DMG: { - [1666961235.490304][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666961235.490317][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.490331][218195:218195] CHIP:DMG: { - [1666961235.490345][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.490360][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.490375][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.490387][218195:218195] CHIP:DMG: } - [1666961235.490402][218195:218195] CHIP:DMG: - [1666961235.490414][218195:218195] CHIP:DMG: Data = [ - [1666961235.490425][218195:218195] CHIP:DMG: - [1666961235.490438][218195:218195] CHIP:DMG: ], - [1666961235.490449][218195:218195] CHIP:DMG: }, - [1666961235.490463][218195:218195] CHIP:DMG: - [1666961235.490473][218195:218195] CHIP:DMG: }, - [1666961235.490491][218195:218195] CHIP:DMG: - [1666961235.490501][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961235.490517][218195:218195] CHIP:DMG: { - [1666961235.490527][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961235.490539][218195:218195] CHIP:DMG: { - [1666961235.490551][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666961235.490562][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.490575][218195:218195] CHIP:DMG: { - [1666961235.490587][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.490600][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.490613][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.490625][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961235.490635][218195:218195] CHIP:DMG: } - [1666961235.490652][218195:218195] CHIP:DMG: - [1666961235.490660][218195:218195] CHIP:DMG: Data = - [1666961235.490670][218195:218195] CHIP:DMG: { - [1666961235.490686][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961235.490698][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961235.490709][218195:218195] CHIP:DMG: }, - [1666961235.490723][218195:218195] CHIP:DMG: }, - [1666961235.490742][218195:218195] CHIP:DMG: - [1666961235.490753][218195:218195] CHIP:DMG: }, - [1666961235.490778][218195:218195] CHIP:DMG: - [1666961235.490787][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961235.490805][218195:218195] CHIP:DMG: { - [1666961235.490814][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961235.490825][218195:218195] CHIP:DMG: { - [1666961235.490837][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666961235.490847][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.490860][218195:218195] CHIP:DMG: { - [1666961235.490871][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.490884][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.490897][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.490911][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961235.490923][218195:218195] CHIP:DMG: } - [1666961235.490937][218195:218195] CHIP:DMG: - [1666961235.490947][218195:218195] CHIP:DMG: Data = - [1666961235.490958][218195:218195] CHIP:DMG: { - [1666961235.490972][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961235.490986][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961235.490999][218195:218195] CHIP:DMG: }, - [1666961235.491010][218195:218195] CHIP:DMG: }, - [1666961235.491025][218195:218195] CHIP:DMG: - [1666961235.491035][218195:218195] CHIP:DMG: }, - [1666961235.491051][218195:218195] CHIP:DMG: - [1666961235.491060][218195:218195] CHIP:DMG: ], - [1666961235.491085][218195:218195] CHIP:DMG: - [1666961235.491115][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961235.491126][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961235.491135][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 5 On TH(bridge-app) Log: + + [1666961235.484701][218195:218195] CHIP:IM: Received Read request + [1666961235.484743][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961235.484753][218195:218195] CHIP:DMG: { + [1666961235.484761][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961235.484771][218195:218195] CHIP:DMG: [ + [1666961235.484779][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.484789][218195:218195] CHIP:DMG: { + [1666961235.484799][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.484810][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.484821][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.484830][218195:218195] CHIP:DMG: } + [1666961235.484841][218195:218195] CHIP:DMG: + [1666961235.484850][218195:218195] CHIP:DMG: ], + [1666961235.484861][218195:218195] CHIP:DMG: + [1666961235.484871][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961235.484880][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961235.484888][218195:218195] CHIP:DMG: }, + [1666961235.484925][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961235.484960][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961235.484972][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961235.484980][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0000 (expanded=0) + [1666961235.484992][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v + [1666961235.485007][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961235.485037][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961235.485186][218195:218195] CHIP:EM: <<< [E:50203r M:208940516 (Ack:32767592)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961235.485206][218195:218195] CHIP:IN: (S) Sending msg 208940516 on secure session with LSID: 51702 + [1666961235.485386][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43440 | 208940516 | [Interaction Model (1) / Report Data (0x05) / Session = 6556 / Exchange = 50203] + [1666961235.485405][218195:218195] CHIP:DMG: Header Flags = + [1666961235.485413][218195:218195] CHIP:DMG: { + [1666961235.485431][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961235.485439][218195:218195] CHIP:DMG: { + [1666961235.485449][218195:218195] CHIP:DMG: AckMsg = 32767592 + [1666961235.485457][218195:218195] CHIP:DMG: NeedsAck = true + [1666961235.485465][218195:218195] CHIP:DMG: } + [1666961235.485478][218195:218195] CHIP:DMG: } + [1666961235.485486][218195:218195] CHIP:DMG: + [1666961235.485498][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961235.485506][218195:218195] CHIP:DMG: { + [1666961235.485514][218195:218195] CHIP:DMG: data = 009c1900e42d740c5e046660bfb2ae8cc6e84b9c4e5700d100371ff13de7dac8d901ed191ec2e3ff333574e183ca5b915f2e3241b193db787a57de9a6c389514ab3f309b97254a5298bd6845c465ebceb9190538155101797132a13763688b7c375deeb09647eb0bfdec374315c43a3272f4e2eb0bc79b661cd513823e973904316cbf54e63ac9385227a7 + [1666961235.490016][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 + [1666961235.490039][218195:218195] CHIP:DMG: } + [1666961235.490050][218195:218195] CHIP:DMG: + [1666961235.490079][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961235.490089][218195:218195] CHIP:DMG: { + [1666961235.490098][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d2404001836021818181535012600dc5a8687370124020524031d2404003405183502250002032401011818181535012600dc5a8687370124020524031d240400340518350224001324010118181818290424ff0118 + [1666961235.490109][218195:218195] CHIP:DMG: } + [1666961235.490118][218195:218195] CHIP:DMG: + [1666961235.490196][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961235.490209][218195:218195] CHIP:DMG: { + [1666961235.490218][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961235.490235][218195:218195] CHIP:DMG: [ + [1666961235.490246][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961235.490264][218195:218195] CHIP:DMG: { + [1666961235.490276][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961235.490290][218195:218195] CHIP:DMG: { + [1666961235.490304][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666961235.490317][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.490331][218195:218195] CHIP:DMG: { + [1666961235.490345][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.490360][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.490375][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.490387][218195:218195] CHIP:DMG: } + [1666961235.490402][218195:218195] CHIP:DMG: + [1666961235.490414][218195:218195] CHIP:DMG: Data = [ + [1666961235.490425][218195:218195] CHIP:DMG: + [1666961235.490438][218195:218195] CHIP:DMG: ], + [1666961235.490449][218195:218195] CHIP:DMG: }, + [1666961235.490463][218195:218195] CHIP:DMG: + [1666961235.490473][218195:218195] CHIP:DMG: }, + [1666961235.490491][218195:218195] CHIP:DMG: + [1666961235.490501][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961235.490517][218195:218195] CHIP:DMG: { + [1666961235.490527][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961235.490539][218195:218195] CHIP:DMG: { + [1666961235.490551][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666961235.490562][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.490575][218195:218195] CHIP:DMG: { + [1666961235.490587][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.490600][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.490613][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.490625][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961235.490635][218195:218195] CHIP:DMG: } + [1666961235.490652][218195:218195] CHIP:DMG: + [1666961235.490660][218195:218195] CHIP:DMG: Data = + [1666961235.490670][218195:218195] CHIP:DMG: { + [1666961235.490686][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961235.490698][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961235.490709][218195:218195] CHIP:DMG: }, + [1666961235.490723][218195:218195] CHIP:DMG: }, + [1666961235.490742][218195:218195] CHIP:DMG: + [1666961235.490753][218195:218195] CHIP:DMG: }, + [1666961235.490778][218195:218195] CHIP:DMG: + [1666961235.490787][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961235.490805][218195:218195] CHIP:DMG: { + [1666961235.490814][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961235.490825][218195:218195] CHIP:DMG: { + [1666961235.490837][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666961235.490847][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.490860][218195:218195] CHIP:DMG: { + [1666961235.490871][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.490884][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.490897][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.490911][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961235.490923][218195:218195] CHIP:DMG: } + [1666961235.490937][218195:218195] CHIP:DMG: + [1666961235.490947][218195:218195] CHIP:DMG: Data = + [1666961235.490958][218195:218195] CHIP:DMG: { + [1666961235.490972][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961235.490986][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961235.490999][218195:218195] CHIP:DMG: }, + [1666961235.491010][218195:218195] CHIP:DMG: }, + [1666961235.491025][218195:218195] CHIP:DMG: + [1666961235.491035][218195:218195] CHIP:DMG: }, + [1666961235.491051][218195:218195] CHIP:DMG: + [1666961235.491060][218195:218195] CHIP:DMG: ], + [1666961235.491085][218195:218195] CHIP:DMG: + [1666961235.491115][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961235.491126][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961235.491135][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 6 - Verify the DeviceTypeList attribute response with endpoint 6 On TH(bridge-app) Log: - - [1666961312.435864][218195:218195] CHIP:IM: Received Read request - [1666961312.435907][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961312.435918][218195:218195] CHIP:DMG: { - [1666961312.435927][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961312.435938][218195:218195] CHIP:DMG: [ - [1666961312.435947][218195:218195] CHIP:DMG: AttributePathIB = - [1666961312.435958][218195:218195] CHIP:DMG: { - [1666961312.435969][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666961312.435983][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961312.435998][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961312.436008][218195:218195] CHIP:DMG: } - [1666961312.436019][218195:218195] CHIP:DMG: - [1666961312.436029][218195:218195] CHIP:DMG: ], - [1666961312.436041][218195:218195] CHIP:DMG: - [1666961312.436052][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961312.436062][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961312.436071][218195:218195] CHIP:DMG: }, - [1666961312.436111][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961312.436152][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961312.436165][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961312.436174][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0000 (expanded=0) - [1666961312.436188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v - [1666961312.436204][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961312.436233][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... - [1666961312.436389][218195:218195] CHIP:EM: <<< [E:21104r M:199575968 (Ack:157464888)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961312.436411][218195:218195] CHIP:IN: (S) Sending msg 199575968 on secure session with LSID: 51703 - [1666961312.436607][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:60440 | 199575968 | [Interaction Model (1) / Report Data (0x05) / Session = 65356 / Exchange = 21104] - [1666961312.436628][218195:218195] CHIP:DMG: Header Flags = - [1666961312.436638][218195:218195] CHIP:DMG: { - [1666961312.436657][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961312.436666][218195:218195] CHIP:DMG: { - [1666961312.436677][218195:218195] CHIP:DMG: AckMsg = 157464888 - [1666961312.436687][218195:218195] CHIP:DMG: NeedsAck = true - [1666961312.436695][218195:218195] CHIP:DMG: } - [1666961312.436710][218195:218195] CHIP:DMG: } - [1666961312.436719][218195:218195] CHIP:DMG: - [1666961312.436731][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = - [1666961312.436740][218195:218195] CHIP:DMG: { - [1666961312.436749][218195:218195] CHIP:DMG: data = 004cff00a049e50b5628dde1918c40ddd26bcbb621153a2f2a5254bad23c4e0606fa54788058e5f767dbc67763050b23b5b037187c8de160cf358241dd94bf6beb79ac8e16c9c7b6d0e6e513dd72803539c67b4440eaf1a4fb52e29c19f6c3a1fd5c6459219d6efa - [1666961312.442311][218195:218195] CHIP:DMG: buffer_ptr = 94136416759440 - [1666961312.442329][218195:218195] CHIP:DMG: } - [1666961312.442339][218195:218195] CHIP:DMG: - [1666961312.442372][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = - [1666961312.442384][218195:218195] CHIP:DMG: { - [1666961312.442395][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040018360218181815350126004d2fac6c370124020624031d240400340518350224001324010118181818290424ff0118 - [1666961312.442405][218195:218195] CHIP:DMG: } - [1666961312.442415][218195:218195] CHIP:DMG: - [1666961312.442479][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961312.442491][218195:218195] CHIP:DMG: { - [1666961312.442501][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961312.442517][218195:218195] CHIP:DMG: [ - [1666961312.442528][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961312.442545][218195:218195] CHIP:DMG: { - [1666961312.442555][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961312.442568][218195:218195] CHIP:DMG: { - [1666961312.442581][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666961312.442605][218195:218195] CHIP:DMG: AttributePathIB = - [1666961312.442629][218195:218195] CHIP:DMG: { - [1666961312.442643][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666961312.442657][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961312.442673][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961312.442687][218195:218195] CHIP:DMG: } - [1666961312.442703][218195:218195] CHIP:DMG: - [1666961312.442717][218195:218195] CHIP:DMG: Data = [ - [1666961312.442731][218195:218195] CHIP:DMG: - [1666961312.442745][218195:218195] CHIP:DMG: ], - [1666961312.442757][218195:218195] CHIP:DMG: }, - [1666961312.442770][218195:218195] CHIP:DMG: - [1666961312.442782][218195:218195] CHIP:DMG: }, - [1666961312.442807][218195:218195] CHIP:DMG: - [1666961312.442819][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961312.442841][218195:218195] CHIP:DMG: { - [1666961312.442851][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961312.442861][218195:218195] CHIP:DMG: { - [1666961312.442870][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666961312.442886][218195:218195] CHIP:DMG: AttributePathIB = - [1666961312.442901][218195:218195] CHIP:DMG: { - [1666961312.442916][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666961312.442931][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961312.442962][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961312.442978][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961312.442998][218195:218195] CHIP:DMG: } - [1666961312.443016][218195:218195] CHIP:DMG: - [1666961312.443033][218195:218195] CHIP:DMG: Data = - [1666961312.443052][218195:218195] CHIP:DMG: { - [1666961312.443069][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961312.443084][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961312.443135][218195:218195] CHIP:DMG: }, - [1666961312.443149][218195:218195] CHIP:DMG: }, - [1666961312.443170][218195:218195] CHIP:DMG: - [1666961312.443183][218195:218195] CHIP:DMG: }, - [1666961312.443203][218195:218195] CHIP:DMG: - [1666961312.443215][218195:218195] CHIP:DMG: ], - [1666961312.443242][218195:218195] CHIP:DMG: - [1666961312.443256][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961312.443270][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961312.443282][218195:218195] CHIP:DMG: } - [1666961312.443295][218195:218195] CHIP:DMG: + Verify the DeviceTypeList attribute response with endpoint 6 On TH(bridge-app) Log: + + [1666961312.435864][218195:218195] CHIP:IM: Received Read request + [1666961312.435907][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961312.435918][218195:218195] CHIP:DMG: { + [1666961312.435927][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961312.435938][218195:218195] CHIP:DMG: [ + [1666961312.435947][218195:218195] CHIP:DMG: AttributePathIB = + [1666961312.435958][218195:218195] CHIP:DMG: { + [1666961312.435969][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666961312.435983][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961312.435998][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961312.436008][218195:218195] CHIP:DMG: } + [1666961312.436019][218195:218195] CHIP:DMG: + [1666961312.436029][218195:218195] CHIP:DMG: ], + [1666961312.436041][218195:218195] CHIP:DMG: + [1666961312.436052][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961312.436062][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961312.436071][218195:218195] CHIP:DMG: }, + [1666961312.436111][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961312.436152][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961312.436165][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961312.436174][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0000 (expanded=0) + [1666961312.436188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v + [1666961312.436204][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961312.436233][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... + [1666961312.436389][218195:218195] CHIP:EM: <<< [E:21104r M:199575968 (Ack:157464888)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961312.436411][218195:218195] CHIP:IN: (S) Sending msg 199575968 on secure session with LSID: 51703 + [1666961312.436607][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:60440 | 199575968 | [Interaction Model (1) / Report Data (0x05) / Session = 65356 / Exchange = 21104] + [1666961312.436628][218195:218195] CHIP:DMG: Header Flags = + [1666961312.436638][218195:218195] CHIP:DMG: { + [1666961312.436657][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961312.436666][218195:218195] CHIP:DMG: { + [1666961312.436677][218195:218195] CHIP:DMG: AckMsg = 157464888 + [1666961312.436687][218195:218195] CHIP:DMG: NeedsAck = true + [1666961312.436695][218195:218195] CHIP:DMG: } + [1666961312.436710][218195:218195] CHIP:DMG: } + [1666961312.436719][218195:218195] CHIP:DMG: + [1666961312.436731][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = + [1666961312.436740][218195:218195] CHIP:DMG: { + [1666961312.436749][218195:218195] CHIP:DMG: data = 004cff00a049e50b5628dde1918c40ddd26bcbb621153a2f2a5254bad23c4e0606fa54788058e5f767dbc67763050b23b5b037187c8de160cf358241dd94bf6beb79ac8e16c9c7b6d0e6e513dd72803539c67b4440eaf1a4fb52e29c19f6c3a1fd5c6459219d6efa + [1666961312.442311][218195:218195] CHIP:DMG: buffer_ptr = 94136416759440 + [1666961312.442329][218195:218195] CHIP:DMG: } + [1666961312.442339][218195:218195] CHIP:DMG: + [1666961312.442372][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = + [1666961312.442384][218195:218195] CHIP:DMG: { + [1666961312.442395][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040018360218181815350126004d2fac6c370124020624031d240400340518350224001324010118181818290424ff0118 + [1666961312.442405][218195:218195] CHIP:DMG: } + [1666961312.442415][218195:218195] CHIP:DMG: + [1666961312.442479][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961312.442491][218195:218195] CHIP:DMG: { + [1666961312.442501][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961312.442517][218195:218195] CHIP:DMG: [ + [1666961312.442528][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961312.442545][218195:218195] CHIP:DMG: { + [1666961312.442555][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961312.442568][218195:218195] CHIP:DMG: { + [1666961312.442581][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666961312.442605][218195:218195] CHIP:DMG: AttributePathIB = + [1666961312.442629][218195:218195] CHIP:DMG: { + [1666961312.442643][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666961312.442657][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961312.442673][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961312.442687][218195:218195] CHIP:DMG: } + [1666961312.442703][218195:218195] CHIP:DMG: + [1666961312.442717][218195:218195] CHIP:DMG: Data = [ + [1666961312.442731][218195:218195] CHIP:DMG: + [1666961312.442745][218195:218195] CHIP:DMG: ], + [1666961312.442757][218195:218195] CHIP:DMG: }, + [1666961312.442770][218195:218195] CHIP:DMG: + [1666961312.442782][218195:218195] CHIP:DMG: }, + [1666961312.442807][218195:218195] CHIP:DMG: + [1666961312.442819][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961312.442841][218195:218195] CHIP:DMG: { + [1666961312.442851][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961312.442861][218195:218195] CHIP:DMG: { + [1666961312.442870][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666961312.442886][218195:218195] CHIP:DMG: AttributePathIB = + [1666961312.442901][218195:218195] CHIP:DMG: { + [1666961312.442916][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666961312.442931][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961312.442962][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961312.442978][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961312.442998][218195:218195] CHIP:DMG: } + [1666961312.443016][218195:218195] CHIP:DMG: + [1666961312.443033][218195:218195] CHIP:DMG: Data = + [1666961312.443052][218195:218195] CHIP:DMG: { + [1666961312.443069][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961312.443084][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961312.443135][218195:218195] CHIP:DMG: }, + [1692177349.514542][8487:8489] CHIP:DMG: { + [1692177349.514622][8487:8489] CHIP:DMG: 0x0 = 17, + [1692177349.514707][8487:8489] CHIP:DMG: 0x1 = 1, + [1692177349.514790][8487:8489] CHIP:DMG: }, + [1666961312.443149][218195:218195] CHIP:DMG: }, + [1666961312.443170][218195:218195] CHIP:DMG: + [1666961312.443183][218195:218195] CHIP:DMG: }, + [1666961312.443203][218195:218195] CHIP:DMG: + [1666961312.443215][218195:218195] CHIP:DMG: ], + [1666961312.443242][218195:218195] CHIP:DMG: + [1666961312.443256][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961312.443270][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961312.443282][218195:218195] CHIP:DMG: } + [1666961312.443295][218195:218195] CHIP:DMG: ./chip-tool descriptor read device-type-list 1 7 - Verify the DeviceTypeList attribute response with endpoint 7 On TH(bridge-app) Log: - - [1666961364.286140][218195:218195] CHIP:IM: Received Read request - [1666961364.286177][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961364.286185][218195:218195] CHIP:DMG: { - [1666961364.286193][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961364.286202][218195:218195] CHIP:DMG: [ - [1666961364.286209][218195:218195] CHIP:DMG: AttributePathIB = - [1666961364.286218][218195:218195] CHIP:DMG: { - [1666961364.286228][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666961364.286237][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961364.286246][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961364.286254][218195:218195] CHIP:DMG: } - [1666961364.286263][218195:218195] CHIP:DMG: - [1666961364.286271][218195:218195] CHIP:DMG: ], - [1666961364.286282][218195:218195] CHIP:DMG: - [1666961364.286291][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961364.286299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961364.286306][218195:218195] CHIP:DMG: }, - [1666961364.286337][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961364.286367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961364.286377][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961364.286385][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0000 (expanded=0) - [1666961364.286397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v - [1666961364.286410][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961364.286435][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... - [1666961364.286561][218195:218195] CHIP:EM: <<< [E:20571r M:215006971 (Ack:132367975)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961364.286578][218195:218195] CHIP:IN: (S) Sending msg 215006971 on secure session with LSID: 51704 - [1666961364.286734][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36519 | 215006971 | [Interaction Model (1) / Report Data (0x05) / Session = 4615 / Exchange = 20571] - [1666961364.286752][218195:218195] CHIP:DMG: Header Flags = - [1666961364.286760][218195:218195] CHIP:DMG: { - [1666961364.286775][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961364.286783][218195:218195] CHIP:DMG: { - [1666961364.293096][218195:218195] CHIP:DMG: AckMsg = 132367975 - [1666961364.293130][218195:218195] CHIP:DMG: NeedsAck = true - [1666961364.293156][218195:218195] CHIP:DMG: } - [1666961364.293190][218195:218195] CHIP:DMG: } - [1666961364.293214][218195:218195] CHIP:DMG: - [1666961364.293248][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = - [1666961364.293273][218195:218195] CHIP:DMG: { - [1666961364.293295][218195:218195] CHIP:DMG: data = 00071200fbbed00c55f10001d54b0896b36ef389b19ccab71aa5a70e1dda15a56c40b699441d5f477e29eda0687b4eaa64dfc21bc687093dc166cad011e8dd6b934d92c7e631952e3204fe3ea8f0f6dee7560945c6a9b25b4d0246d490e22a8275ab95f7b0a6cc6f71 - [1666961364.293322][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 - [1666961364.293335][218195:218195] CHIP:DMG: } - [1666961364.293347][218195:218195] CHIP:DMG: - [1666961364.293368][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = - [1666961364.293380][218195:218195] CHIP:DMG: { - [1666961364.293392][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d2404001836021818181535012600740734f6370124020724031d24040034051835022500020324010118181818290424ff0118 - [1666961364.293404][218195:218195] CHIP:DMG: } - [1666961364.293416][218195:218195] CHIP:DMG: - [1666961364.293482][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961364.293496][218195:218195] CHIP:DMG: { - [1666961364.293506][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961364.293525][218195:218195] CHIP:DMG: [ - [1666961364.293538][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961364.293557][218195:218195] CHIP:DMG: { - [1666961364.293570][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961364.293584][218195:218195] CHIP:DMG: { - [1666961364.293599][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, - [1666961364.293614][218195:218195] CHIP:DMG: AttributePathIB = - [1666961364.293629][218195:218195] CHIP:DMG: { - [1666961364.293644][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666961364.293659][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961364.293675][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961364.293690][218195:218195] CHIP:DMG: } - [1666961364.293706][218195:218195] CHIP:DMG: - [1666961364.293720][218195:218195] CHIP:DMG: Data = [ - [1666961364.293735][218195:218195] CHIP:DMG: - [1666961364.293750][218195:218195] CHIP:DMG: ], - [1666961364.293764][218195:218195] CHIP:DMG: }, - [1666961364.293781][218195:218195] CHIP:DMG: - [1666961364.293794][218195:218195] CHIP:DMG: }, - [1666961364.293818][218195:218195] CHIP:DMG: - [1666961364.293830][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961364.293849][218195:218195] CHIP:DMG: { - [1666961364.293862][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961364.293876][218195:218195] CHIP:DMG: { - [1666961364.293890][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, - [1666961364.293904][218195:218195] CHIP:DMG: AttributePathIB = - [1666961364.293918][218195:218195] CHIP:DMG: { - [1666961364.293933][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666961364.293948][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961364.293963][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961364.293978][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961364.293992][218195:218195] CHIP:DMG: } - [1666961364.294008][218195:218195] CHIP:DMG: - [1666961364.294022][218195:218195] CHIP:DMG: Data = - [1666961364.294036][218195:218195] CHIP:DMG: { - [1666961364.294052][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961364.294068][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961364.294082][218195:218195] CHIP:DMG: }, - [1666961364.294095][218195:218195] CHIP:DMG: }, - [1666961364.294113][218195:218195] CHIP:DMG: - [1666961364.294125][218195:218195] CHIP:DMG: }, - [1666961364.294142][218195:218195] CHIP:DMG: - [1666961364.294154][218195:218195] CHIP:DMG: ], - [1666961364.294177][218195:218195] CHIP:DMG: - [1666961364.294191][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961364.294203][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961364.294214][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 7 On TH(bridge-app) Log: + + [1666961364.286140][218195:218195] CHIP:IM: Received Read request + [1666961364.286177][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961364.286185][218195:218195] CHIP:DMG: { + [1666961364.286193][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961364.286202][218195:218195] CHIP:DMG: [ + [1666961364.286209][218195:218195] CHIP:DMG: AttributePathIB = + [1666961364.286218][218195:218195] CHIP:DMG: { + [1666961364.286228][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666961364.286237][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961364.286246][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961364.286254][218195:218195] CHIP:DMG: } + [1666961364.286263][218195:218195] CHIP:DMG: + [1666961364.286271][218195:218195] CHIP:DMG: ], + [1666961364.286282][218195:218195] CHIP:DMG: + [1666961364.286291][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961364.286299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961364.286306][218195:218195] CHIP:DMG: }, + [1666961364.286337][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961364.286367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961364.286377][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961364.286385][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0000 (expanded=0) + [1666961364.286397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v + [1666961364.286410][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961364.286435][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... + [1666961364.286561][218195:218195] CHIP:EM: <<< [E:20571r M:215006971 (Ack:132367975)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961364.286578][218195:218195] CHIP:IN: (S) Sending msg 215006971 on secure session with LSID: 51704 + [1666961364.286734][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36519 | 215006971 | [Interaction Model (1) / Report Data (0x05) / Session = 4615 / Exchange = 20571] + [1666961364.286752][218195:218195] CHIP:DMG: Header Flags = + [1666961364.286760][218195:218195] CHIP:DMG: { + [1666961364.286775][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961364.286783][218195:218195] CHIP:DMG: { + [1666961364.293096][218195:218195] CHIP:DMG: AckMsg = 132367975 + [1666961364.293130][218195:218195] CHIP:DMG: NeedsAck = true + [1666961364.293156][218195:218195] CHIP:DMG: } + [1666961364.293190][218195:218195] CHIP:DMG: } + [1666961364.293214][218195:218195] CHIP:DMG: + [1666961364.293248][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = + [1666961364.293273][218195:218195] CHIP:DMG: { + [1666961364.293295][218195:218195] CHIP:DMG: data = 00071200fbbed00c55f10001d54b0896b36ef389b19ccab71aa5a70e1dda15a56c40b699441d5f477e29eda0687b4eaa64dfc21bc687093dc166cad011e8dd6b934d92c7e631952e3204fe3ea8f0f6dee7560945c6a9b25b4d0246d490e22a8275ab95f7b0a6cc6f71 + [1666961364.293322][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 + [1666961364.293335][218195:218195] CHIP:DMG: } + [1666961364.293347][218195:218195] CHIP:DMG: + [1666961364.293368][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = + [1666961364.293380][218195:218195] CHIP:DMG: { + [1666961364.293392][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d2404001836021818181535012600740734f6370124020724031d24040034051835022500020324010118181818290424ff0118 + [1666961364.293404][218195:218195] CHIP:DMG: } + [1666961364.293416][218195:218195] CHIP:DMG: + [1666961364.293482][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961364.293496][218195:218195] CHIP:DMG: { + [1666961364.293506][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961364.293525][218195:218195] CHIP:DMG: [ + [1666961364.293538][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961364.293557][218195:218195] CHIP:DMG: { + [1666961364.293570][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961364.293584][218195:218195] CHIP:DMG: { + [1666961364.293599][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, + [1666961364.293614][218195:218195] CHIP:DMG: AttributePathIB = + [1666961364.293629][218195:218195] CHIP:DMG: { + [1666961364.293644][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666961364.293659][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961364.293675][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961364.293690][218195:218195] CHIP:DMG: } + [1666961364.293706][218195:218195] CHIP:DMG: + [1666961364.293720][218195:218195] CHIP:DMG: Data = [ + [1666961364.293735][218195:218195] CHIP:DMG: + [1666961364.293750][218195:218195] CHIP:DMG: ], + [1666961364.293764][218195:218195] CHIP:DMG: }, + [1666961364.293781][218195:218195] CHIP:DMG: + [1666961364.293794][218195:218195] CHIP:DMG: }, + [1666961364.293818][218195:218195] CHIP:DMG: + [1666961364.293830][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961364.293849][218195:218195] CHIP:DMG: { + [1666961364.293862][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961364.293876][218195:218195] CHIP:DMG: { + [1666961364.293890][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, + [1666961364.293904][218195:218195] CHIP:DMG: AttributePathIB = + [1666961364.293918][218195:218195] CHIP:DMG: { + [1666961364.293933][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666961364.293948][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961364.293963][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961364.293978][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961364.293992][218195:218195] CHIP:DMG: } + [1666961364.294008][218195:218195] CHIP:DMG: + [1666961364.294022][218195:218195] CHIP:DMG: Data = + [1666961364.294036][218195:218195] CHIP:DMG: { + [1666961364.294052][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961364.294068][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961364.294082][218195:218195] CHIP:DMG: }, + [1666961364.294095][218195:218195] CHIP:DMG: }, + [1666961364.294113][218195:218195] CHIP:DMG: + [1666961364.294125][218195:218195] CHIP:DMG: }, + [1666961364.294142][218195:218195] CHIP:DMG: + [1666961364.294154][218195:218195] CHIP:DMG: ], + [1666961364.294177][218195:218195] CHIP:DMG: + [1666961364.294191][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961364.294203][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961364.294214][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 8 - Verify the DeviceTypeList attribute response with endpoint 8 On TH(bridge-app) Log: - - [1666961419.607662][218195:218195] CHIP:IM: Received Read request - [1666961419.607690][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961419.607697][218195:218195] CHIP:DMG: { - [1666961419.607704][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961419.607711][218195:218195] CHIP:DMG: [ - [1666961419.607718][218195:218195] CHIP:DMG: AttributePathIB = - [1666961419.607726][218195:218195] CHIP:DMG: { - [1666961419.607733][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666961419.607741][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961419.607749][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961419.607756][218195:218195] CHIP:DMG: } - [1666961419.607764][218195:218195] CHIP:DMG: - [1666961419.607769][218195:218195] CHIP:DMG: ], - [1666961419.607777][218195:218195] CHIP:DMG: - [1666961419.607783][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961419.607788][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961419.607793][218195:218195] CHIP:DMG: }, - [1666961419.607818][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961419.607838][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961419.607845][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961419.607850][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0000 (expanded=0) - [1666961419.607858][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v - [1666961419.607867][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961419.607885][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... - [1666961419.607987][218195:218195] CHIP:EM: <<< [E:25290r M:113624282 (Ack:54059552)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961419.607998][218195:218195] CHIP:IN: (S) Sending msg 113624282 on secure session with LSID: 51705 - [1666961419.608128][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44999 | 113624282 | [Interaction Model (1) / Report Data (0x05) / Session = 36612 / Exchange = 25290] - [1666961419.608143][218195:218195] CHIP:DMG: Header Flags = - [1666961419.608154][218195:218195] CHIP:DMG: { - [1666961419.608167][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961419.608173][218195:218195] CHIP:DMG: { - [1666961419.608181][218195:218195] CHIP:DMG: AckMsg = 54059552 - [1666961419.608211][218195:218195] CHIP:DMG: NeedsAck = true - [1666961419.608227][218195:218195] CHIP:DMG: } - [1666961419.608238][218195:218195] CHIP:DMG: } - [1666961419.608245][218195:218195] CHIP:DMG: - [1666961419.608254][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = - [1666961419.608260][218195:218195] CHIP:DMG: { - [1666961419.608266][218195:218195] CHIP:DMG: data = 00048f00dac4c5068a00f6067a2debbf6b33b35fdbe3fc56b2a163f97b132bec91a04597361fafe7438c0be37c604efda3d4d4ad7071909f234fd3bf48f3e16cb4b41105082a13b45cc9589482c39b8d5af6a9f35b19c07fc1d126c09e37c3cec6880657f43006a87c - [1666961419.608273][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 - [1666961419.608280][218195:218195] CHIP:DMG: } - [1666961419.608286][218195:218195] CHIP:DMG: - [1666961419.608298][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = - [1666961419.608304][218195:218195] CHIP:DMG: { - [1666961419.608309][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d2404001836021818181535012600de39a0f6370124020824031d24040034051835022500020324010118181818290424ff0118 - [1666961419.608314][218195:218195] CHIP:DMG: } - [1666961419.608319][218195:218195] CHIP:DMG: - [1666961419.608351][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961419.608357][218195:218195] CHIP:DMG: { - [1666961419.608362][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961419.608371][218195:218195] CHIP:DMG: [ - [1666961419.608376][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961419.608385][218195:218195] CHIP:DMG: { - [1666961419.608390][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961419.608397][218195:218195] CHIP:DMG: { - [1666961419.608403][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, - [1666961419.608409][218195:218195] CHIP:DMG: AttributePathIB = - [1666961419.608416][218195:218195] CHIP:DMG: { - [1666961419.608422][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666961419.608429][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961419.608436][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961419.608442][218195:218195] CHIP:DMG: } - [1666961419.608450][218195:218195] CHIP:DMG: - [1666961419.608456][218195:218195] CHIP:DMG: Data = [ - [1666961419.608463][218195:218195] CHIP:DMG: - [1666961419.608469][218195:218195] CHIP:DMG: ], - [1666961419.608475][218195:218195] CHIP:DMG: }, - [1666961419.608483][218195:218195] CHIP:DMG: - [1666961419.608489][218195:218195] CHIP:DMG: }, - [1666961419.608501][218195:218195] CHIP:DMG: - [1666961419.608506][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961419.608515][218195:218195] CHIP:DMG: { - [1666961419.608521][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961419.608527][218195:218195] CHIP:DMG: { - [1666961419.608533][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, - [1666961419.608540][218195:218195] CHIP:DMG: AttributePathIB = - [1666961419.608548][218195:218195] CHIP:DMG: { - [1666961419.608558][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666961419.608569][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961419.608583][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961419.608593][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961419.608601][218195:218195] CHIP:DMG: } - [1666961419.608612][218195:218195] CHIP:DMG: - [1666961419.608621][218195:218195] CHIP:DMG: Data = - [1666961419.608628][218195:218195] CHIP:DMG: { - [1666961419.608637][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961419.608646][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961419.608657][218195:218195] CHIP:DMG: }, - [1666961419.608664][218195:218195] CHIP:DMG: }, - [1666961419.608675][218195:218195] CHIP:DMG: - [1666961419.608682][218195:218195] CHIP:DMG: }, - [1666961419.608692][218195:218195] CHIP:DMG: - [1666961419.608700][218195:218195] CHIP:DMG: ], - [1666961419.608712][218195:218195] CHIP:DMG: - [1666961419.608718][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961419.608724][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961419.608729][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 8 On TH(bridge-app) Log: + + [1666961419.607662][218195:218195] CHIP:IM: Received Read request + [1666961419.607690][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961419.607697][218195:218195] CHIP:DMG: { + [1666961419.607704][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961419.607711][218195:218195] CHIP:DMG: [ + [1666961419.607718][218195:218195] CHIP:DMG: AttributePathIB = + [1666961419.607726][218195:218195] CHIP:DMG: { + [1666961419.607733][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666961419.607741][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961419.607749][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961419.607756][218195:218195] CHIP:DMG: } + [1666961419.607764][218195:218195] CHIP:DMG: + [1666961419.607769][218195:218195] CHIP:DMG: ], + [1666961419.607777][218195:218195] CHIP:DMG: + [1666961419.607783][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961419.607788][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961419.607793][218195:218195] CHIP:DMG: }, + [1666961419.607818][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961419.607838][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961419.607845][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961419.607850][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0000 (expanded=0) + [1666961419.607858][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v + [1666961419.607867][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961419.607885][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... + [1666961419.607987][218195:218195] CHIP:EM: <<< [E:25290r M:113624282 (Ack:54059552)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961419.607998][218195:218195] CHIP:IN: (S) Sending msg 113624282 on secure session with LSID: 51705 + [1666961419.608128][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44999 | 113624282 | [Interaction Model (1) / Report Data (0x05) / Session = 36612 / Exchange = 25290] + [1666961419.608143][218195:218195] CHIP:DMG: Header Flags = + [1666961419.608154][218195:218195] CHIP:DMG: { + [1666961419.608167][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961419.608173][218195:218195] CHIP:DMG: { + [1666961419.608181][218195:218195] CHIP:DMG: AckMsg = 54059552 + [1666961419.608211][218195:218195] CHIP:DMG: NeedsAck = true + [1666961419.608227][218195:218195] CHIP:DMG: } + [1666961419.608238][218195:218195] CHIP:DMG: } + [1666961419.608245][218195:218195] CHIP:DMG: + [1666961419.608254][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = + [1666961419.608260][218195:218195] CHIP:DMG: { + [1666961419.608266][218195:218195] CHIP:DMG: data = 00048f00dac4c5068a00f6067a2debbf6b33b35fdbe3fc56b2a163f97b132bec91a04597361fafe7438c0be37c604efda3d4d4ad7071909f234fd3bf48f3e16cb4b41105082a13b45cc9589482c39b8d5af6a9f35b19c07fc1d126c09e37c3cec6880657f43006a87c + [1666961419.608273][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 + [1666961419.608280][218195:218195] CHIP:DMG: } + [1666961419.608286][218195:218195] CHIP:DMG: + [1666961419.608298][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = + [1666961419.608304][218195:218195] CHIP:DMG: { + [1666961419.608309][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d2404001836021818181535012600de39a0f6370124020824031d24040034051835022500020324010118181818290424ff0118 + [1666961419.608314][218195:218195] CHIP:DMG: } + [1666961419.608319][218195:218195] CHIP:DMG: + [1666961419.608351][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961419.608357][218195:218195] CHIP:DMG: { + [1666961419.608362][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961419.608371][218195:218195] CHIP:DMG: [ + [1666961419.608376][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961419.608385][218195:218195] CHIP:DMG: { + [1666961419.608390][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961419.608397][218195:218195] CHIP:DMG: { + [1666961419.608403][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, + [1666961419.608409][218195:218195] CHIP:DMG: AttributePathIB = + [1666961419.608416][218195:218195] CHIP:DMG: { + [1666961419.608422][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666961419.608429][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961419.608436][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961419.608442][218195:218195] CHIP:DMG: } + [1666961419.608450][218195:218195] CHIP:DMG: + [1666961419.608456][218195:218195] CHIP:DMG: Data = [ + [1666961419.608463][218195:218195] CHIP:DMG: + [1666961419.608469][218195:218195] CHIP:DMG: ], + [1666961419.608475][218195:218195] CHIP:DMG: }, + [1666961419.608483][218195:218195] CHIP:DMG: + [1666961419.608489][218195:218195] CHIP:DMG: }, + [1666961419.608501][218195:218195] CHIP:DMG: + [1666961419.608506][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961419.608515][218195:218195] CHIP:DMG: { + [1666961419.608521][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961419.608527][218195:218195] CHIP:DMG: { + [1666961419.608533][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, + [1666961419.608540][218195:218195] CHIP:DMG: AttributePathIB = + [1666961419.608548][218195:218195] CHIP:DMG: { + [1666961419.608558][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666961419.608569][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961419.608583][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961419.608593][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961419.608601][218195:218195] CHIP:DMG: } + [1666961419.608612][218195:218195] CHIP:DMG: + [1666961419.608621][218195:218195] CHIP:DMG: Data = + [1666961419.608628][218195:218195] CHIP:DMG: { + [1666961419.608637][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961419.608646][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961419.608657][218195:218195] CHIP:DMG: }, + [1666961419.608664][218195:218195] CHIP:DMG: }, + [1666961419.608675][218195:218195] CHIP:DMG: + [1666961419.608682][218195:218195] CHIP:DMG: }, + [1666961419.608692][218195:218195] CHIP:DMG: + [1666961419.608700][218195:218195] CHIP:DMG: ], + [1666961419.608712][218195:218195] CHIP:DMG: + [1666961419.608718][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961419.608724][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961419.608729][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 9 - Verify the DeviceTypeList attribute response with endpoint 9 On TH(bridge-app) Log: - - [1666961467.313086][218195:218195] CHIP:IM: Received Read request - [1666961467.313117][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961467.313124][218195:218195] CHIP:DMG: { - [1666961467.313131][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961467.313138][218195:218195] CHIP:DMG: [ - [1666961467.313145][218195:218195] CHIP:DMG: AttributePathIB = - [1666961467.313153][218195:218195] CHIP:DMG: { - [1666961467.313161][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666961467.313168][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961467.313176][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961467.313183][218195:218195] CHIP:DMG: } - [1666961467.313192][218195:218195] CHIP:DMG: - [1666961467.313199][218195:218195] CHIP:DMG: ], - [1666961467.313207][218195:218195] CHIP:DMG: - [1666961467.313215][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961467.313222][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961467.313228][218195:218195] CHIP:DMG: }, - [1666961467.313258][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961467.313280][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961467.313289][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961467.313295][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0000 (expanded=0) - [1666961467.313305][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v - [1666961467.313316][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961467.313337][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... - [1666961467.313467][218195:218195] CHIP:EM: <<< [E:31333r M:223107854 (Ack:132183457)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961467.313485][218195:218195] CHIP:IN: (S) Sending msg 223107854 on secure session with LSID: 51706 - [1666961467.313642][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43652 | 223107854 | [Interaction Model (1) / Report Data (0x05) / Session = 60256 / Exchange = 31333] - [1666961467.313661][218195:218195] CHIP:DMG: Header Flags = - [1666961467.313670][218195:218195] CHIP:DMG: { - [1666961467.313687][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961467.313695][218195:218195] CHIP:DMG: { - [1666961467.313704][218195:218195] CHIP:DMG: AckMsg = 132183457 - [1666961467.313710][218195:218195] CHIP:DMG: NeedsAck = true - [1666961467.313717][218195:218195] CHIP:DMG: } - [1666961467.313728][218195:218195] CHIP:DMG: } - [1666961467.313734][218195:218195] CHIP:DMG: - [1666961467.313743][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = - [1666961467.313750][218195:218195] CHIP:DMG: { - [1666961467.313756][218195:218195] CHIP:DMG: data = 0060eb000e5b4c0dc8cb7b4f03ab26aee4997a4c2784dad6607d977c71c095a9c6853d638b8b83791844bbb57e108db126d3c9875c8c863e16b5e7f0ac048c90294cba1104094003d00420249907611764135dace53cd6727f61989741876aa1f661744c3e14d274 - [1666961467.313764][218195:218195] CHIP:DMG: buffer_ptr = 94136416760240 - [1666961467.313770][218195:218195] CHIP:DMG: } - [1666961467.313776][218195:218195] CHIP:DMG: - [1666961467.313788][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = - [1666961467.313794][218195:218195] CHIP:DMG: { - [1666961467.313800][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040018360218181815350126005ebab630370124020924031d240400340518350224001124010118181818290424ff0118 - [1666961467.313807][218195:218195] CHIP:DMG: } - [1666961467.313813][218195:218195] CHIP:DMG: - [1666961467.313852][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961467.313859][218195:218195] CHIP:DMG: { - [1666961467.313865][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961467.313876][218195:218195] CHIP:DMG: [ - [1666961467.313883][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961467.313894][218195:218195] CHIP:DMG: { - [1666961467.313901][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961467.313908][218195:218195] CHIP:DMG: { - [1666961467.313916][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, - [1666961467.313924][218195:218195] CHIP:DMG: AttributePathIB = - [1666961467.313932][218195:218195] CHIP:DMG: { - [1666961467.313940][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666961467.313948][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961467.313957][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961467.313964][218195:218195] CHIP:DMG: } - [1666961467.313974][218195:218195] CHIP:DMG: - [1666961467.313981][218195:218195] CHIP:DMG: Data = [ - [1666961467.313989][218195:218195] CHIP:DMG: - [1666961467.313998][218195:218195] CHIP:DMG: ], - [1666961467.314005][218195:218195] CHIP:DMG: }, - [1666961467.314015][218195:218195] CHIP:DMG: - [1666961467.314022][218195:218195] CHIP:DMG: }, - [1666961467.314036][218195:218195] CHIP:DMG: - [1666961467.314043][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961467.314054][218195:218195] CHIP:DMG: { - [1666961467.314061][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961467.314069][218195:218195] CHIP:DMG: { - [1666961467.314076][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, - [1666961467.314084][218195:218195] CHIP:DMG: AttributePathIB = - [1666961467.314092][218195:218195] CHIP:DMG: { - [1666961467.314100][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666961467.314108][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961467.314116][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961467.314124][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961467.314131][218195:218195] CHIP:DMG: } - [1666961467.314141][218195:218195] CHIP:DMG: - [1666961467.314148][218195:218195] CHIP:DMG: Data = - [1666961467.314156][218195:218195] CHIP:DMG: { - [1666961467.314165][218195:218195] CHIP:DMG: 0x0 = 17, - [1666961467.314174][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961467.314182][218195:218195] CHIP:DMG: }, - [1666961467.314189][218195:218195] CHIP:DMG: }, - [1666961467.314200][218195:218195] CHIP:DMG: - [1666961467.314206][218195:218195] CHIP:DMG: }, - [1666961467.314217][218195:218195] CHIP:DMG: - [1666961467.314224][218195:218195] CHIP:DMG: ], - [1666961467.314238][218195:218195] CHIP:DMG: - [1666961467.314245][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961467.314252][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961467.314259][218195:218195] CHIP:DMG: } - [1666961467.314265][218195:218195] CHIP:DMG: + Verify the DeviceTypeList attribute response with endpoint 9 On TH(bridge-app) Log: + + [1666961467.313086][218195:218195] CHIP:IM: Received Read request + [1666961467.313117][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961467.313124][218195:218195] CHIP:DMG: { + [1666961467.313131][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961467.313138][218195:218195] CHIP:DMG: [ + [1666961467.313145][218195:218195] CHIP:DMG: AttributePathIB = + [1666961467.313153][218195:218195] CHIP:DMG: { + [1666961467.313161][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666961467.313168][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961467.313176][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961467.313183][218195:218195] CHIP:DMG: } + [1666961467.313192][218195:218195] CHIP:DMG: + [1666961467.313199][218195:218195] CHIP:DMG: ], + [1666961467.313207][218195:218195] CHIP:DMG: + [1666961467.313215][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961467.313222][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961467.313228][218195:218195] CHIP:DMG: }, + [1666961467.313258][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961467.313280][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961467.313289][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961467.313295][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0000 (expanded=0) + [1666961467.313305][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v + [1666961467.313316][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961467.313337][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... + [1666961467.313467][218195:218195] CHIP:EM: <<< [E:31333r M:223107854 (Ack:132183457)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961467.313485][218195:218195] CHIP:IN: (S) Sending msg 223107854 on secure session with LSID: 51706 + [1666961467.313642][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43652 | 223107854 | [Interaction Model (1) / Report Data (0x05) / Session = 60256 / Exchange = 31333] + [1666961467.313661][218195:218195] CHIP:DMG: Header Flags = + [1666961467.313670][218195:218195] CHIP:DMG: { + [1666961467.313687][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961467.313695][218195:218195] CHIP:DMG: { + [1666961467.313704][218195:218195] CHIP:DMG: AckMsg = 132183457 + [1666961467.313710][218195:218195] CHIP:DMG: NeedsAck = true + [1666961467.313717][218195:218195] CHIP:DMG: } + [1666961467.313728][218195:218195] CHIP:DMG: } + [1666961467.313734][218195:218195] CHIP:DMG: + [1666961467.313743][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = + [1666961467.313750][218195:218195] CHIP:DMG: { + [1666961467.313756][218195:218195] CHIP:DMG: data = 0060eb000e5b4c0dc8cb7b4f03ab26aee4997a4c2784dad6607d977c71c095a9c6853d638b8b83791844bbb57e108db126d3c9875c8c863e16b5e7f0ac048c90294cba1104094003d00420249907611764135dace53cd6727f61989741876aa1f661744c3e14d274 + [1666961467.313764][218195:218195] CHIP:DMG: buffer_ptr = 94136416760240 + [1666961467.313770][218195:218195] CHIP:DMG: } + [1666961467.313776][218195:218195] CHIP:DMG: + [1666961467.313788][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = + [1666961467.313794][218195:218195] CHIP:DMG: { + [1666961467.313800][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040018360218181815350126005ebab630370124020924031d240400340518350224001124010118181818290424ff0118 + [1666961467.313807][218195:218195] CHIP:DMG: } + [1666961467.313813][218195:218195] CHIP:DMG: + [1666961467.313852][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961467.313859][218195:218195] CHIP:DMG: { + [1666961467.313865][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961467.313876][218195:218195] CHIP:DMG: [ + [1666961467.313883][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961467.313894][218195:218195] CHIP:DMG: { + [1666961467.313901][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961467.313908][218195:218195] CHIP:DMG: { + [1666961467.313916][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, + [1666961467.313924][218195:218195] CHIP:DMG: AttributePathIB = + [1666961467.313932][218195:218195] CHIP:DMG: { + [1666961467.313940][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666961467.313948][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961467.313957][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961467.313964][218195:218195] CHIP:DMG: } + [1666961467.313974][218195:218195] CHIP:DMG: + [1666961467.313981][218195:218195] CHIP:DMG: Data = [ + [1666961467.313989][218195:218195] CHIP:DMG: + [1666961467.313998][218195:218195] CHIP:DMG: ], + [1666961467.314005][218195:218195] CHIP:DMG: }, + [1666961467.314015][218195:218195] CHIP:DMG: + [1666961467.314022][218195:218195] CHIP:DMG: }, + [1666961467.314036][218195:218195] CHIP:DMG: + [1666961467.314043][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961467.314054][218195:218195] CHIP:DMG: { + [1666961467.314061][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961467.314069][218195:218195] CHIP:DMG: { + [1666961467.314076][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, + [1666961467.314084][218195:218195] CHIP:DMG: AttributePathIB = + [1666961467.314092][218195:218195] CHIP:DMG: { + [1666961467.314100][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666961467.314108][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961467.314116][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961467.314124][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961467.314131][218195:218195] CHIP:DMG: } + [1666961467.314141][218195:218195] CHIP:DMG: + [1666961467.314148][218195:218195] CHIP:DMG: Data = + [1666961467.314156][218195:218195] CHIP:DMG: { + [1692177433.984755][8498:8500] CHIP:DMG: 0x0 = 256, + [1692177433.984794][8498:8500] CHIP:DMG: 0x1 = 1, + [1692177433.984831][8498:8500] CHIP:DMG: }, + [1692177433.984867][8498:8500] CHIP:DMG: { + [1692177433.984903][8498:8500] CHIP:DMG: 0x0 = 19, + [1692177433.984939][8498:8500] CHIP:DMG: 0x1 = 1, + [1692177433.984983][8498:8500] CHIP:DMG: }, + [1666961467.314189][218195:218195] CHIP:DMG: }, + [1666961467.314200][218195:218195] CHIP:DMG: + [1666961467.314206][218195:218195] CHIP:DMG: }, + [1666961467.314217][218195:218195] CHIP:DMG: + [1666961467.314224][218195:218195] CHIP:DMG: ], + [1666961467.314238][218195:218195] CHIP:DMG: + [1666961467.314245][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961467.314252][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961467.314259][218195:218195] CHIP:DMG: } + [1666961467.314265][218195:218195] CHIP:DMG: ./chip-tool descriptor read device-type-list 1 10 - Verify the DeviceTypeList attribute response with endpoint 10 On TH(bridge-app) Log: - - [1666961546.940423][218195:218195] CHIP:IM: Received Read request - [1666961546.940503][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961546.940529][218195:218195] CHIP:DMG: { - [1666961546.940550][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961546.940575][218195:218195] CHIP:DMG: [ - [1666961546.940594][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.940617][218195:218195] CHIP:DMG: { - [1666961546.940641][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.940672][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.940700][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.940719][218195:218195] CHIP:DMG: } - [1666961546.940749][218195:218195] CHIP:DMG: - [1666961546.940771][218195:218195] CHIP:DMG: ], - [1666961546.940802][218195:218195] CHIP:DMG: - [1666961546.940823][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961546.940847][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961546.940870][218195:218195] CHIP:DMG: }, - [1666961546.940978][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961546.941112][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961546.941146][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961546.941163][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0000 (expanded=0) - [1666961546.941188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v - [1666961546.941216][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961546.941289][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961546.941647][218195:218195] CHIP:EM: <<< [E:63227r M:213194411 (Ack:173600094)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961546.941691][218195:218195] CHIP:IN: (S) Sending msg 213194411 on secure session with LSID: 51708 - [1666961546.942785][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:41272 | 213194411 | [Interaction Model (1) / Report Data (0x05) / Session = 36448 / Exchange = 63227] - [1666961546.942827][218195:218195] CHIP:DMG: Header Flags = - [1666961546.942847][218195:218195] CHIP:DMG: { - [1666961546.942885][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961546.942905][218195:218195] CHIP:DMG: { - [1666961546.942930][218195:218195] CHIP:DMG: AckMsg = 173600094 - [1666961546.942951][218195:218195] CHIP:DMG: NeedsAck = true - [1666961546.942971][218195:218195] CHIP:DMG: } - [1666961546.943006][218195:218195] CHIP:DMG: } - [1666961546.943025][218195:218195] CHIP:DMG: - [1666961546.943057][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961546.943076][218195:218195] CHIP:DMG: { - [1666961546.943128][218195:218195] CHIP:DMG: data = 00608e00ab16b50c9cee8eaa9a5a4ff449e0616dcf56b98b6256f025c41d8fd954f2531270f2d21f94df7c3cdd58b2076e8bc8942578ad5a3b49aca6ab527c7a6901dbf7a8639504d895243c625dbd5eab8cf3049dc4dab884ebcd04aedaf490a8cf7fa920e7c18051699de553857d7081b44eb74be37210b021bdf379dff1078fb33f80dc34c6714ae7f2 - [1666961546.943157][218195:218195] CHIP:DMG: buffer_ptr = 94136416760416 - [1666961546.943177][218195:218195] CHIP:DMG: } - [1666961546.943198][218195:218195] CHIP:DMG: - [1666961546.943237][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961546.943257][218195:218195] CHIP:DMG: { - [1666961546.943279][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d2404001836021818181535012600b298fda8370124020a24031d2404003405183502250000012401011818181535012600b298fda8370124020a24031d240400340518350224001324010118181818290424ff0118 - [1666961546.943302][218195:218195] CHIP:DMG: } - [1666961546.943320][218195:218195] CHIP:DMG: - [1666961546.943461][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961546.943483][218195:218195] CHIP:DMG: { - [1666961546.943501][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961546.943533][218195:218195] CHIP:DMG: [ - [1666961546.943549][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961546.943581][218195:218195] CHIP:DMG: { - [1666961546.943599][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961546.943621][218195:218195] CHIP:DMG: { - [1666961546.943644][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666961546.943669][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.943693][218195:218195] CHIP:DMG: { - [1666961546.943718][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.943748][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.943777][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.943803][218195:218195] CHIP:DMG: } - [1666961546.943830][218195:218195] CHIP:DMG: - [1666961546.943856][218195:218195] CHIP:DMG: Data = [ - [1666961546.943879][218195:218195] CHIP:DMG: - [1666961546.943911][218195:218195] CHIP:DMG: ], - [1666961546.943931][218195:218195] CHIP:DMG: }, - [1666961546.943960][218195:218195] CHIP:DMG: - [1666961546.943977][218195:218195] CHIP:DMG: }, - [1666961546.944016][218195:218195] CHIP:DMG: - [1666961546.944033][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961546.944066][218195:218195] CHIP:DMG: { - [1666961546.944083][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961546.944104][218195:218195] CHIP:DMG: { - [1666961546.944127][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666961546.944151][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.944178][218195:218195] CHIP:DMG: { - [1666961546.944200][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.944229][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.944257][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.944286][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961546.944307][218195:218195] CHIP:DMG: } - [1666961546.944335][218195:218195] CHIP:DMG: - [1666961546.944356][218195:218195] CHIP:DMG: Data = - [1666961546.944378][218195:218195] CHIP:DMG: { - [1666961546.944405][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961546.944431][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961546.944455][218195:218195] CHIP:DMG: }, - [1666961546.944476][218195:218195] CHIP:DMG: }, - [1666961546.944506][218195:218195] CHIP:DMG: - [1666961546.944523][218195:218195] CHIP:DMG: }, - [1666961546.944565][218195:218195] CHIP:DMG: - [1666961546.944582][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961546.944614][218195:218195] CHIP:DMG: { - [1666961546.944631][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961546.944652][218195:218195] CHIP:DMG: { - [1666961546.944678][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666961546.944697][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.944722][218195:218195] CHIP:DMG: { - [1666961546.944744][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.944770][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.944798][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.944830][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961546.944856][218195:218195] CHIP:DMG: } - [1666961546.944886][218195:218195] CHIP:DMG: - [1666961546.944907][218195:218195] CHIP:DMG: Data = - [1666961546.944930][218195:218195] CHIP:DMG: { - [1666961546.944954][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961546.944981][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961546.945003][218195:218195] CHIP:DMG: }, - [1666961546.945023][218195:218195] CHIP:DMG: }, - [1666961546.945053][218195:218195] CHIP:DMG: - [1666961546.945073][218195:218195] CHIP:DMG: }, - [1666961546.945104][218195:218195] CHIP:DMG: - [1666961546.945120][218195:218195] CHIP:DMG: ], - [1666961546.945168][218195:218195] CHIP:DMG: - [1666961546.945187][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961546.945208][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961546.945226][218195:218195] CHIP:DMG: } - [1666961546.945246][218195:218195] CHIP:DMG: + Verify the DeviceTypeList attribute response with endpoint 10 On TH(bridge-app) Log: + + [1666961546.940423][218195:218195] CHIP:IM: Received Read request + [1666961546.940503][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961546.940529][218195:218195] CHIP:DMG: { + [1666961546.940550][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961546.940575][218195:218195] CHIP:DMG: [ + [1666961546.940594][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.940617][218195:218195] CHIP:DMG: { + [1666961546.940641][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.940672][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.940700][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.940719][218195:218195] CHIP:DMG: } + [1666961546.940749][218195:218195] CHIP:DMG: + [1666961546.940771][218195:218195] CHIP:DMG: ], + [1666961546.940802][218195:218195] CHIP:DMG: + [1666961546.940823][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961546.940847][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961546.940870][218195:218195] CHIP:DMG: }, + [1666961546.940978][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961546.941112][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961546.941146][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961546.941163][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0000 (expanded=0) + [1666961546.941188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v + [1666961546.941216][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961546.941289][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961546.941647][218195:218195] CHIP:EM: <<< [E:63227r M:213194411 (Ack:173600094)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961546.941691][218195:218195] CHIP:IN: (S) Sending msg 213194411 on secure session with LSID: 51708 + [1666961546.942785][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:41272 | 213194411 | [Interaction Model (1) / Report Data (0x05) / Session = 36448 / Exchange = 63227] + [1666961546.942827][218195:218195] CHIP:DMG: Header Flags = + [1666961546.942847][218195:218195] CHIP:DMG: { + [1666961546.942885][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961546.942905][218195:218195] CHIP:DMG: { + [1666961546.942930][218195:218195] CHIP:DMG: AckMsg = 173600094 + [1666961546.942951][218195:218195] CHIP:DMG: NeedsAck = true + [1666961546.942971][218195:218195] CHIP:DMG: } + [1666961546.943006][218195:218195] CHIP:DMG: } + [1666961546.943025][218195:218195] CHIP:DMG: + [1666961546.943057][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961546.943076][218195:218195] CHIP:DMG: { + [1666961546.943128][218195:218195] CHIP:DMG: data = 00608e00ab16b50c9cee8eaa9a5a4ff449e0616dcf56b98b6256f025c41d8fd954f2531270f2d21f94df7c3cdd58b2076e8bc8942578ad5a3b49aca6ab527c7a6901dbf7a8639504d895243c625dbd5eab8cf3049dc4dab884ebcd04aedaf490a8cf7fa920e7c18051699de553857d7081b44eb74be37210b021bdf379dff1078fb33f80dc34c6714ae7f2 + [1666961546.943157][218195:218195] CHIP:DMG: buffer_ptr = 94136416760416 + [1666961546.943177][218195:218195] CHIP:DMG: } + [1666961546.943198][218195:218195] CHIP:DMG: + [1666961546.943237][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961546.943257][218195:218195] CHIP:DMG: { + [1666961546.943279][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d2404001836021818181535012600b298fda8370124020a24031d2404003405183502250000012401011818181535012600b298fda8370124020a24031d240400340518350224001324010118181818290424ff0118 + [1666961546.943302][218195:218195] CHIP:DMG: } + [1666961546.943320][218195:218195] CHIP:DMG: + [1666961546.943461][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961546.943483][218195:218195] CHIP:DMG: { + [1666961546.943501][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961546.943533][218195:218195] CHIP:DMG: [ + [1666961546.943549][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961546.943581][218195:218195] CHIP:DMG: { + [1666961546.943599][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961546.943621][218195:218195] CHIP:DMG: { + [1666961546.943644][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666961546.943669][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.943693][218195:218195] CHIP:DMG: { + [1666961546.943718][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.943748][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.943777][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.943803][218195:218195] CHIP:DMG: } + [1666961546.943830][218195:218195] CHIP:DMG: + [1666961546.943856][218195:218195] CHIP:DMG: Data = [ + [1666961546.943879][218195:218195] CHIP:DMG: + [1666961546.943911][218195:218195] CHIP:DMG: ], + [1666961546.943931][218195:218195] CHIP:DMG: }, + [1666961546.943960][218195:218195] CHIP:DMG: + [1666961546.943977][218195:218195] CHIP:DMG: }, + [1666961546.944016][218195:218195] CHIP:DMG: + [1666961546.944033][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961546.944066][218195:218195] CHIP:DMG: { + [1666961546.944083][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961546.944104][218195:218195] CHIP:DMG: { + [1666961546.944127][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666961546.944151][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.944178][218195:218195] CHIP:DMG: { + [1666961546.944200][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.944229][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.944257][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.944286][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961546.944307][218195:218195] CHIP:DMG: } + [1666961546.944335][218195:218195] CHIP:DMG: + [1666961546.944356][218195:218195] CHIP:DMG: Data = + [1666961546.944378][218195:218195] CHIP:DMG: { + [1666961546.944405][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961546.944431][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961546.944455][218195:218195] CHIP:DMG: }, + [1666961546.944476][218195:218195] CHIP:DMG: }, + [1666961546.944506][218195:218195] CHIP:DMG: + [1666961546.944523][218195:218195] CHIP:DMG: }, + [1666961546.944565][218195:218195] CHIP:DMG: + [1666961546.944582][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961546.944614][218195:218195] CHIP:DMG: { + [1666961546.944631][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961546.944652][218195:218195] CHIP:DMG: { + [1666961546.944678][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666961546.944697][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.944722][218195:218195] CHIP:DMG: { + [1666961546.944744][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.944770][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.944798][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.944830][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961546.944856][218195:218195] CHIP:DMG: } + [1666961546.944886][218195:218195] CHIP:DMG: + [1666961546.944907][218195:218195] CHIP:DMG: Data = + [1666961546.944930][218195:218195] CHIP:DMG: { + [1666961546.944954][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961546.944981][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961546.945003][218195:218195] CHIP:DMG: }, + [1666961546.945023][218195:218195] CHIP:DMG: }, + [1666961546.945053][218195:218195] CHIP:DMG: + [1666961546.945073][218195:218195] CHIP:DMG: }, + [1666961546.945104][218195:218195] CHIP:DMG: + [1666961546.945120][218195:218195] CHIP:DMG: ], + [1666961546.945168][218195:218195] CHIP:DMG: + [1666961546.945187][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961546.945208][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961546.945226][218195:218195] CHIP:DMG: } + [1666961546.945246][218195:218195] CHIP:DMG: ./chip-tool descriptor read device-type-list 1 11 - Verify the DeviceTypeList attribute response with endpoint 11 On TH(bridge-app) Log: - - [1666961579.870142][218195:218195] CHIP:IM: Received Read request - [1666961579.870175][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961579.870183][218195:218195] CHIP:DMG: { - [1666961579.870191][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961579.870200][218195:218195] CHIP:DMG: [ - [1666961579.870208][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.870218][218195:218195] CHIP:DMG: { - [1666961579.870227][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.870236][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.870245][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.870253][218195:218195] CHIP:DMG: } - [1666961579.870264][218195:218195] CHIP:DMG: - [1666961579.870272][218195:218195] CHIP:DMG: ], - [1666961579.870283][218195:218195] CHIP:DMG: - [1666961579.870291][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961579.870299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961579.870307][218195:218195] CHIP:DMG: }, - [1666961579.870341][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961579.870367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961579.870376][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961579.870384][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0000 (expanded=0) - [1666961579.870397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v - [1666961579.870409][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961579.870434][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961579.870567][218195:218195] CHIP:EM: <<< [E:57809r M:173952829 (Ack:211280019)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961579.870584][218195:218195] CHIP:IN: (S) Sending msg 173952829 on secure session with LSID: 51709 - [1666961579.870751][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:49700 | 173952829 | [Interaction Model (1) / Report Data (0x05) / Session = 12754 / Exchange = 57809] - [1666961579.870769][218195:218195] CHIP:DMG: Header Flags = - [1666961579.870776][218195:218195] CHIP:DMG: { - [1666961579.870794][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961579.870800][218195:218195] CHIP:DMG: { - [1666961579.870810][218195:218195] CHIP:DMG: AckMsg = 211280019 - [1666961579.870818][218195:218195] CHIP:DMG: NeedsAck = true - [1666961579.870828][218195:218195] CHIP:DMG: } - [1666961579.870844][218195:218195] CHIP:DMG: } - [1666961579.870851][218195:218195] CHIP:DMG: - [1666961579.870862][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961579.870869][218195:218195] CHIP:DMG: { - [1666961579.870877][218195:218195] CHIP:DMG: data = 00d231003d4f5e0abdba620c4ead4243411697906f237c8b0d75654d1c3f2be08ff6a10a58363ac41cb8ebb15d7b2a424ba75a24044fd5b0395df2b49ff555bb9102fb82d920f3e70514aef7a6def7988e00cedff3c0ec50779eda009869e6f8cd63e5543bb834b6b211caccbbbce56038d7887de53664614f04f837f1f4e06da41a2ff37b01864ac4843c - [1666961579.870887][218195:218195] CHIP:DMG: buffer_ptr = 94136416760608 - [1666961579.870894][218195:218195] CHIP:DMG: } - [1666961579.870901][218195:218195] CHIP:DMG: - [1666961579.870915][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961579.870922][218195:218195] CHIP:DMG: { - [1666961579.870930][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d2404001836021818181535012600768e2de0370124020b24031d2404003405183502250000012401011818181535012600768e2de0370124020b24031d240400340518350224001324010118181818290424ff0118 - [1666961579.870939][218195:218195] CHIP:DMG: } - [1666961579.870946][218195:218195] CHIP:DMG: - [1666961579.870998][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961579.871007][218195:218195] CHIP:DMG: { - [1666961579.871014][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961579.871027][218195:218195] CHIP:DMG: [ - [1666961579.871034][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961579.871047][218195:218195] CHIP:DMG: { - [1666961579.871055][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961579.871065][218195:218195] CHIP:DMG: { - [1666961579.871075][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666961579.871108][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.871120][218195:218195] CHIP:DMG: { - [1666961579.871130][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.871142][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.871154][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.871164][218195:218195] CHIP:DMG: } - [1666961579.871176][218195:218195] CHIP:DMG: - [1666961579.871185][218195:218195] CHIP:DMG: Data = [ - [1666961579.871196][218195:218195] CHIP:DMG: - [1666961579.871208][218195:218195] CHIP:DMG: ], - [1666961579.871217][218195:218195] CHIP:DMG: }, - [1666961579.871230][218195:218195] CHIP:DMG: - [1666961579.871237][218195:218195] CHIP:DMG: }, - [1666961579.871255][218195:218195] CHIP:DMG: - [1666961579.871262][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961579.871276][218195:218195] CHIP:DMG: { - [1666961579.871283][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961579.871293][218195:218195] CHIP:DMG: { - [1666961579.871303][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666961579.871311][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.871321][218195:218195] CHIP:DMG: { - [1666961579.871331][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.871342][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.871354][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.871364][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961579.871375][218195:218195] CHIP:DMG: } - [1666961579.871387][218195:218195] CHIP:DMG: - [1666961579.871396][218195:218195] CHIP:DMG: Data = - [1666961579.871405][218195:218195] CHIP:DMG: { - [1666961579.871416][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961579.871427][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961579.871439][218195:218195] CHIP:DMG: }, - [1666961579.871448][218195:218195] CHIP:DMG: }, - [1666961579.871461][218195:218195] CHIP:DMG: - [1666961579.871468][218195:218195] CHIP:DMG: }, - [1666961579.871487][218195:218195] CHIP:DMG: - [1666961579.871494][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961579.871508][218195:218195] CHIP:DMG: { - [1666961579.871516][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961579.871525][218195:218195] CHIP:DMG: { - [1666961579.871535][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666961579.871543][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.871554][218195:218195] CHIP:DMG: { - [1666961579.871563][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.871574][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.871586][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.871597][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961579.871608][218195:218195] CHIP:DMG: } - [1666961579.871620][218195:218195] CHIP:DMG: - [1666961579.871628][218195:218195] CHIP:DMG: Data = - [1666961579.871638][218195:218195] CHIP:DMG: { - [1666961579.871648][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961579.871659][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961579.871670][218195:218195] CHIP:DMG: }, - [1666961579.871679][218195:218195] CHIP:DMG: }, - [1666961579.871692][218195:218195] CHIP:DMG: - [1666961579.871700][218195:218195] CHIP:DMG: }, - [1666961579.871714][218195:218195] CHIP:DMG: - [1666961579.871721][218195:218195] CHIP:DMG: ], - [1666961579.871742][218195:218195] CHIP:DMG: - [1666961579.871750][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961579.871759][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961579.871767][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 11 On TH(bridge-app) Log: + + [1666961579.870142][218195:218195] CHIP:IM: Received Read request + [1666961579.870175][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961579.870183][218195:218195] CHIP:DMG: { + [1666961579.870191][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961579.870200][218195:218195] CHIP:DMG: [ + [1666961579.870208][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.870218][218195:218195] CHIP:DMG: { + [1666961579.870227][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.870236][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.870245][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.870253][218195:218195] CHIP:DMG: } + [1666961579.870264][218195:218195] CHIP:DMG: + [1666961579.870272][218195:218195] CHIP:DMG: ], + [1666961579.870283][218195:218195] CHIP:DMG: + [1666961579.870291][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961579.870299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961579.870307][218195:218195] CHIP:DMG: }, + [1666961579.870341][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961579.870367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961579.870376][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961579.870384][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0000 (expanded=0) + [1666961579.870397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v + [1666961579.870409][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961579.870434][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961579.870567][218195:218195] CHIP:EM: <<< [E:57809r M:173952829 (Ack:211280019)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961579.870584][218195:218195] CHIP:IN: (S) Sending msg 173952829 on secure session with LSID: 51709 + [1666961579.870751][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:49700 | 173952829 | [Interaction Model (1) / Report Data (0x05) / Session = 12754 / Exchange = 57809] + [1666961579.870769][218195:218195] CHIP:DMG: Header Flags = + [1666961579.870776][218195:218195] CHIP:DMG: { + [1666961579.870794][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961579.870800][218195:218195] CHIP:DMG: { + [1666961579.870810][218195:218195] CHIP:DMG: AckMsg = 211280019 + [1666961579.870818][218195:218195] CHIP:DMG: NeedsAck = true + [1666961579.870828][218195:218195] CHIP:DMG: } + [1666961579.870844][218195:218195] CHIP:DMG: } + [1666961579.870851][218195:218195] CHIP:DMG: + [1666961579.870862][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961579.870869][218195:218195] CHIP:DMG: { + [1666961579.870877][218195:218195] CHIP:DMG: data = 00d231003d4f5e0abdba620c4ead4243411697906f237c8b0d75654d1c3f2be08ff6a10a58363ac41cb8ebb15d7b2a424ba75a24044fd5b0395df2b49ff555bb9102fb82d920f3e70514aef7a6def7988e00cedff3c0ec50779eda009869e6f8cd63e5543bb834b6b211caccbbbce56038d7887de53664614f04f837f1f4e06da41a2ff37b01864ac4843c + [1666961579.870887][218195:218195] CHIP:DMG: buffer_ptr = 94136416760608 + [1666961579.870894][218195:218195] CHIP:DMG: } + [1666961579.870901][218195:218195] CHIP:DMG: + [1666961579.870915][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961579.870922][218195:218195] CHIP:DMG: { + [1666961579.870930][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d2404001836021818181535012600768e2de0370124020b24031d2404003405183502250000012401011818181535012600768e2de0370124020b24031d240400340518350224001324010118181818290424ff0118 + [1666961579.870939][218195:218195] CHIP:DMG: } + [1666961579.870946][218195:218195] CHIP:DMG: + [1666961579.870998][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961579.871007][218195:218195] CHIP:DMG: { + [1666961579.871014][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961579.871027][218195:218195] CHIP:DMG: [ + [1666961579.871034][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961579.871047][218195:218195] CHIP:DMG: { + [1666961579.871055][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961579.871065][218195:218195] CHIP:DMG: { + [1666961579.871075][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666961579.871108][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.871120][218195:218195] CHIP:DMG: { + [1666961579.871130][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.871142][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.871154][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.871164][218195:218195] CHIP:DMG: } + [1666961579.871176][218195:218195] CHIP:DMG: + [1666961579.871185][218195:218195] CHIP:DMG: Data = [ + [1666961579.871196][218195:218195] CHIP:DMG: + [1666961579.871208][218195:218195] CHIP:DMG: ], + [1666961579.871217][218195:218195] CHIP:DMG: }, + [1666961579.871230][218195:218195] CHIP:DMG: + [1666961579.871237][218195:218195] CHIP:DMG: }, + [1666961579.871255][218195:218195] CHIP:DMG: + [1666961579.871262][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961579.871276][218195:218195] CHIP:DMG: { + [1666961579.871283][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961579.871293][218195:218195] CHIP:DMG: { + [1666961579.871303][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666961579.871311][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.871321][218195:218195] CHIP:DMG: { + [1666961579.871331][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.871342][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.871354][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.871364][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961579.871375][218195:218195] CHIP:DMG: } + [1666961579.871387][218195:218195] CHIP:DMG: + [1666961579.871396][218195:218195] CHIP:DMG: Data = + [1666961579.871405][218195:218195] CHIP:DMG: { + [1666961579.871416][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961579.871427][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961579.871439][218195:218195] CHIP:DMG: }, + [1666961579.871448][218195:218195] CHIP:DMG: }, + [1666961579.871461][218195:218195] CHIP:DMG: + [1666961579.871468][218195:218195] CHIP:DMG: }, + [1666961579.871487][218195:218195] CHIP:DMG: + [1666961579.871494][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961579.871508][218195:218195] CHIP:DMG: { + [1666961579.871516][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961579.871525][218195:218195] CHIP:DMG: { + [1666961579.871535][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666961579.871543][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.871554][218195:218195] CHIP:DMG: { + [1666961579.871563][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.871574][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.871586][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.871597][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961579.871608][218195:218195] CHIP:DMG: } + [1666961579.871620][218195:218195] CHIP:DMG: + [1666961579.871628][218195:218195] CHIP:DMG: Data = + [1666961579.871638][218195:218195] CHIP:DMG: { + [1666961579.871648][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961579.871659][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961579.871670][218195:218195] CHIP:DMG: }, + [1666961579.871679][218195:218195] CHIP:DMG: }, + [1666961579.871692][218195:218195] CHIP:DMG: + [1666961579.871700][218195:218195] CHIP:DMG: }, + [1666961579.871714][218195:218195] CHIP:DMG: + [1666961579.871721][218195:218195] CHIP:DMG: ], + [1666961579.871742][218195:218195] CHIP:DMG: + [1666961579.871750][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961579.871759][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961579.871767][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 12 - Verify the DeviceTypeList attribute response with endpoint 12 On TH(bridge-app) Log: - - [1666961637.024382][218195:218195] CHIP:EM: Handling via exchange: 24264r, Delegate: 0x559dd6ddf8c8 - [1666961637.024406][218195:218195] CHIP:IM: Received Read request - [1666961637.024459][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961637.024477][218195:218195] CHIP:DMG: { - [1666961637.024487][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961637.024501][218195:218195] CHIP:DMG: [ - [1666961637.024514][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.024528][218195:218195] CHIP:DMG: { - [1666961637.024542][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.024555][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.024569][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.024588][218195:218195] CHIP:DMG: } - [1666961637.024599][218195:218195] CHIP:DMG: - [1666961637.024608][218195:218195] CHIP:DMG: ], - [1666961637.024624][218195:218195] CHIP:DMG: - [1666961637.024641][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961637.024651][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961637.024665][218195:218195] CHIP:DMG: }, - [1666961637.024707][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961637.024758][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961637.024774][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961637.024785][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0000 (expanded=0) - [1666961637.024802][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v - [1666961637.024821][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961637.024865][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961637.025090][218195:218195] CHIP:EM: <<< [E:24264r M:129383321 (Ack:149091728)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961637.025123][218195:218195] CHIP:IN: (S) Sending msg 129383321 on secure session with LSID: 51710 - [1666961637.025575][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33508 | 129383321 | [Interaction Model (1) / Report Data (0x05) / Session = 47615 / Exchange = 24264] - [1666961637.025615][218195:218195] CHIP:DMG: Header Flags = - [1666961637.025630][218195:218195] CHIP:DMG: { - [1666961637.025654][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961637.025666][218195:218195] CHIP:DMG: { - [1666961637.025680][218195:218195] CHIP:DMG: AckMsg = 149091728 - [1666961637.025692][218195:218195] CHIP:DMG: NeedsAck = true - [1666961637.025703][218195:218195] CHIP:DMG: } - [1666961637.025722][218195:218195] CHIP:DMG: } - [1666961637.025733][218195:218195] CHIP:DMG: - [1666961637.025754][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961637.025766][218195:218195] CHIP:DMG: { - [1666961637.025779][218195:218195] CHIP:DMG: data = 00ffb900993bb607eb7a6237df23556ef55553d6bdb002eca4dec5b0286b803f131401a010db1aacec9934e01a4728a9e89e4d2474216e665d12fb28265cdb5e9f09d88aa8a7806960884a21b7f21a52c57cac7dd797cdb01ff66e27a1c177ddea3bf84a046a5d4245c3afec579722a901f988a639716e0d4b295494ec005278cca871ae42cb62e25adecf - [1666961637.025796][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 - [1666961637.025807][218195:218195] CHIP:DMG: } - [1666961637.025822][218195:218195] CHIP:DMG: - [1666961637.025845][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961637.025858][218195:218195] CHIP:DMG: { - [1666961637.025871][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d240400183602181818153501260083c07f68370124020c24031d240400340518350225000001240101181818153501260083c07f68370124020c24031d240400340518350224001324010118181818290424ff0118 - [1666961637.025885][218195:218195] CHIP:DMG: } - [1666961637.025899][218195:218195] CHIP:DMG: - [1666961637.025985][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961637.026005][218195:218195] CHIP:DMG: { - [1666961637.026020][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961637.026041][218195:218195] CHIP:DMG: [ - [1666961637.026055][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961637.026076][218195:218195] CHIP:DMG: { - [1666961637.026089][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961637.026106][218195:218195] CHIP:DMG: { - [1666961637.026122][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666961637.026138][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.026155][218195:218195] CHIP:DMG: { - [1666961637.026171][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.026187][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.026205][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.026219][218195:218195] CHIP:DMG: } - [1666961637.026238][218195:218195] CHIP:DMG: - [1666961637.026254][218195:218195] CHIP:DMG: Data = [ - [1666961637.026270][218195:218195] CHIP:DMG: - [1666961637.026288][218195:218195] CHIP:DMG: ], - [1666961637.026303][218195:218195] CHIP:DMG: }, - [1666961637.026323][218195:218195] CHIP:DMG: - [1666961637.026338][218195:218195] CHIP:DMG: }, - [1666961637.026366][218195:218195] CHIP:DMG: - [1666961637.026382][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961637.026405][218195:218195] CHIP:DMG: { - [1666961637.026419][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961637.026435][218195:218195] CHIP:DMG: { - [1666961637.026452][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666961637.026467][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.026483][218195:218195] CHIP:DMG: { - [1666961637.026500][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.026518][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.026536][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.026553][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961637.026568][218195:218195] CHIP:DMG: } - [1666961637.026588][218195:218195] CHIP:DMG: - [1666961637.026605][218195:218195] CHIP:DMG: Data = - [1666961637.026622][218195:218195] CHIP:DMG: { - [1666961637.026640][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961637.026658][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961637.026675][218195:218195] CHIP:DMG: }, - [1666961637.026690][218195:218195] CHIP:DMG: }, - [1666961637.026711][218195:218195] CHIP:DMG: - [1666961637.026726][218195:218195] CHIP:DMG: }, - [1666961637.026754][218195:218195] CHIP:DMG: - [1666961637.026766][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961637.026784][218195:218195] CHIP:DMG: { - [1666961637.026797][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961637.026812][218195:218195] CHIP:DMG: { - [1666961637.026824][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666961637.026835][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.026847][218195:218195] CHIP:DMG: { - [1666961637.026859][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.026873][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.026951][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.027020][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961637.027109][218195:218195] CHIP:DMG: } - [1666961637.027177][218195:218195] CHIP:DMG: - [1666961637.027238][218195:218195] CHIP:DMG: Data = - [1666961637.027299][218195:218195] CHIP:DMG: { - [1666961637.027360][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961637.027423][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961637.027435][218195:218195] CHIP:DMG: }, - [1666961637.027444][218195:218195] CHIP:DMG: }, - [1666961637.027459][218195:218195] CHIP:DMG: - [1666961637.027469][218195:218195] CHIP:DMG: }, - [1666961637.027483][218195:218195] CHIP:DMG: - [1666961637.027492][218195:218195] CHIP:DMG: ], - [1666961637.027515][218195:218195] CHIP:DMG: - [1666961637.027526][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961637.027535][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961637.027543][218195:218195] CHIP:DMG: } - - ./chip-tool descriptor read device-type-list 1 13 - - Verify the DeviceTypeList attribute response with endpoint 13 On TH(bridge-app) Log: - - [1666961681.323410][218195:218195] CHIP:IM: Received Read request - [1666961681.323440][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961681.323447][218195:218195] CHIP:DMG: { - [1666961681.323453][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961681.323460][218195:218195] CHIP:DMG: [ - [1666961681.323466][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.323474][218195:218195] CHIP:DMG: { - [1666961681.323482][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.323489][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.323496][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.323503][218195:218195] CHIP:DMG: } - [1666961681.323511][218195:218195] CHIP:DMG: - [1666961681.323518][218195:218195] CHIP:DMG: ], - [1666961681.323526][218195:218195] CHIP:DMG: - [1666961681.323533][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961681.323540][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961681.323546][218195:218195] CHIP:DMG: }, - [1666961681.323576][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961681.323599][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961681.323607][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961681.323613][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=d AttributeId=0x0000_0000 (expanded=0) - [1666961681.323623][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=13 p=v - [1666961681.323633][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961681.323657][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961681.323781][218195:218195] CHIP:EM: <<< [E:64820r M:54597067 (Ack:45924515)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961681.323794][218195:218195] CHIP:IN: (S) Sending msg 54597067 on secure session with LSID: 51711 - [1666961681.323950][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:40757 | 54597067 | [Interaction Model (1) / Report Data (0x05) / Session = 25741 / Exchange = 64820] - [1666961681.323965][218195:218195] CHIP:DMG: Header Flags = - [1666961681.323971][218195:218195] CHIP:DMG: { - [1666961681.323985][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961681.323991][218195:218195] CHIP:DMG: { - [1666961681.323998][218195:218195] CHIP:DMG: AckMsg = 45924515 - [1666961681.324005][218195:218195] CHIP:DMG: NeedsAck = true - [1666961681.324011][218195:218195] CHIP:DMG: } - [1666961681.324021][218195:218195] CHIP:DMG: } - [1666961681.324027][218195:218195] CHIP:DMG: - [1666961681.324036][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961681.324042][218195:218195] CHIP:DMG: { - [1666961681.324048][218195:218195] CHIP:DMG: data = 008d6400cb154103eb5e2942845edd83b2def815b819a0ad2f2b6f9408c957fe6d6c9b1789eb95a45262bd1acb37dea24b7ec796642f45e24d40e669ec4c98b73dc4d33397be07a15a88117b54c53c87edddec3ad826753cb3232c41b3b9d456a47a33072a87fbda229a89c2d8b2dfb44bda3fb906e24bb2b701e1976e3a2ee601fa0a97ebba57eb4b789a - [1666961681.324056][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 - [1666961681.324062][218195:218195] CHIP:DMG: } - [1666961681.324068][218195:218195] CHIP:DMG: - [1666961681.324079][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961681.324085][218195:218195] CHIP:DMG: { - [1666961681.324091][218195:218195] CHIP:DMG: data = 15360115350126008fecadea370124020d24031d24040018360218181815350126008fecadea370124020d24031d24040034051835022500000124010118181815350126008fecadea370124020d24031d240400340518350224001324010118181818290424ff0118 - [1666961681.324098][218195:218195] CHIP:DMG: } - [1666961681.324104][218195:218195] CHIP:DMG: - [1666961681.324151][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961681.324158][218195:218195] CHIP:DMG: { - [1666961681.324164][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961681.324175][218195:218195] CHIP:DMG: [ - [1666961681.324181][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961681.324191][218195:218195] CHIP:DMG: { - [1666961681.324198][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961681.324206][218195:218195] CHIP:DMG: { - [1666961681.324213][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666961681.324221][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.324228][218195:218195] CHIP:DMG: { - [1666961681.324236][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.324244][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.324252][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.324260][218195:218195] CHIP:DMG: } - [1666961681.324268][218195:218195] CHIP:DMG: - [1666961681.324276][218195:218195] CHIP:DMG: Data = [ - [1666961681.324284][218195:218195] CHIP:DMG: - [1666961681.324292][218195:218195] CHIP:DMG: ], - [1666961681.324298][218195:218195] CHIP:DMG: }, - [1666961681.324308][218195:218195] CHIP:DMG: - [1666961681.324314][218195:218195] CHIP:DMG: }, - [1666961681.324328][218195:218195] CHIP:DMG: - [1666961681.324335][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961681.324346][218195:218195] CHIP:DMG: { - [1666961681.324352][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961681.324360][218195:218195] CHIP:DMG: { - [1666961681.324367][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666961681.324374][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.324382][218195:218195] CHIP:DMG: { - [1666961681.324390][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.324397][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.324406][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.324413][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961681.324420][218195:218195] CHIP:DMG: } - [1666961681.324429][218195:218195] CHIP:DMG: - [1666961681.324437][218195:218195] CHIP:DMG: Data = - [1666961681.324444][218195:218195] CHIP:DMG: { - [1666961681.324452][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961681.324461][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961681.324468][218195:218195] CHIP:DMG: }, - [1666961681.324475][218195:218195] CHIP:DMG: }, - [1666961681.324485][218195:218195] CHIP:DMG: - [1666961681.324492][218195:218195] CHIP:DMG: }, - [1666961681.324507][218195:218195] CHIP:DMG: - [1666961681.324513][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961681.324524][218195:218195] CHIP:DMG: { - [1666961681.324531][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961681.324538][218195:218195] CHIP:DMG: { - [1666961681.324545][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666961681.324552][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.324560][218195:218195] CHIP:DMG: { - [1666961681.324568][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.324575][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.324584][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.324591][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961681.324598][218195:218195] CHIP:DMG: } - [1666961681.324607][218195:218195] CHIP:DMG: - [1666961681.324614][218195:218195] CHIP:DMG: Data = - [1666961681.324622][218195:218195] CHIP:DMG: { - [1666961681.324630][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961681.324638][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961681.324646][218195:218195] CHIP:DMG: }, - [1666961681.324653][218195:218195] CHIP:DMG: }, - [1666961681.324663][218195:218195] CHIP:DMG: - [1666961681.324669][218195:218195] CHIP:DMG: }, - [1666961681.324680][218195:218195] CHIP:DMG: - [1666961681.324686][218195:218195] CHIP:DMG: ], - [1666961681.324704][218195:218195] CHIP:DMG: - [1666961681.324711][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961681.324718][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961681.324724][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 12 On TH(bridge-app) Log: + + [1666961637.024382][218195:218195] CHIP:EM: Handling via exchange: 24264r, Delegate: 0x559dd6ddf8c8 + [1666961637.024406][218195:218195] CHIP:IM: Received Read request + [1666961637.024459][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961637.024477][218195:218195] CHIP:DMG: { + [1666961637.024487][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961637.024501][218195:218195] CHIP:DMG: [ + [1666961637.024514][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.024528][218195:218195] CHIP:DMG: { + [1666961637.024542][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.024555][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.024569][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.024588][218195:218195] CHIP:DMG: } + [1666961637.024599][218195:218195] CHIP:DMG: + [1666961637.024608][218195:218195] CHIP:DMG: ], + [1666961637.024624][218195:218195] CHIP:DMG: + [1666961637.024641][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961637.024651][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961637.024665][218195:218195] CHIP:DMG: }, + [1666961637.024707][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961637.024758][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961637.024774][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961637.024785][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0000 (expanded=0) + [1666961637.024802][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v + [1666961637.024821][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961637.024865][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961637.025090][218195:218195] CHIP:EM: <<< [E:24264r M:129383321 (Ack:149091728)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961637.025123][218195:218195] CHIP:IN: (S) Sending msg 129383321 on secure session with LSID: 51710 + [1666961637.025575][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33508 | 129383321 | [Interaction Model (1) / Report Data (0x05) / Session = 47615 / Exchange = 24264] + [1666961637.025615][218195:218195] CHIP:DMG: Header Flags = + [1666961637.025630][218195:218195] CHIP:DMG: { + [1666961637.025654][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961637.025666][218195:218195] CHIP:DMG: { + [1666961637.025680][218195:218195] CHIP:DMG: AckMsg = 149091728 + [1666961637.025692][218195:218195] CHIP:DMG: NeedsAck = true + [1666961637.025703][218195:218195] CHIP:DMG: } + [1666961637.025722][218195:218195] CHIP:DMG: } + [1666961637.025733][218195:218195] CHIP:DMG: + [1666961637.025754][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961637.025766][218195:218195] CHIP:DMG: { + [1666961637.025779][218195:218195] CHIP:DMG: data = 00ffb900993bb607eb7a6237df23556ef55553d6bdb002eca4dec5b0286b803f131401a010db1aacec9934e01a4728a9e89e4d2474216e665d12fb28265cdb5e9f09d88aa8a7806960884a21b7f21a52c57cac7dd797cdb01ff66e27a1c177ddea3bf84a046a5d4245c3afec579722a901f988a639716e0d4b295494ec005278cca871ae42cb62e25adecf + [1666961637.025796][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 + [1666961637.025807][218195:218195] CHIP:DMG: } + [1666961637.025822][218195:218195] CHIP:DMG: + [1666961637.025845][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961637.025858][218195:218195] CHIP:DMG: { + [1666961637.025871][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d240400183602181818153501260083c07f68370124020c24031d240400340518350225000001240101181818153501260083c07f68370124020c24031d240400340518350224001324010118181818290424ff0118 + [1666961637.025885][218195:218195] CHIP:DMG: } + [1666961637.025899][218195:218195] CHIP:DMG: + [1666961637.025985][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961637.026005][218195:218195] CHIP:DMG: { + [1666961637.026020][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961637.026041][218195:218195] CHIP:DMG: [ + [1666961637.026055][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961637.026076][218195:218195] CHIP:DMG: { + [1666961637.026089][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961637.026106][218195:218195] CHIP:DMG: { + [1666961637.026122][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666961637.026138][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.026155][218195:218195] CHIP:DMG: { + [1666961637.026171][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.026187][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.026205][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.026219][218195:218195] CHIP:DMG: } + [1666961637.026238][218195:218195] CHIP:DMG: + [1666961637.026254][218195:218195] CHIP:DMG: Data = [ + [1666961637.026270][218195:218195] CHIP:DMG: + [1666961637.026288][218195:218195] CHIP:DMG: ], + [1666961637.026303][218195:218195] CHIP:DMG: }, + [1666961637.026323][218195:218195] CHIP:DMG: + [1666961637.026338][218195:218195] CHIP:DMG: }, + [1666961637.026366][218195:218195] CHIP:DMG: + [1666961637.026382][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961637.026405][218195:218195] CHIP:DMG: { + [1666961637.026419][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961637.026435][218195:218195] CHIP:DMG: { + [1666961637.026452][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666961637.026467][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.026483][218195:218195] CHIP:DMG: { + [1666961637.026500][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.026518][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.026536][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.026553][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961637.026568][218195:218195] CHIP:DMG: } + [1666961637.026588][218195:218195] CHIP:DMG: + [1666961637.026605][218195:218195] CHIP:DMG: Data = + [1666961637.026622][218195:218195] CHIP:DMG: { + [1666961637.026640][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961637.026658][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961637.026675][218195:218195] CHIP:DMG: }, + [1666961637.026690][218195:218195] CHIP:DMG: }, + [1666961637.026711][218195:218195] CHIP:DMG: + [1666961637.026726][218195:218195] CHIP:DMG: }, + [1666961637.026754][218195:218195] CHIP:DMG: + [1666961637.026766][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961637.026784][218195:218195] CHIP:DMG: { + [1666961637.026797][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961637.026812][218195:218195] CHIP:DMG: { + [1666961637.026824][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666961637.026835][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.026847][218195:218195] CHIP:DMG: { + [1666961637.026859][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.026873][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.026951][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.027020][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961637.027109][218195:218195] CHIP:DMG: } + [1666961637.027177][218195:218195] CHIP:DMG: + [1666961637.027238][218195:218195] CHIP:DMG: Data = + [1666961637.027299][218195:218195] CHIP:DMG: { + [1666961637.027360][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961637.027423][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961637.027435][218195:218195] CHIP:DMG: }, + [1666961637.027444][218195:218195] CHIP:DMG: }, + [1666961637.027459][218195:218195] CHIP:DMG: + [1666961637.027469][218195:218195] CHIP:DMG: }, + [1666961637.027483][218195:218195] CHIP:DMG: + [1666961637.027492][218195:218195] CHIP:DMG: ], + [1666961637.027515][218195:218195] CHIP:DMG: + [1666961637.027526][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961637.027535][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961637.027543][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 0 - Verify the PartList attribute response with endpoint 0 On TH(bridge-app) Log: - - 1666962087.594430][218195:218195] CHIP:IM: Received Read request - [1666962087.594452][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962087.594457][218195:218195] CHIP:DMG: { - [1666962087.594461][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962087.594466][218195:218195] CHIP:DMG: [ - [1666962087.594473][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.594483][218195:218195] CHIP:DMG: { - [1666962087.594489][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.594494][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.594499][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.594504][218195:218195] CHIP:DMG: } - [1666962087.594509][218195:218195] CHIP:DMG: - [1666962087.594513][218195:218195] CHIP:DMG: ], - [1666962087.594519][218195:218195] CHIP:DMG: - [1666962087.594524][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962087.594529][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962087.594533][218195:218195] CHIP:DMG: }, - [1666962087.594551][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962087.594567][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962087.594574][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962087.594578][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=0 AttributeId=0x0000_0003 (expanded=0) - [1666962087.594597][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=0 p=v - [1666962087.594611][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962087.594645][218195:218195] CHIP:DMG: Sending report (payload has 372 bytes)... - [1666962087.594772][218195:218195] CHIP:EM: <<< [E:39531r M:264814163 (Ack:140364006)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962087.594785][218195:218195] CHIP:IN: (S) Sending msg 264814163 on secure session with LSID: 51714 - [1666962087.594949][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:37487 | 264814163 | [Interaction Model (1) / Report Data (0x05) / Session = 56435 / Exchange = 39531] - [1666962087.594963][218195:218195] CHIP:DMG: Header Flags = - [1666962087.594970][218195:218195] CHIP:DMG: { - [1666962087.594986][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962087.594994][218195:218195] CHIP:DMG: { - [1666962087.595001][218195:218195] CHIP:DMG: AckMsg = 140364006 - [1666962087.595009][218195:218195] CHIP:DMG: NeedsAck = true - [1666962087.595015][218195:218195] CHIP:DMG: } - [1666962087.595026][218195:218195] CHIP:DMG: } - [1666962087.595032][218195:218195] CHIP:DMG: - [1666962087.595041][218195:218195] CHIP:DMG: Encrypted Payload (406 bytes) = - [1666962087.595048][218195:218195] CHIP:DMG: { - [1666962087.595054][218195:218195] CHIP:DMG: data = 0073dc0053bec80fd1f815ed86ead2d3269574276202e8fda951cd767949615968f0abd7254462609c370c3b39ffc94143e532800a998cfed825b833f865684d2b576f864e8a6309d1e1d28d9b818a9ac840b7893ac6f6d1e6e07e4925f98deec5ea7eb10139d1ea7a88d648fd4525446f2954707affa5fa2db1b4844befff709b488421a37533120e455faf2ee2d1109ac04155c51de43ddc324853d09c02e125979fbf4ecf6134d22e2a522ac6cf33155a61a7f5029c5aa83adb97cfd2453236ae11ef77c390a3fff4acd31c43579e251064b6d96b4d3f45561fa8d0b9089af0045eeeb788b8473d8070eb7a6e70dd2daf7c03696edffbb71b5b299306b8409f6ef27ce1eeb5aa065ba299fc886b18548e9ecc1b114841b2b9b1971ed0a199663ee6f3e417cf166ce7235e21e285f31290c0bfabdfcbe0c596ea85d94c9f75db9e1dd06a1d6060ebfd93ca1b2b70056f2c90b82088ec59eec5e55ec07a9ae6a2d4338ea7c58f501dd03fe03045e5abed6ace2ceb4372dcb81a833219f40eac3d90b3b0e5413bbcc22191762d9187b3d58bb8694db8 - [1666962087.595064][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 - [1666962087.595070][218195:218195] CHIP:DMG: } - [1666962087.595076][218195:218195] CHIP:DMG: - [1666962087.595096][218195:218195] CHIP:DMG: Decrypted Payload (372 bytes) = - [1666962087.595104][218195:218195] CHIP:DMG: { - [1666962087.595109][218195:218195] CHIP:DMG: data = 1536011535012600ced288a5370124020024031d2404031836021818181535012600ced288a5370124020024031d24040334051824020118181535012600ced288a5370124020024031d24040334051824020318181535012600ced288a5370124020024031d24040334051824020418181535012600ced288a5370124020024031d24040334051824020518181535012600ced288a5370124020024031d24040334051824020618181535012600ced288a5370124020024031d24040334051824020718181535012600ced288a5370124020024031d24040334051824020818181535012600ced288a5370124020024031d24040334051824020918181535012600ced288a5370124020024031d24040334051824020a18181535012600ced288a5370124020024031d24040334051824020b18181535012600ced288a5370124020024031d24040334051824020c18181535012600ced288a5370124020024031d24040334051824020d181818290424ff0118 - [1666962087.595120][218195:218195] CHIP:DMG: } - [1666962087.595126][218195:218195] CHIP:DMG: - [1666962087.595245][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962087.595252][218195:218195] CHIP:DMG: { - [1666962087.595259][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962087.595270][218195:218195] CHIP:DMG: [ - [1666962087.595276][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595287][218195:218195] CHIP:DMG: { - [1666962087.595294][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595302][218195:218195] CHIP:DMG: { - [1666962087.595310][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595319][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595327][218195:218195] CHIP:DMG: { - [1666962087.595336][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595344][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595353][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595362][218195:218195] CHIP:DMG: } - [1666962087.595373][218195:218195] CHIP:DMG: - [1666962087.595381][218195:218195] CHIP:DMG: Data = [ - [1666962087.595389][218195:218195] CHIP:DMG: - [1666962087.595399][218195:218195] CHIP:DMG: ], - [1666962087.595407][218195:218195] CHIP:DMG: }, - [1666962087.595417][218195:218195] CHIP:DMG: - [1666962087.595423][218195:218195] CHIP:DMG: }, - [1666962087.595436][218195:218195] CHIP:DMG: - [1666962087.595442][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595453][218195:218195] CHIP:DMG: { - [1666962087.595460][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595468][218195:218195] CHIP:DMG: { - [1666962087.595476][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595483][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595491][218195:218195] CHIP:DMG: { - [1666962087.595500][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595510][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595519][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595528][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.595535][218195:218195] CHIP:DMG: } - [1666962087.595545][218195:218195] CHIP:DMG: - [1666962087.595554][218195:218195] CHIP:DMG: Data = 1, - [1666962087.595563][218195:218195] CHIP:DMG: }, - [1666962087.595573][218195:218195] CHIP:DMG: - [1666962087.595580][218195:218195] CHIP:DMG: }, - [1666962087.595595][218195:218195] CHIP:DMG: - [1666962087.595602][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595613][218195:218195] CHIP:DMG: { - [1666962087.595621][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595629][218195:218195] CHIP:DMG: { - [1666962087.595637][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595644][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595652][218195:218195] CHIP:DMG: { - [1666962087.595660][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595670][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595678][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595690][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.595698][218195:218195] CHIP:DMG: } - [1666962087.595708][218195:218195] CHIP:DMG: - [1666962087.595716][218195:218195] CHIP:DMG: Data = 3, - [1666962087.595724][218195:218195] CHIP:DMG: }, - [1666962087.595736][218195:218195] CHIP:DMG: - [1666962087.595743][218195:218195] CHIP:DMG: }, - [1666962087.595756][218195:218195] CHIP:DMG: - [1666962087.595762][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595772][218195:218195] CHIP:DMG: { - [1666962087.595779][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595787][218195:218195] CHIP:DMG: { - [1666962087.595795][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595802][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595810][218195:218195] CHIP:DMG: { - [1666962087.595819][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595828][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595838][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595847][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.595854][218195:218195] CHIP:DMG: } - [1666962087.595864][218195:218195] CHIP:DMG: - [1666962087.595874][218195:218195] CHIP:DMG: Data = 4, - [1666962087.595882][218195:218195] CHIP:DMG: }, - [1666962087.595892][218195:218195] CHIP:DMG: - [1666962087.595899][218195:218195] CHIP:DMG: }, - [1666962087.595912][218195:218195] CHIP:DMG: - [1666962087.595918][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595929][218195:218195] CHIP:DMG: { - [1666962087.595935][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595943][218195:218195] CHIP:DMG: { - [1666962087.595950][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595958][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595966][218195:218195] CHIP:DMG: { - [1666962087.595975][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595985][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595994][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596002][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596009][218195:218195] CHIP:DMG: } - [1666962087.596019][218195:218195] CHIP:DMG: - [1666962087.596027][218195:218195] CHIP:DMG: Data = 5, - [1666962087.596034][218195:218195] CHIP:DMG: }, - [1666962087.596044][218195:218195] CHIP:DMG: - [1666962087.596050][218195:218195] CHIP:DMG: }, - [1666962087.596064][218195:218195] CHIP:DMG: - [1666962087.596070][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596080][218195:218195] CHIP:DMG: { - [1666962087.596086][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596095][218195:218195] CHIP:DMG: { - [1666962087.596102][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596110][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596118][218195:218195] CHIP:DMG: { - [1666962087.596126][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596134][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596143][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596150][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596159][218195:218195] CHIP:DMG: } - [1666962087.596168][218195:218195] CHIP:DMG: - [1666962087.596176][218195:218195] CHIP:DMG: Data = 6, - [1666962087.596183][218195:218195] CHIP:DMG: }, - [1666962087.596193][218195:218195] CHIP:DMG: - [1666962087.596200][218195:218195] CHIP:DMG: }, - [1666962087.596213][218195:218195] CHIP:DMG: - [1666962087.596219][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596230][218195:218195] CHIP:DMG: { - [1666962087.596236][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596244][218195:218195] CHIP:DMG: { - [1666962087.596252][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596259][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596268][218195:218195] CHIP:DMG: { - [1666962087.596276][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596284][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596292][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596300][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596307][218195:218195] CHIP:DMG: } - [1666962087.596318][218195:218195] CHIP:DMG: - [1666962087.596326][218195:218195] CHIP:DMG: Data = 7, - [1666962087.596332][218195:218195] CHIP:DMG: }, - [1666962087.596343][218195:218195] CHIP:DMG: - [1666962087.596349][218195:218195] CHIP:DMG: }, - [1666962087.596362][218195:218195] CHIP:DMG: - [1666962087.596368][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596378][218195:218195] CHIP:DMG: { - [1666962087.596384][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596392][218195:218195] CHIP:DMG: { - [1666962087.596400][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596407][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596416][218195:218195] CHIP:DMG: { - [1666962087.596423][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596432][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596440][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596448][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596455][218195:218195] CHIP:DMG: } - [1666962087.596465][218195:218195] CHIP:DMG: - [1666962087.596474][218195:218195] CHIP:DMG: Data = 8, - [1666962087.596480][218195:218195] CHIP:DMG: }, - [1666962087.596490][218195:218195] CHIP:DMG: - [1666962087.596497][218195:218195] CHIP:DMG: }, - [1666962087.596510][218195:218195] CHIP:DMG: - [1666962087.596516][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596527][218195:218195] CHIP:DMG: { - [1666962087.596533][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596541][218195:218195] CHIP:DMG: { - [1666962087.596549][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596556][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596564][218195:218195] CHIP:DMG: { - [1666962087.596572][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596581][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596590][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596598][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596607][218195:218195] CHIP:DMG: } - [1666962087.596616][218195:218195] CHIP:DMG: - [1666962087.596626][218195:218195] CHIP:DMG: Data = 9, - [1666962087.596633][218195:218195] CHIP:DMG: }, - [1666962087.596643][218195:218195] CHIP:DMG: - [1666962087.596649][218195:218195] CHIP:DMG: }, - [1666962087.596662][218195:218195] CHIP:DMG: - [1666962087.596669][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596679][218195:218195] CHIP:DMG: { - [1666962087.596686][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596694][218195:218195] CHIP:DMG: { - [1666962087.596701][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596709][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596717][218195:218195] CHIP:DMG: { - [1666962087.596725][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596734][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596742][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596750][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596758][218195:218195] CHIP:DMG: } - [1666962087.596768][218195:218195] CHIP:DMG: - [1666962087.596776][218195:218195] CHIP:DMG: Data = 10, - [1666962087.596783][218195:218195] CHIP:DMG: }, - [1666962087.596793][218195:218195] CHIP:DMG: - [1666962087.596799][218195:218195] CHIP:DMG: }, - [1666962087.596812][218195:218195] CHIP:DMG: - [1666962087.596818][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596829][218195:218195] CHIP:DMG: { - [1666962087.596835][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596843][218195:218195] CHIP:DMG: { - [1666962087.596851][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596858][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596867][218195:218195] CHIP:DMG: { - [1666962087.596875][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596883][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596894][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596902][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596909][218195:218195] CHIP:DMG: } - [1666962087.596919][218195:218195] CHIP:DMG: - [1666962087.596927][218195:218195] CHIP:DMG: Data = 11, - [1666962087.596934][218195:218195] CHIP:DMG: }, - [1666962087.596944][218195:218195] CHIP:DMG: - [1666962087.596950][218195:218195] CHIP:DMG: }, - [1666962087.596963][218195:218195] CHIP:DMG: - [1666962087.596973][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596984][218195:218195] CHIP:DMG: { - [1666962087.596990][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596996][218195:218195] CHIP:DMG: { - [1666962087.597002][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.597008][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.597014][218195:218195] CHIP:DMG: { - [1666962087.597021][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.597027][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.597033][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.597039][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.597045][218195:218195] CHIP:DMG: } - [1666962087.597052][218195:218195] CHIP:DMG: - [1666962087.597059][218195:218195] CHIP:DMG: Data = 12, - [1666962087.597064][218195:218195] CHIP:DMG: }, - [1666962087.597072][218195:218195] CHIP:DMG: - [1666962087.597077][218195:218195] CHIP:DMG: }, - [1666962087.597089][218195:218195] CHIP:DMG: - [1666962087.597096][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.597107][218195:218195] CHIP:DMG: { - [1666962087.597113][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.597121][218195:218195] CHIP:DMG: { - [1666962087.597130][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.597137][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.597143][218195:218195] CHIP:DMG: { - [1666962087.597150][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.597159][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.597166][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.597172][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.597178][218195:218195] CHIP:DMG: } - [1666962087.597184][218195:218195] CHIP:DMG: - [1666962087.597190][218195:218195] CHIP:DMG: Data = 13, - [1666962087.597196][218195:218195] CHIP:DMG: }, - [1666962087.597204][218195:218195] CHIP:DMG: - [1666962087.597209][218195:218195] CHIP:DMG: }, - [1666962087.597216][218195:218195] CHIP:DMG: - [1666962087.597220][218195:218195] CHIP:DMG: ], - [1666962087.597256][218195:218195] CHIP:DMG: - [1666962087.597265][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962087.597273][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962087.597279][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 0 On TH(bridge-app) Log: + + 1666962087.594430][218195:218195] CHIP:IM: Received Read request + [1666962087.594452][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962087.594457][218195:218195] CHIP:DMG: { + [1666962087.594461][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962087.594466][218195:218195] CHIP:DMG: [ + [1666962087.594473][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.594483][218195:218195] CHIP:DMG: { + [1666962087.594489][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.594494][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.594499][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.594504][218195:218195] CHIP:DMG: } + [1666962087.594509][218195:218195] CHIP:DMG: + [1666962087.594513][218195:218195] CHIP:DMG: ], + [1666962087.594519][218195:218195] CHIP:DMG: + [1666962087.594524][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962087.594529][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962087.594533][218195:218195] CHIP:DMG: }, + [1666962087.594551][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962087.594567][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962087.594574][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962087.594578][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=0 AttributeId=0x0000_0003 (expanded=0) + [1666962087.594597][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=0 p=v + [1666962087.594611][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962087.594645][218195:218195] CHIP:DMG: Sending report (payload has 372 bytes)... + [1666962087.594772][218195:218195] CHIP:EM: <<< [E:39531r M:264814163 (Ack:140364006)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962087.594785][218195:218195] CHIP:IN: (S) Sending msg 264814163 on secure session with LSID: 51714 + [1666962087.594949][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:37487 | 264814163 | [Interaction Model (1) / Report Data (0x05) / Session = 56435 / Exchange = 39531] + [1666962087.594963][218195:218195] CHIP:DMG: Header Flags = + [1666962087.594970][218195:218195] CHIP:DMG: { + [1666962087.594986][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962087.594994][218195:218195] CHIP:DMG: { + [1666962087.595001][218195:218195] CHIP:DMG: AckMsg = 140364006 + [1666962087.595009][218195:218195] CHIP:DMG: NeedsAck = true + [1666962087.595015][218195:218195] CHIP:DMG: } + [1666962087.595026][218195:218195] CHIP:DMG: } + [1666962087.595032][218195:218195] CHIP:DMG: + [1666962087.595041][218195:218195] CHIP:DMG: Encrypted Payload (406 bytes) = + [1666962087.595048][218195:218195] CHIP:DMG: { + [1666962087.595054][218195:218195] CHIP:DMG: data = 0073dc0053bec80fd1f815ed86ead2d3269574276202e8fda951cd767949615968f0abd7254462609c370c3b39ffc94143e532800a998cfed825b833f865684d2b576f864e8a6309d1e1d28d9b818a9ac840b7893ac6f6d1e6e07e4925f98deec5ea7eb10139d1ea7a88d648fd4525446f2954707affa5fa2db1b4844befff709b488421a37533120e455faf2ee2d1109ac04155c51de43ddc324853d09c02e125979fbf4ecf6134d22e2a522ac6cf33155a61a7f5029c5aa83adb97cfd2453236ae11ef77c390a3fff4acd31c43579e251064b6d96b4d3f45561fa8d0b9089af0045eeeb788b8473d8070eb7a6e70dd2daf7c03696edffbb71b5b299306b8409f6ef27ce1eeb5aa065ba299fc886b18548e9ecc1b114841b2b9b1971ed0a199663ee6f3e417cf166ce7235e21e285f31290c0bfabdfcbe0c596ea85d94c9f75db9e1dd06a1d6060ebfd93ca1b2b70056f2c90b82088ec59eec5e55ec07a9ae6a2d4338ea7c58f501dd03fe03045e5abed6ace2ceb4372dcb81a833219f40eac3d90b3b0e5413bbcc22191762d9187b3d58bb8694db8 + [1666962087.595064][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 + [1666962087.595070][218195:218195] CHIP:DMG: } + [1666962087.595076][218195:218195] CHIP:DMG: + [1666962087.595096][218195:218195] CHIP:DMG: Decrypted Payload (372 bytes) = + [1666962087.595104][218195:218195] CHIP:DMG: { + [1666962087.595109][218195:218195] CHIP:DMG: data = 1536011535012600ced288a5370124020024031d2404031836021818181535012600ced288a5370124020024031d24040334051824020118181535012600ced288a5370124020024031d24040334051824020318181535012600ced288a5370124020024031d24040334051824020418181535012600ced288a5370124020024031d24040334051824020518181535012600ced288a5370124020024031d24040334051824020618181535012600ced288a5370124020024031d24040334051824020718181535012600ced288a5370124020024031d24040334051824020818181535012600ced288a5370124020024031d24040334051824020918181535012600ced288a5370124020024031d24040334051824020a18181535012600ced288a5370124020024031d24040334051824020b18181535012600ced288a5370124020024031d24040334051824020c18181535012600ced288a5370124020024031d24040334051824020d181818290424ff0118 + [1666962087.595120][218195:218195] CHIP:DMG: } + [1666962087.595126][218195:218195] CHIP:DMG: + [1666962087.595245][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962087.595252][218195:218195] CHIP:DMG: { + [1666962087.595259][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962087.595270][218195:218195] CHIP:DMG: [ + [1666962087.595276][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595287][218195:218195] CHIP:DMG: { + [1666962087.595294][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595302][218195:218195] CHIP:DMG: { + [1666962087.595310][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595319][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595327][218195:218195] CHIP:DMG: { + [1666962087.595336][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595344][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595353][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595362][218195:218195] CHIP:DMG: } + [1666962087.595373][218195:218195] CHIP:DMG: + [1666962087.595381][218195:218195] CHIP:DMG: Data = [ + [1666962087.595389][218195:218195] CHIP:DMG: + [1666962087.595399][218195:218195] CHIP:DMG: ], + [1666962087.595407][218195:218195] CHIP:DMG: }, + [1666962087.595417][218195:218195] CHIP:DMG: + [1666962087.595423][218195:218195] CHIP:DMG: }, + [1666962087.595436][218195:218195] CHIP:DMG: + [1666962087.595442][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595453][218195:218195] CHIP:DMG: { + [1666962087.595460][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595468][218195:218195] CHIP:DMG: { + [1666962087.595476][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595483][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595491][218195:218195] CHIP:DMG: { + [1666962087.595500][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595510][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595519][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595528][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.595535][218195:218195] CHIP:DMG: } + [1666962087.595545][218195:218195] CHIP:DMG: + [1666962087.595554][218195:218195] CHIP:DMG: Data = 1, + [1666962087.595563][218195:218195] CHIP:DMG: }, + [1666962087.595573][218195:218195] CHIP:DMG: + [1666962087.595580][218195:218195] CHIP:DMG: }, + [1666962087.595595][218195:218195] CHIP:DMG: + [1666962087.595602][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595613][218195:218195] CHIP:DMG: { + [1666962087.595621][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595629][218195:218195] CHIP:DMG: { + [1666962087.595637][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595644][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595652][218195:218195] CHIP:DMG: { + [1666962087.595660][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595670][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595678][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595690][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.595698][218195:218195] CHIP:DMG: } + [1666962087.595708][218195:218195] CHIP:DMG: + [1666962087.595716][218195:218195] CHIP:DMG: Data = 3, + [1666962087.595724][218195:218195] CHIP:DMG: }, + [1666962087.595736][218195:218195] CHIP:DMG: + [1666962087.595743][218195:218195] CHIP:DMG: }, + [1666962087.595756][218195:218195] CHIP:DMG: + [1666962087.595762][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595772][218195:218195] CHIP:DMG: { + [1666962087.595779][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595787][218195:218195] CHIP:DMG: { + [1666962087.595795][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595802][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595810][218195:218195] CHIP:DMG: { + [1666962087.595819][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595828][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595838][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595847][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.595854][218195:218195] CHIP:DMG: } + [1666962087.595864][218195:218195] CHIP:DMG: + [1666962087.595874][218195:218195] CHIP:DMG: Data = 4, + [1666962087.595882][218195:218195] CHIP:DMG: }, + [1666962087.595892][218195:218195] CHIP:DMG: + [1666962087.595899][218195:218195] CHIP:DMG: }, + [1666962087.595912][218195:218195] CHIP:DMG: + [1666962087.595918][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595929][218195:218195] CHIP:DMG: { + [1666962087.595935][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595943][218195:218195] CHIP:DMG: { + [1666962087.595950][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595958][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595966][218195:218195] CHIP:DMG: { + [1666962087.595975][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595985][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595994][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596002][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596009][218195:218195] CHIP:DMG: } + [1666962087.596019][218195:218195] CHIP:DMG: + [1666962087.596027][218195:218195] CHIP:DMG: Data = 5, + [1666962087.596034][218195:218195] CHIP:DMG: }, + [1666962087.596044][218195:218195] CHIP:DMG: + [1666962087.596050][218195:218195] CHIP:DMG: }, + [1666962087.596064][218195:218195] CHIP:DMG: + [1666962087.596070][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596080][218195:218195] CHIP:DMG: { + [1666962087.596086][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596095][218195:218195] CHIP:DMG: { + [1666962087.596102][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596110][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596118][218195:218195] CHIP:DMG: { + [1666962087.596126][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596134][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596143][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596150][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596159][218195:218195] CHIP:DMG: } + [1666962087.596168][218195:218195] CHIP:DMG: + [1666962087.596176][218195:218195] CHIP:DMG: Data = 6, + [1666962087.596183][218195:218195] CHIP:DMG: }, + [1666962087.596193][218195:218195] CHIP:DMG: + [1666962087.596200][218195:218195] CHIP:DMG: }, + [1666962087.596213][218195:218195] CHIP:DMG: + [1666962087.596219][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596230][218195:218195] CHIP:DMG: { + [1666962087.596236][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596244][218195:218195] CHIP:DMG: { + [1666962087.596252][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596259][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596268][218195:218195] CHIP:DMG: { + [1666962087.596276][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596284][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596292][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596300][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596307][218195:218195] CHIP:DMG: } + [1666962087.596318][218195:218195] CHIP:DMG: + [1666962087.596326][218195:218195] CHIP:DMG: Data = 7, + [1666962087.596332][218195:218195] CHIP:DMG: }, + [1666962087.596343][218195:218195] CHIP:DMG: + [1666962087.596349][218195:218195] CHIP:DMG: }, + [1666962087.596362][218195:218195] CHIP:DMG: + [1666962087.596368][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596378][218195:218195] CHIP:DMG: { + [1666962087.596384][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596392][218195:218195] CHIP:DMG: { + [1666962087.596400][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596407][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596416][218195:218195] CHIP:DMG: { + [1666962087.596423][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596432][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596440][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596448][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596455][218195:218195] CHIP:DMG: } + [1666962087.596465][218195:218195] CHIP:DMG: + [1666962087.596474][218195:218195] CHIP:DMG: Data = 8, + [1666962087.596480][218195:218195] CHIP:DMG: }, + [1666962087.596490][218195:218195] CHIP:DMG: + [1666962087.596497][218195:218195] CHIP:DMG: }, + [1666962087.596510][218195:218195] CHIP:DMG: + [1666962087.596516][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596527][218195:218195] CHIP:DMG: { + [1666962087.596533][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596541][218195:218195] CHIP:DMG: { + [1666962087.596549][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596556][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596564][218195:218195] CHIP:DMG: { + [1666962087.596572][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596581][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596590][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596598][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596607][218195:218195] CHIP:DMG: } + [1666962087.596616][218195:218195] CHIP:DMG: + [1666962087.596626][218195:218195] CHIP:DMG: Data = 9, + [1666962087.596633][218195:218195] CHIP:DMG: }, + [1666962087.596643][218195:218195] CHIP:DMG: + [1666962087.596649][218195:218195] CHIP:DMG: }, + [1666962087.596662][218195:218195] CHIP:DMG: + [1666962087.596669][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596679][218195:218195] CHIP:DMG: { + [1666962087.596686][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596694][218195:218195] CHIP:DMG: { + [1666962087.596701][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596709][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596717][218195:218195] CHIP:DMG: { + [1666962087.596725][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596734][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596742][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596750][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596758][218195:218195] CHIP:DMG: } + [1666962087.596768][218195:218195] CHIP:DMG: + [1666962087.596776][218195:218195] CHIP:DMG: Data = 10, + [1666962087.596783][218195:218195] CHIP:DMG: }, + [1666962087.596793][218195:218195] CHIP:DMG: + [1666962087.596799][218195:218195] CHIP:DMG: }, + [1666962087.596812][218195:218195] CHIP:DMG: + [1666962087.596818][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596829][218195:218195] CHIP:DMG: { + [1666962087.596835][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596843][218195:218195] CHIP:DMG: { + [1666962087.596851][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596858][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596867][218195:218195] CHIP:DMG: { + [1666962087.596875][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596883][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596894][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596902][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596909][218195:218195] CHIP:DMG: } + [1666962087.596919][218195:218195] CHIP:DMG: + [1666962087.596927][218195:218195] CHIP:DMG: Data = 11, + [1666962087.596934][218195:218195] CHIP:DMG: }, + [1666962087.596944][218195:218195] CHIP:DMG: + [1666962087.596950][218195:218195] CHIP:DMG: }, + [1666962087.596963][218195:218195] CHIP:DMG: + [1666962087.596973][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596984][218195:218195] CHIP:DMG: { + [1666962087.596990][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596996][218195:218195] CHIP:DMG: { + [1666962087.597002][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.597008][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.597014][218195:218195] CHIP:DMG: { + [1666962087.597021][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.597027][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.597033][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.597039][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.597045][218195:218195] CHIP:DMG: } + [1666962087.597052][218195:218195] CHIP:DMG: + [1666962087.597059][218195:218195] CHIP:DMG: Data = 12, + [1666962087.597089][218195:218195] CHIP:DMG: + [1666962087.597196][218195:218195] CHIP:DMG: }, + [1666962087.597204][218195:218195] CHIP:DMG: + [1666962087.597209][218195:218195] CHIP:DMG: }, + [1666962087.597216][218195:218195] CHIP:DMG: + [1666962087.597220][218195:218195] CHIP:DMG: ], + [1666962087.597256][218195:218195] CHIP:DMG: + [1666962087.597265][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962087.597273][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962087.597279][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 1 - Verify the PartList attribute response with endpoint 1 On TH(bridge-app) Log: - - [1666962024.475117][218195:218195] CHIP:IM: Received Read request - [1666962024.475146][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962024.475155][218195:218195] CHIP:DMG: { - [1666962024.475161][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962024.475169][218195:218195] CHIP:DMG: [ - [1666962024.475175][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.475184][218195:218195] CHIP:DMG: { - [1666962024.475191][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.475199][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.475207][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.475215][218195:218195] CHIP:DMG: } - [1666962024.475225][218195:218195] CHIP:DMG: - [1666962024.475231][218195:218195] CHIP:DMG: ], - [1666962024.475240][218195:218195] CHIP:DMG: - [1666962024.475248][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962024.475257][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962024.475264][218195:218195] CHIP:DMG: }, - [1666962024.475297][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962024.475327][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962024.475336][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962024.475343][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0003 (expanded=0) - [1666962024.475353][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v - [1666962024.475372][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962024.475414][218195:218195] CHIP:DMG: Sending report (payload has 344 bytes)... - [1666962024.475546][218195:218195] CHIP:EM: <<< [E:54322r M:16539831 (Ack:16060294)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962024.475559][218195:218195] CHIP:IN: (S) Sending msg 16539831 on secure session with LSID: 51713 - [1666962024.475723][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:59192 | 16539831 | [Interaction Model (1) / Report Data (0x05) / Session = 37960 / Exchange = 54322] - [1666962024.475736][218195:218195] CHIP:DMG: Header Flags = - [1666962024.475743][218195:218195] CHIP:DMG: { - [1666962024.475758][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962024.475765][218195:218195] CHIP:DMG: { - [1666962024.475774][218195:218195] CHIP:DMG: AckMsg = 16060294 - [1666962024.475781][218195:218195] CHIP:DMG: NeedsAck = true - [1666962024.475787][218195:218195] CHIP:DMG: } - [1666962024.475799][218195:218195] CHIP:DMG: } - [1666962024.475806][218195:218195] CHIP:DMG: - [1666962024.475817][218195:218195] CHIP:DMG: Encrypted Payload (378 bytes) = - [1666962024.475824][218195:218195] CHIP:DMG: { - [1666962024.475831][218195:218195] CHIP:DMG: data = 00489400b760fc002339da2bb9f859e2c97c0037b5f78ac421947832bdf3d79f6ca2837ffc6ee714ed0a500314e6bb34e8d152d86e23ebfa7aeae2a6c9b66393e25411025eb6e39d6cb98ba50bc51e3eb2d08090404a02bf2d4fcd4bee51ca49731fb58cfe6b222f208e22afe971d36c9f67d6660d107fa90c537f9084e7fb5592aaf0ecfc3521f33f11e56e3132b0d80d51f7653d2f764f3e22cc0680d91c03e370170d6be3d13542b2e61b3996f45327bf467f3d87869bed5109bfbcd38b815ce0e2ec2518f0051327c611c7e1db47981db17fbbd0ff476658336a51ebddde8032d965507be3f043b9b99b18dd8d9468e70b19b6816a7a7a830f868b9e89035dae40c0534215a6031fcb4f937cba32a0c92ba878adeb4d10b708040715763324ce418f351f17de693e6e9c851cf99a1a516418769555619ca1f9b6937f7308814538debb770154646c10c88eaf8a0433cffa841b30f33e43916cf94aca3ea7a9f91d9226acb49c1e549d7c748c026045457ac1527fd2315a80 - [1666962024.475844][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 - [1666962024.475851][218195:218195] CHIP:DMG: } - [1666962024.475858][218195:218195] CHIP:DMG: - [1666962024.475872][218195:218195] CHIP:DMG: Decrypted Payload (344 bytes) = - [1666962024.475879][218195:218195] CHIP:DMG: { - [1666962024.475886][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404031836021818181535012600189f3e59370124020124031d24040334051824020318181535012600189f3e59370124020124031d24040334051824020418181535012600189f3e59370124020124031d24040334051824020518181535012600189f3e59370124020124031d24040334051824020618181535012600189f3e59370124020124031d24040334051824020718181535012600189f3e59370124020124031d24040334051824020818181535012600189f3e59370124020124031d24040334051824020918181535012600189f3e59370124020124031d24040334051824020a18181535012600189f3e59370124020124031d24040334051824020b18181535012600189f3e59370124020124031d24040334051824020c18181535012600189f3e59370124020124031d24040334051824020d181818290424ff0118 - [1666962024.475898][218195:218195] CHIP:DMG: } - [1666962024.475905][218195:218195] CHIP:DMG: - [1666962024.476017][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962024.476024][218195:218195] CHIP:DMG: { - [1666962024.476030][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962024.476043][218195:218195] CHIP:DMG: [ - [1666962024.476050][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476062][218195:218195] CHIP:DMG: { - [1666962024.476071][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476080][218195:218195] CHIP:DMG: { - [1666962024.476089][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476102][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476111][218195:218195] CHIP:DMG: { - [1666962024.476120][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476134][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476144][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476151][218195:218195] CHIP:DMG: } - [1666962024.476160][218195:218195] CHIP:DMG: - [1666962024.476167][218195:218195] CHIP:DMG: Data = [ - [1666962024.476174][218195:218195] CHIP:DMG: - [1666962024.476184][218195:218195] CHIP:DMG: ], - [1666962024.476192][218195:218195] CHIP:DMG: }, - [1666962024.476203][218195:218195] CHIP:DMG: - [1666962024.476208][218195:218195] CHIP:DMG: }, - [1666962024.476219][218195:218195] CHIP:DMG: - [1666962024.476223][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476232][218195:218195] CHIP:DMG: { - [1666962024.476238][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476245][218195:218195] CHIP:DMG: { - [1666962024.476251][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476258][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476265][218195:218195] CHIP:DMG: { - [1666962024.476272][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476279][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476288][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476295][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476301][218195:218195] CHIP:DMG: } - [1666962024.476309][218195:218195] CHIP:DMG: - [1666962024.476316][218195:218195] CHIP:DMG: Data = 3, - [1666962024.476323][218195:218195] CHIP:DMG: }, - [1666962024.476332][218195:218195] CHIP:DMG: - [1666962024.476337][218195:218195] CHIP:DMG: }, - [1666962024.476349][218195:218195] CHIP:DMG: - [1666962024.476354][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476363][218195:218195] CHIP:DMG: { - [1666962024.476369][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476376][218195:218195] CHIP:DMG: { - [1666962024.476383][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476389][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476396][218195:218195] CHIP:DMG: { - [1666962024.476403][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476410][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476418][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476425][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476432][218195:218195] CHIP:DMG: } - [1666962024.476440][218195:218195] CHIP:DMG: - [1666962024.476447][218195:218195] CHIP:DMG: Data = 4, - [1666962024.476453][218195:218195] CHIP:DMG: }, - [1666962024.476462][218195:218195] CHIP:DMG: - [1666962024.476468][218195:218195] CHIP:DMG: }, - [1666962024.476480][218195:218195] CHIP:DMG: - [1666962024.476485][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476494][218195:218195] CHIP:DMG: { - [1666962024.476500][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476507][218195:218195] CHIP:DMG: { - [1666962024.476513][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476520][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476527][218195:218195] CHIP:DMG: { - [1666962024.476534][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476543][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476552][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476560][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476569][218195:218195] CHIP:DMG: } - [1666962024.476577][218195:218195] CHIP:DMG: - [1666962024.476584][218195:218195] CHIP:DMG: Data = 5, - [1666962024.476590][218195:218195] CHIP:DMG: }, - [1666962024.476599][218195:218195] CHIP:DMG: - [1666962024.476605][218195:218195] CHIP:DMG: }, - [1666962024.476616][218195:218195] CHIP:DMG: - [1666962024.476622][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476631][218195:218195] CHIP:DMG: { - [1666962024.476637][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476643][218195:218195] CHIP:DMG: { - [1666962024.476650][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476657][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476664][218195:218195] CHIP:DMG: { - [1666962024.476671][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476678][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476687][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476694][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476703][218195:218195] CHIP:DMG: } - [1666962024.476711][218195:218195] CHIP:DMG: - [1666962024.476718][218195:218195] CHIP:DMG: Data = 6, - [1666962024.476724][218195:218195] CHIP:DMG: }, - [1666962024.476733][218195:218195] CHIP:DMG: - [1666962024.476739][218195:218195] CHIP:DMG: }, - [1666962024.476750][218195:218195] CHIP:DMG: - [1666962024.476756][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476765][218195:218195] CHIP:DMG: { - [1666962024.476771][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476777][218195:218195] CHIP:DMG: { - [1666962024.476784][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476790][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476797][218195:218195] CHIP:DMG: { - [1666962024.476804][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476812][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476820][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476827][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476835][218195:218195] CHIP:DMG: } - [1666962024.476844][218195:218195] CHIP:DMG: - [1666962024.476851][218195:218195] CHIP:DMG: Data = 7, - [1666962024.476858][218195:218195] CHIP:DMG: }, - [1666962024.476867][218195:218195] CHIP:DMG: - [1666962024.476872][218195:218195] CHIP:DMG: }, - [1666962024.476884][218195:218195] CHIP:DMG: - [1666962024.476890][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476898][218195:218195] CHIP:DMG: { - [1666962024.476904][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476911][218195:218195] CHIP:DMG: { - [1666962024.476918][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476926][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476933][218195:218195] CHIP:DMG: { - [1666962024.476940][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476948][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476959][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476968][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476975][218195:218195] CHIP:DMG: } - [1666962024.476983][218195:218195] CHIP:DMG: - [1666962024.476990][218195:218195] CHIP:DMG: Data = 8, - [1666962024.476997][218195:218195] CHIP:DMG: }, - [1666962024.477005][218195:218195] CHIP:DMG: - [1666962024.477011][218195:218195] CHIP:DMG: }, - [1666962024.477022][218195:218195] CHIP:DMG: - [1666962024.477028][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477037][218195:218195] CHIP:DMG: { - [1666962024.477043][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477050][218195:218195] CHIP:DMG: { - [1666962024.477057][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477064][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477071][218195:218195] CHIP:DMG: { - [1666962024.477078][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477087][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477096][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477103][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477111][218195:218195] CHIP:DMG: } - [1666962024.477119][218195:218195] CHIP:DMG: - [1666962024.477127][218195:218195] CHIP:DMG: Data = 9, - [1666962024.477133][218195:218195] CHIP:DMG: }, - [1666962024.477142][218195:218195] CHIP:DMG: - [1666962024.477148][218195:218195] CHIP:DMG: }, - [1666962024.477159][218195:218195] CHIP:DMG: - [1666962024.477165][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477174][218195:218195] CHIP:DMG: { - [1666962024.477180][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477187][218195:218195] CHIP:DMG: { - [1666962024.477193][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477200][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477207][218195:218195] CHIP:DMG: { - [1666962024.477214][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477223][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477232][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477239][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477247][218195:218195] CHIP:DMG: } - [1666962024.477255][218195:218195] CHIP:DMG: - [1666962024.477262][218195:218195] CHIP:DMG: Data = 10, - [1666962024.477269][218195:218195] CHIP:DMG: }, - [1666962024.477278][218195:218195] CHIP:DMG: - [1666962024.477283][218195:218195] CHIP:DMG: }, - [1666962024.477294][218195:218195] CHIP:DMG: - [1666962024.477299][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477308][218195:218195] CHIP:DMG: { - [1666962024.477314][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477321][218195:218195] CHIP:DMG: { - [1666962024.477328][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477335][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477342][218195:218195] CHIP:DMG: { - [1666962024.477350][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477359][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477368][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477376][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477384][218195:218195] CHIP:DMG: } - [1666962024.477393][218195:218195] CHIP:DMG: - [1666962024.477400][218195:218195] CHIP:DMG: Data = 11, - [1666962024.477407][218195:218195] CHIP:DMG: }, - [1666962024.477415][218195:218195] CHIP:DMG: - [1666962024.477421][218195:218195] CHIP:DMG: }, - [1666962024.477433][218195:218195] CHIP:DMG: - [1666962024.477440][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477450][218195:218195] CHIP:DMG: { - [1666962024.477457][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477465][218195:218195] CHIP:DMG: { - [1666962024.477472][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477480][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477488][218195:218195] CHIP:DMG: { - [1666962024.477495][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477504][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477512][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477520][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477527][218195:218195] CHIP:DMG: } - [1666962024.477536][218195:218195] CHIP:DMG: - [1666962024.477545][218195:218195] CHIP:DMG: Data = 12, - [1666962024.477552][218195:218195] CHIP:DMG: }, - [1666962024.477560][218195:218195] CHIP:DMG: - [1666962024.477567][218195:218195] CHIP:DMG: }, - [1666962024.477579][218195:218195] CHIP:DMG: - [1666962024.477586][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477595][218195:218195] CHIP:DMG: { - [1666962024.477601][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477608][218195:218195] CHIP:DMG: { - [1666962024.477614][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477621][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477629][218195:218195] CHIP:DMG: { - [1666962024.477636][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477644][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477651][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477659][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477667][218195:218195] CHIP:DMG: } - [1666962024.477678][218195:218195] CHIP:DMG: - [1666962024.477686][218195:218195] CHIP:DMG: Data = 13, - [1666962024.477694][218195:218195] CHIP:DMG: }, - [1666962024.477703][218195:218195] CHIP:DMG: - [1666962024.477709][218195:218195] CHIP:DMG: }, - [1666962024.477717][218195:218195] CHIP:DMG: - [1666962024.477723][218195:218195] CHIP:DMG: ], - [1666962024.477761][218195:218195] CHIP:DMG: - [1666962024.477768][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962024.477774][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962024.477781][218195:218195] CHIP:DMG: } - [1666962024.477789][218195:218195] CHIP:DMG: - - ./chip-tool descriptor read parts-list 1 2 - - Verify the PartList attribute response with endpoint 2 On TH(bridge-app) Log: - - [1666962122.075925][218195:218195] CHIP:IM: Received Read request - [1666962122.075953][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962122.075960][218195:218195] CHIP:DMG: { - [1666962122.075965][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962122.075972][218195:218195] CHIP:DMG: [ - [1666962122.075978][218195:218195] CHIP:DMG: AttributePathIB = - [1666962122.075985][218195:218195] CHIP:DMG: { - [1666962122.075991][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666962122.075998][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962122.076005][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962122.076011][218195:218195] CHIP:DMG: } - [1666962122.076018][218195:218195] CHIP:DMG: - [1666962122.076025][218195:218195] CHIP:DMG: ], - [1666962122.076032][218195:218195] CHIP:DMG: - [1666962122.076039][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962122.076045][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962122.076050][218195:218195] CHIP:DMG: }, - [1666962122.076076][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962122.076096][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962122.076104][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962122.076109][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=2 AttributeId=0x0000_0003 (expanded=0) - [1666962122.076124][218195:218195] CHIP:DMG: Sending report (payload has 33 bytes)... - [1666962122.076230][218195:218195] CHIP:EM: <<< [E:12842r M:6348185 (Ack:232430163)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962122.076242][218195:218195] CHIP:IN: (S) Sending msg 6348185 on secure session with LSID: 51715 - [1666962122.076377][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:46280 | 6348185 | [Interaction Model (1) / Report Data (0x05) / Session = 23464 / Exchange = 12842] - [1666962122.076393][218195:218195] CHIP:DMG: Header Flags = - [1666962122.076400][218195:218195] CHIP:DMG: { - [1666962122.076416][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962122.076422][218195:218195] CHIP:DMG: { - [1666962122.076431][218195:218195] CHIP:DMG: AckMsg = 232430163 - [1666962122.076438][218195:218195] CHIP:DMG: NeedsAck = true - [1666962122.076445][218195:218195] CHIP:DMG: } - [1666962122.076457][218195:218195] CHIP:DMG: } - [1666962122.076463][218195:218195] CHIP:DMG: - [1666962122.076473][218195:218195] CHIP:DMG: Encrypted Payload (67 bytes) = - [1666962122.076479][218195:218195] CHIP:DMG: { - [1666962122.076485][218195:218195] CHIP:DMG: data = 00a85b0099dd60001e26b5c1cfa1da4d303aea77d3171c34b8d4c5f53620b3db5a353b9220df87512e58952b5ea5b56dffc79121a74544db29f4bb907e23a33d82a0ca - [1666962122.076491][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 - [1666962122.076497][218195:218195] CHIP:DMG: } - [1666962122.076503][218195:218195] CHIP:DMG: - [1666962122.076515][218195:218195] CHIP:DMG: Decrypted Payload (33 bytes) = - [1666962122.076521][218195:218195] CHIP:DMG: { - [1666962122.076529][218195:218195] CHIP:DMG: data = 153601153500370024020224031d24040318350124007f18181818290424ff0118 - [1666962122.076536][218195:218195] CHIP:DMG: } - [1666962122.076542][218195:218195] CHIP:DMG: - [1666962122.076566][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962122.076572][218195:218195] CHIP:DMG: { - [1666962122.076578][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962122.076587][218195:218195] CHIP:DMG: [ - [1666962122.076593][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962122.076602][218195:218195] CHIP:DMG: { - [1666962122.076608][218195:218195] CHIP:DMG: AttributeStatusIB = - [1666962122.076615][218195:218195] CHIP:DMG: { - [1666962122.076621][218195:218195] CHIP:DMG: AttributePathIB = - [1666962122.076628][218195:218195] CHIP:DMG: { - [1666962122.076636][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666962122.076644][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962122.076653][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962122.076660][218195:218195] CHIP:DMG: } - [1666962122.076671][218195:218195] CHIP:DMG: - [1666962122.076678][218195:218195] CHIP:DMG: StatusIB = - [1666962122.076686][218195:218195] CHIP:DMG: { - [1666962122.076694][218195:218195] CHIP:DMG: status = 0x7f (UNSUPPORTED_ENDPOINT), - [1666962122.076702][218195:218195] CHIP:DMG: }, - [1666962122.076708][218195:218195] CHIP:DMG: - [1666962122.076713][218195:218195] CHIP:DMG: }, - [1666962122.076720][218195:218195] CHIP:DMG: - [1666962122.076725][218195:218195] CHIP:DMG: }, - [1666962122.076732][218195:218195] CHIP:DMG: - [1666962122.076736][218195:218195] CHIP:DMG: ], - [1666962122.076744][218195:218195] CHIP:DMG: - [1666962122.076753][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962122.076761][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962122.076769][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 1 On TH(bridge-app) Log: + + [1666962024.475117][218195:218195] CHIP:IM: Received Read request + [1666962024.475146][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962024.475155][218195:218195] CHIP:DMG: { + [1666962024.475161][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962024.475169][218195:218195] CHIP:DMG: [ + [1666962024.475175][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.475184][218195:218195] CHIP:DMG: { + [1666962024.475191][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.475199][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.475207][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.475215][218195:218195] CHIP:DMG: } + [1666962024.475225][218195:218195] CHIP:DMG: + [1666962024.475231][218195:218195] CHIP:DMG: ], + [1666962024.475240][218195:218195] CHIP:DMG: + [1666962024.475248][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962024.475257][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962024.475264][218195:218195] CHIP:DMG: }, + [1666962024.475297][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962024.475327][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962024.475336][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962024.475343][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0003 (expanded=0) + [1666962024.475353][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v + [1666962024.475372][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962024.475414][218195:218195] CHIP:DMG: Sending report (payload has 344 bytes)... + [1666962024.475546][218195:218195] CHIP:EM: <<< [E:54322r M:16539831 (Ack:16060294)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962024.475559][218195:218195] CHIP:IN: (S) Sending msg 16539831 on secure session with LSID: 51713 + [1666962024.475723][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:59192 | 16539831 | [Interaction Model (1) / Report Data (0x05) / Session = 37960 / Exchange = 54322] + [1666962024.475736][218195:218195] CHIP:DMG: Header Flags = + [1666962024.475743][218195:218195] CHIP:DMG: { + [1666962024.475758][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962024.475765][218195:218195] CHIP:DMG: { + [1666962024.475774][218195:218195] CHIP:DMG: AckMsg = 16060294 + [1666962024.475781][218195:218195] CHIP:DMG: NeedsAck = true + [1666962024.475787][218195:218195] CHIP:DMG: } + [1666962024.475799][218195:218195] CHIP:DMG: } + [1666962024.475806][218195:218195] CHIP:DMG: + [1666962024.475817][218195:218195] CHIP:DMG: Encrypted Payload (378 bytes) = + [1666962024.475824][218195:218195] CHIP:DMG: { + [1666962024.475831][218195:218195] CHIP:DMG: data = 00489400b760fc002339da2bb9f859e2c97c0037b5f78ac421947832bdf3d79f6ca2837ffc6ee714ed0a500314e6bb34e8d152d86e23ebfa7aeae2a6c9b66393e25411025eb6e39d6cb98ba50bc51e3eb2d08090404a02bf2d4fcd4bee51ca49731fb58cfe6b222f208e22afe971d36c9f67d6660d107fa90c537f9084e7fb5592aaf0ecfc3521f33f11e56e3132b0d80d51f7653d2f764f3e22cc0680d91c03e370170d6be3d13542b2e61b3996f45327bf467f3d87869bed5109bfbcd38b815ce0e2ec2518f0051327c611c7e1db47981db17fbbd0ff476658336a51ebddde8032d965507be3f043b9b99b18dd8d9468e70b19b6816a7a7a830f868b9e89035dae40c0534215a6031fcb4f937cba32a0c92ba878adeb4d10b708040715763324ce418f351f17de693e6e9c851cf99a1a516418769555619ca1f9b6937f7308814538debb770154646c10c88eaf8a0433cffa841b30f33e43916cf94aca3ea7a9f91d9226acb49c1e549d7c748c026045457ac1527fd2315a80 + [1666962024.475844][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 + [1666962024.475851][218195:218195] CHIP:DMG: } + [1666962024.475858][218195:218195] CHIP:DMG: + [1666962024.475872][218195:218195] CHIP:DMG: Decrypted Payload (344 bytes) = + [1666962024.475879][218195:218195] CHIP:DMG: { + [1666962024.475886][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404031836021818181535012600189f3e59370124020124031d24040334051824020318181535012600189f3e59370124020124031d24040334051824020418181535012600189f3e59370124020124031d24040334051824020518181535012600189f3e59370124020124031d24040334051824020618181535012600189f3e59370124020124031d24040334051824020718181535012600189f3e59370124020124031d24040334051824020818181535012600189f3e59370124020124031d24040334051824020918181535012600189f3e59370124020124031d24040334051824020a18181535012600189f3e59370124020124031d24040334051824020b18181535012600189f3e59370124020124031d24040334051824020c18181535012600189f3e59370124020124031d24040334051824020d181818290424ff0118 + [1666962024.475898][218195:218195] CHIP:DMG: } + [1666962024.475905][218195:218195] CHIP:DMG: + [1666962024.476017][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962024.476024][218195:218195] CHIP:DMG: { + [1666962024.476030][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962024.476043][218195:218195] CHIP:DMG: [ + [1666962024.476050][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476062][218195:218195] CHIP:DMG: { + [1666962024.476071][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476080][218195:218195] CHIP:DMG: { + [1666962024.476089][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476102][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476111][218195:218195] CHIP:DMG: { + [1666962024.476120][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476134][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476144][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476151][218195:218195] CHIP:DMG: } + [1666962024.476160][218195:218195] CHIP:DMG: + [1666962024.476167][218195:218195] CHIP:DMG: Data = [ + [1666962024.476174][218195:218195] CHIP:DMG: + [1666962024.476184][218195:218195] CHIP:DMG: ], + [1666962024.476192][218195:218195] CHIP:DMG: }, + [1666962024.476203][218195:218195] CHIP:DMG: + [1666962024.476208][218195:218195] CHIP:DMG: }, + [1666962024.476219][218195:218195] CHIP:DMG: + [1666962024.476223][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476232][218195:218195] CHIP:DMG: { + [1666962024.476238][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476245][218195:218195] CHIP:DMG: { + [1666962024.476251][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476258][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476265][218195:218195] CHIP:DMG: { + [1666962024.476272][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476279][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476288][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476295][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476301][218195:218195] CHIP:DMG: } + [1666962024.476309][218195:218195] CHIP:DMG: + [1666962024.476316][218195:218195] CHIP:DMG: Data = 3, + [1666962024.476323][218195:218195] CHIP:DMG: }, + [1666962024.476332][218195:218195] CHIP:DMG: + [1666962024.476337][218195:218195] CHIP:DMG: }, + [1666962024.476349][218195:218195] CHIP:DMG: + [1666962024.476354][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476363][218195:218195] CHIP:DMG: { + [1666962024.476369][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476376][218195:218195] CHIP:DMG: { + [1666962024.476383][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476389][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476396][218195:218195] CHIP:DMG: { + [1666962024.476403][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476410][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476418][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476425][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476432][218195:218195] CHIP:DMG: } + [1666962024.476440][218195:218195] CHIP:DMG: + [1666962024.476447][218195:218195] CHIP:DMG: Data = 4, + [1666962024.476453][218195:218195] CHIP:DMG: }, + [1666962024.476462][218195:218195] CHIP:DMG: + [1666962024.476468][218195:218195] CHIP:DMG: }, + [1666962024.476480][218195:218195] CHIP:DMG: + [1666962024.476485][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476494][218195:218195] CHIP:DMG: { + [1666962024.476500][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476507][218195:218195] CHIP:DMG: { + [1666962024.476513][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476520][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476527][218195:218195] CHIP:DMG: { + [1666962024.476534][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476543][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476552][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476560][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476569][218195:218195] CHIP:DMG: } + [1666962024.476577][218195:218195] CHIP:DMG: + [1666962024.476584][218195:218195] CHIP:DMG: Data = 5, + [1666962024.476590][218195:218195] CHIP:DMG: }, + [1666962024.476599][218195:218195] CHIP:DMG: + [1666962024.476605][218195:218195] CHIP:DMG: }, + [1666962024.476616][218195:218195] CHIP:DMG: + [1666962024.476622][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476631][218195:218195] CHIP:DMG: { + [1666962024.476637][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476643][218195:218195] CHIP:DMG: { + [1666962024.476650][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476657][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476664][218195:218195] CHIP:DMG: { + [1666962024.476671][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476678][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476687][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476694][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476703][218195:218195] CHIP:DMG: } + [1666962024.476711][218195:218195] CHIP:DMG: + [1666962024.476718][218195:218195] CHIP:DMG: Data = 6, + [1666962024.476724][218195:218195] CHIP:DMG: }, + [1666962024.476733][218195:218195] CHIP:DMG: + [1666962024.476739][218195:218195] CHIP:DMG: }, + [1666962024.476750][218195:218195] CHIP:DMG: + [1666962024.476756][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476765][218195:218195] CHIP:DMG: { + [1666962024.476771][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476777][218195:218195] CHIP:DMG: { + [1666962024.476784][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476790][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476797][218195:218195] CHIP:DMG: { + [1666962024.476804][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476812][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476820][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476827][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476835][218195:218195] CHIP:DMG: } + [1666962024.476844][218195:218195] CHIP:DMG: + [1666962024.476851][218195:218195] CHIP:DMG: Data = 7, + [1666962024.476858][218195:218195] CHIP:DMG: }, + [1666962024.476867][218195:218195] CHIP:DMG: + [1666962024.476872][218195:218195] CHIP:DMG: }, + [1666962024.476884][218195:218195] CHIP:DMG: + [1666962024.476890][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476898][218195:218195] CHIP:DMG: { + [1666962024.476904][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476911][218195:218195] CHIP:DMG: { + [1666962024.476918][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476926][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476933][218195:218195] CHIP:DMG: { + [1666962024.476940][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476948][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476959][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476968][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476975][218195:218195] CHIP:DMG: } + [1666962024.476983][218195:218195] CHIP:DMG: + [1666962024.476990][218195:218195] CHIP:DMG: Data = 8, + [1666962024.476997][218195:218195] CHIP:DMG: }, + [1666962024.477005][218195:218195] CHIP:DMG: + [1666962024.477011][218195:218195] CHIP:DMG: }, + [1666962024.477022][218195:218195] CHIP:DMG: + [1666962024.477028][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477037][218195:218195] CHIP:DMG: { + [1666962024.477043][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477050][218195:218195] CHIP:DMG: { + [1666962024.477057][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477064][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477071][218195:218195] CHIP:DMG: { + [1666962024.477078][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477087][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477096][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477103][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477111][218195:218195] CHIP:DMG: } + [1666962024.477119][218195:218195] CHIP:DMG: + [1666962024.477127][218195:218195] CHIP:DMG: Data = 9, + [1666962024.477133][218195:218195] CHIP:DMG: }, + [1666962024.477142][218195:218195] CHIP:DMG: + [1666962024.477148][218195:218195] CHIP:DMG: }, + [1666962024.477159][218195:218195] CHIP:DMG: + [1666962024.477165][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477174][218195:218195] CHIP:DMG: { + [1666962024.477180][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477187][218195:218195] CHIP:DMG: { + [1666962024.477193][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477200][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477207][218195:218195] CHIP:DMG: { + [1666962024.477214][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477223][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477232][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477239][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477247][218195:218195] CHIP:DMG: } + [1666962024.477255][218195:218195] CHIP:DMG: + [1666962024.477262][218195:218195] CHIP:DMG: Data = 10, + [1666962024.477269][218195:218195] CHIP:DMG: }, + [1666962024.477278][218195:218195] CHIP:DMG: + [1666962024.477283][218195:218195] CHIP:DMG: }, + [1666962024.477294][218195:218195] CHIP:DMG: + [1666962024.477299][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477308][218195:218195] CHIP:DMG: { + [1666962024.477314][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477321][218195:218195] CHIP:DMG: { + [1666962024.477328][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477335][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477342][218195:218195] CHIP:DMG: { + [1666962024.477350][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477359][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477368][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477376][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477384][218195:218195] CHIP:DMG: } + [1666962024.477393][218195:218195] CHIP:DMG: + [1666962024.477400][218195:218195] CHIP:DMG: Data = 11, + [1666962024.477407][218195:218195] CHIP:DMG: }, + [1666962024.477415][218195:218195] CHIP:DMG: + [1666962024.477421][218195:218195] CHIP:DMG: }, + [1666962024.477433][218195:218195] CHIP:DMG: + [1666962024.477440][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477450][218195:218195] CHIP:DMG: { + [1666962024.477457][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477465][218195:218195] CHIP:DMG: { + [1666962024.477472][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477480][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477488][218195:218195] CHIP:DMG: { + [1666962024.477495][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477504][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477512][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477520][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477527][218195:218195] CHIP:DMG: } + [1666962024.477536][218195:218195] CHIP:DMG: + [1666962024.477545][218195:218195] CHIP:DMG: Data = 12, + [1666962024.477552][218195:218195] CHIP:DMG: }, + [1666962024.477560][218195:218195] CHIP:DMG: + [1666962024.477567][218195:218195] CHIP:DMG: }, + [1666962024.477579][218195:218195] CHIP:DMG: + [1666962024.477586][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477595][218195:218195] CHIP:DMG: { + [1666962024.477601][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477608][218195:218195] CHIP:DMG: { + [1666962024.477614][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477621][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477629][218195:218195] CHIP:DMG: { + [1666962024.477636][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477644][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477651][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477659][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477667][218195:218195] CHIP:DMG: } + [1666962024.477678][218195:218195] CHIP:DMG: + [1666962024.477686][218195:218195] CHIP:DMG: Data = 13, + [1666962024.477694][218195:218195] CHIP:DMG: }, + [1666962024.477703][218195:218195] CHIP:DMG: + [1666962024.477709][218195:218195] CHIP:DMG: }, + [1666962024.477717][218195:218195] CHIP:DMG: + [1666962024.477723][218195:218195] CHIP:DMG: ], + [1666962024.477761][218195:218195] CHIP:DMG: + [1666962024.477768][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962024.477774][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962024.477781][218195:218195] CHIP:DMG: } + [1666962024.477789][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 3 - Verify the PartList attribute response with endpoint 3 On TH(bridge-app) Log: - - [1666962181.272370][218195:218195] CHIP:IM: Received Read request - [1666962181.272431][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962181.272451][218195:218195] CHIP:DMG: { - [1666962181.272466][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962181.272482][218195:218195] CHIP:DMG: [ - [1666962181.272497][218195:218195] CHIP:DMG: AttributePathIB = - [1666962181.272515][218195:218195] CHIP:DMG: { - [1666962181.272532][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666962181.272548][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962181.272565][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962181.272581][218195:218195] CHIP:DMG: } - [1666962181.272599][218195:218195] CHIP:DMG: - [1666962181.272614][218195:218195] CHIP:DMG: ], - [1666962181.272633][218195:218195] CHIP:DMG: - [1666962181.272649][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962181.272665][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962181.272679][218195:218195] CHIP:DMG: }, - [1666962181.272736][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962181.272791][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962181.272810][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962181.272825][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0003 (expanded=0) - [1666962181.272846][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v - [1666962181.272869][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962181.272906][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962181.273115][218195:218195] CHIP:EM: <<< [E:46913r M:111572064 (Ack:187764321)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962181.273146][218195:218195] CHIP:IN: (S) Sending msg 111572064 on secure session with LSID: 51716 - [1666962181.273415][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36413 | 111572064 | [Interaction Model (1) / Report Data (0x05) / Session = 7119 / Exchange = 46913] - [1666962181.273447][218195:218195] CHIP:DMG: Header Flags = - [1666962181.273465][218195:218195] CHIP:DMG: { - [1666962181.273492][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962181.273507][218195:218195] CHIP:DMG: { - [1666962181.273523][218195:218195] CHIP:DMG: AckMsg = 187764321 - [1666962181.273536][218195:218195] CHIP:DMG: NeedsAck = true - [1666962181.273550][218195:218195] CHIP:DMG: } - [1666962181.273572][218195:218195] CHIP:DMG: } - [1666962181.273585][218195:218195] CHIP:DMG: - [1666962181.273605][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962181.273619][218195:218195] CHIP:DMG: { - [1666962181.273633][218195:218195] CHIP:DMG: data = 00cf1b006074a606d86a9f1f8d1116587d199c334287a090de625e1267cae0122cf9bb9514247ab1b27ca9ec853fc523ff013060a7845eaf1b9fc336790bc3d8e2e7bf06a5fc - [1666962181.273649][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 - [1666962181.273663][218195:218195] CHIP:DMG: } - [1666962181.273676][218195:218195] CHIP:DMG: - [1666962181.273697][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962181.273717][218195:218195] CHIP:DMG: { - [1666962181.273738][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d24040318360218181818290424ff0118 - [1666962181.273753][218195:218195] CHIP:DMG: } - [1666962181.273766][218195:218195] CHIP:DMG: - [1666962181.273823][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962181.273840][218195:218195] CHIP:DMG: { - [1666962181.273851][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962181.273876][218195:218195] CHIP:DMG: [ - [1666962181.273891][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962181.273916][218195:218195] CHIP:DMG: { - [1666962181.273933][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962181.273954][218195:218195] CHIP:DMG: { - [1666962181.273972][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666962181.273988][218195:218195] CHIP:DMG: AttributePathIB = - [1666962181.274005][218195:218195] CHIP:DMG: { - [1666962181.274022][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666962181.274041][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962181.274062][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962181.274082][218195:218195] CHIP:DMG: } - [1666962181.274102][218195:218195] CHIP:DMG: - [1666962181.274124][218195:218195] CHIP:DMG: Data = [ - [1666962181.274145][218195:218195] CHIP:DMG: - [1666962181.274165][218195:218195] CHIP:DMG: ], - [1666962181.274182][218195:218195] CHIP:DMG: }, - [1666962181.274206][218195:218195] CHIP:DMG: - [1666962181.274224][218195:218195] CHIP:DMG: }, - [1666962181.274248][218195:218195] CHIP:DMG: - [1666962181.274266][218195:218195] CHIP:DMG: ], - [1666962181.274288][218195:218195] CHIP:DMG: - [1666962181.274303][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962181.274318][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962181.274337][218195:218195] CHIP:DMG: } - [1666962181.274354][218195:218195] CHIP:DMG: + Verify the PartList attribute response with endpoint 3 On TH(bridge-app) Log: + + [1666962181.272370][218195:218195] CHIP:IM: Received Read request + [1666962181.272431][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962181.272451][218195:218195] CHIP:DMG: { + [1666962181.272466][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962181.272482][218195:218195] CHIP:DMG: [ + [1666962181.272497][218195:218195] CHIP:DMG: AttributePathIB = + [1666962181.272515][218195:218195] CHIP:DMG: { + [1666962181.272532][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666962181.272548][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962181.272565][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962181.272581][218195:218195] CHIP:DMG: } + [1666962181.272599][218195:218195] CHIP:DMG: + [1666962181.272614][218195:218195] CHIP:DMG: ], + [1666962181.272633][218195:218195] CHIP:DMG: + [1666962181.272649][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962181.272665][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962181.272679][218195:218195] CHIP:DMG: }, + [1666962181.272736][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962181.272791][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962181.272810][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962181.272825][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0003 (expanded=0) + [1666962181.272846][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v + [1666962181.272869][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962181.272906][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962181.273115][218195:218195] CHIP:EM: <<< [E:46913r M:111572064 (Ack:187764321)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962181.273146][218195:218195] CHIP:IN: (S) Sending msg 111572064 on secure session with LSID: 51716 + [1666962181.273415][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36413 | 111572064 | [Interaction Model (1) / Report Data (0x05) / Session = 7119 / Exchange = 46913] + [1666962181.273447][218195:218195] CHIP:DMG: Header Flags = + [1666962181.273465][218195:218195] CHIP:DMG: { + [1666962181.273492][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962181.273507][218195:218195] CHIP:DMG: { + [1666962181.273523][218195:218195] CHIP:DMG: AckMsg = 187764321 + [1666962181.273536][218195:218195] CHIP:DMG: NeedsAck = true + [1666962181.273550][218195:218195] CHIP:DMG: } + [1666962181.273572][218195:218195] CHIP:DMG: } + [1666962181.273585][218195:218195] CHIP:DMG: + [1666962181.273605][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962181.273619][218195:218195] CHIP:DMG: { + [1666962181.273633][218195:218195] CHIP:DMG: data = 00cf1b006074a606d86a9f1f8d1116587d199c334287a090de625e1267cae0122cf9bb9514247ab1b27ca9ec853fc523ff013060a7845eaf1b9fc336790bc3d8e2e7bf06a5fc + [1666962181.273649][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 + [1666962181.273663][218195:218195] CHIP:DMG: } + [1666962181.273676][218195:218195] CHIP:DMG: + [1666962181.273697][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962181.273717][218195:218195] CHIP:DMG: { + [1666962181.273738][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d24040318360218181818290424ff0118 + [1666962181.273753][218195:218195] CHIP:DMG: } + [1666962181.273766][218195:218195] CHIP:DMG: + [1666962181.273823][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962181.273840][218195:218195] CHIP:DMG: { + [1666962181.273851][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962181.273876][218195:218195] CHIP:DMG: [ + [1666962181.273891][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962181.273916][218195:218195] CHIP:DMG: { + [1666962181.273933][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962181.273954][218195:218195] CHIP:DMG: { + [1666962181.273972][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666962181.273988][218195:218195] CHIP:DMG: AttributePathIB = + [1666962181.274005][218195:218195] CHIP:DMG: { + [1666962181.274022][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666962181.274041][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962181.274062][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962181.274082][218195:218195] CHIP:DMG: } + [1666962181.274102][218195:218195] CHIP:DMG: + [1666962181.274124][218195:218195] CHIP:DMG: Data = [ + [1666962181.274145][218195:218195] CHIP:DMG: + [1666962181.274165][218195:218195] CHIP:DMG: ], + [1666962181.274182][218195:218195] CHIP:DMG: }, + [1666962181.274206][218195:218195] CHIP:DMG: + [1666962181.274224][218195:218195] CHIP:DMG: }, + [1666962181.274248][218195:218195] CHIP:DMG: + [1666962181.274266][218195:218195] CHIP:DMG: ], + [1666962181.274288][218195:218195] CHIP:DMG: + [1666962181.274303][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962181.274318][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962181.274337][218195:218195] CHIP:DMG: } + [1666962181.274354][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 4 - Verify the PartList attribute response with endpoint 4 On TH(bridge-app) Log: - - [1666962226.211067][218195:218195] CHIP:IM: Received Read request - [1666962226.211160][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962226.211169][218195:218195] CHIP:DMG: { - [1666962226.211175][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962226.211183][218195:218195] CHIP:DMG: [ - [1666962226.211190][218195:218195] CHIP:DMG: AttributePathIB = - [1666962226.211200][218195:218195] CHIP:DMG: { - [1666962226.211209][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666962226.211218][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962226.211227][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962226.211235][218195:218195] CHIP:DMG: } - [1666962226.211245][218195:218195] CHIP:DMG: - [1666962226.211253][218195:218195] CHIP:DMG: ], - [1666962226.211263][218195:218195] CHIP:DMG: - [1666962226.211272][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962226.211280][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962226.211288][218195:218195] CHIP:DMG: }, - [1666962226.211319][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962226.211353][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962226.211363][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962226.211370][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0003 (expanded=0) - [1666962226.211382][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v - [1666962226.211396][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962226.211419][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962226.211532][218195:218195] CHIP:EM: <<< [E:32390r M:201985649 (Ack:262416764)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962226.211551][218195:218195] CHIP:IN: (S) Sending msg 201985649 on secure session with LSID: 51717 - [1666962226.211699][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:55096 | 201985649 | [Interaction Model (1) / Report Data (0x05) / Session = 41621 / Exchange = 32390] - [1666962226.211711][218195:218195] CHIP:DMG: Header Flags = - [1666962226.211715][218195:218195] CHIP:DMG: { - [1666962226.211726][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962226.211731][218195:218195] CHIP:DMG: { - [1666962226.211736][218195:218195] CHIP:DMG: AckMsg = 262416764 - [1666962226.211741][218195:218195] CHIP:DMG: NeedsAck = true - [1666962226.211745][218195:218195] CHIP:DMG: } - [1666962226.211753][218195:218195] CHIP:DMG: } - [1666962226.211758][218195:218195] CHIP:DMG: - [1666962226.211764][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962226.211769][218195:218195] CHIP:DMG: { - [1666962226.211773][218195:218195] CHIP:DMG: data = 0095a200710e0a0c886c3b3bdc1e7f2be7778df8c8dda3541891bd0743b7a912e9ccfd60902082784e8e2247f9d2628f782007da5ae8eab65680617b41888803918f2bcd05b6 - [1666962226.211778][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962226.211783][218195:218195] CHIP:DMG: } - [1666962226.211787][218195:218195] CHIP:DMG: - [1666962226.211795][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962226.211799][218195:218195] CHIP:DMG: { - [1666962226.211804][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d24040318360218181818290424ff0118 - [1666962226.211809][218195:218195] CHIP:DMG: } - [1666962226.211813][218195:218195] CHIP:DMG: - [1666962226.211835][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962226.211840][218195:218195] CHIP:DMG: { - [1666962226.211844][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962226.211852][218195:218195] CHIP:DMG: [ - [1666962226.211857][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962226.211865][218195:218195] CHIP:DMG: { - [1666962226.211870][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962226.211875][218195:218195] CHIP:DMG: { - [1666962226.211881][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666962226.211887][218195:218195] CHIP:DMG: AttributePathIB = - [1666962226.211892][218195:218195] CHIP:DMG: { - [1666962226.211898][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666962226.211904][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962226.211911][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962226.211916][218195:218195] CHIP:DMG: } - [1666962226.211923][218195:218195] CHIP:DMG: - [1666962226.211928][218195:218195] CHIP:DMG: Data = [ - [1666962226.211934][218195:218195] CHIP:DMG: - [1666962226.211940][218195:218195] CHIP:DMG: ], - [1666962226.211945][218195:218195] CHIP:DMG: }, - [1666962226.211952][218195:218195] CHIP:DMG: - [1666962226.211957][218195:218195] CHIP:DMG: }, - [1666962226.211965][218195:218195] CHIP:DMG: - [1666962226.211969][218195:218195] CHIP:DMG: ], - [1666962226.211977][218195:218195] CHIP:DMG: - [1666962226.211982][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962226.211987][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962226.211991][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 4 On TH(bridge-app) Log: + + [1666962226.211067][218195:218195] CHIP:IM: Received Read request + [1666962226.211160][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962226.211169][218195:218195] CHIP:DMG: { + [1666962226.211175][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962226.211183][218195:218195] CHIP:DMG: [ + [1666962226.211190][218195:218195] CHIP:DMG: AttributePathIB = + [1666962226.211200][218195:218195] CHIP:DMG: { + [1666962226.211209][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666962226.211218][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962226.211227][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962226.211235][218195:218195] CHIP:DMG: } + [1666962226.211245][218195:218195] CHIP:DMG: + [1666962226.211253][218195:218195] CHIP:DMG: ], + [1666962226.211263][218195:218195] CHIP:DMG: + [1666962226.211272][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962226.211280][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962226.211288][218195:218195] CHIP:DMG: }, + [1666962226.211319][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962226.211353][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962226.211363][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962226.211370][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0003 (expanded=0) + [1666962226.211382][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v + [1666962226.211396][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962226.211419][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962226.211532][218195:218195] CHIP:EM: <<< [E:32390r M:201985649 (Ack:262416764)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962226.211551][218195:218195] CHIP:IN: (S) Sending msg 201985649 on secure session with LSID: 51717 + [1666962226.211699][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:55096 | 201985649 | [Interaction Model (1) / Report Data (0x05) / Session = 41621 / Exchange = 32390] + [1666962226.211711][218195:218195] CHIP:DMG: Header Flags = + [1666962226.211715][218195:218195] CHIP:DMG: { + [1666962226.211726][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962226.211731][218195:218195] CHIP:DMG: { + [1666962226.211736][218195:218195] CHIP:DMG: AckMsg = 262416764 + [1666962226.211741][218195:218195] CHIP:DMG: NeedsAck = true + [1666962226.211745][218195:218195] CHIP:DMG: } + [1666962226.211753][218195:218195] CHIP:DMG: } + [1666962226.211758][218195:218195] CHIP:DMG: + [1666962226.211764][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962226.211769][218195:218195] CHIP:DMG: { + [1666962226.211773][218195:218195] CHIP:DMG: data = 0095a200710e0a0c886c3b3bdc1e7f2be7778df8c8dda3541891bd0743b7a912e9ccfd60902082784e8e2247f9d2628f782007da5ae8eab65680617b41888803918f2bcd05b6 + [1666962226.211778][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962226.211783][218195:218195] CHIP:DMG: } + [1666962226.211787][218195:218195] CHIP:DMG: + [1666962226.211795][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962226.211799][218195:218195] CHIP:DMG: { + [1666962226.211804][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d24040318360218181818290424ff0118 + [1666962226.211809][218195:218195] CHIP:DMG: } + [1666962226.211813][218195:218195] CHIP:DMG: + [1666962226.211835][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962226.211840][218195:218195] CHIP:DMG: { + [1666962226.211844][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962226.211852][218195:218195] CHIP:DMG: [ + [1666962226.211857][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962226.211865][218195:218195] CHIP:DMG: { + [1666962226.211870][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962226.211875][218195:218195] CHIP:DMG: { + [1666962226.211881][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666962226.211887][218195:218195] CHIP:DMG: AttributePathIB = + [1666962226.211892][218195:218195] CHIP:DMG: { + [1666962226.211898][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666962226.211904][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962226.211911][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962226.211916][218195:218195] CHIP:DMG: } + [1666962226.211923][218195:218195] CHIP:DMG: + [1666962226.211928][218195:218195] CHIP:DMG: Data = [ + [1666962226.211934][218195:218195] CHIP:DMG: + [1666962226.211940][218195:218195] CHIP:DMG: ], + [1666962226.211945][218195:218195] CHIP:DMG: }, + [1666962226.211952][218195:218195] CHIP:DMG: + [1666962226.211957][218195:218195] CHIP:DMG: }, + [1666962226.211965][218195:218195] CHIP:DMG: + [1666962226.211969][218195:218195] CHIP:DMG: ], + [1666962226.211977][218195:218195] CHIP:DMG: + [1666962226.211982][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962226.211987][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962226.211991][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 5 - Verify the PartList attribute response with endpoint 5 On TH(bridge-app) Log: - - [1666962275.528464][218195:218195] CHIP:IM: Received Read request - [1666962275.528514][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962275.528527][218195:218195] CHIP:DMG: { - [1666962275.528536][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962275.528547][218195:218195] CHIP:DMG: [ - [1666962275.528557][218195:218195] CHIP:DMG: AttributePathIB = - [1666962275.528568][218195:218195] CHIP:DMG: { - [1666962275.528580][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666962275.528591][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962275.528604][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962275.528614][218195:218195] CHIP:DMG: } - [1666962275.528625][218195:218195] CHIP:DMG: - [1666962275.528637][218195:218195] CHIP:DMG: ], - [1666962275.528652][218195:218195] CHIP:DMG: - [1666962275.528665][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962275.528675][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962275.528683][218195:218195] CHIP:DMG: }, - [1666962275.528730][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962275.528771][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962275.528783][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962275.528791][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0003 (expanded=0) - [1666962275.528805][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v - [1666962275.528820][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962275.528846][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962275.529045][218195:218195] CHIP:EM: <<< [E:33089r M:54656360 (Ack:218406525)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962275.529066][218195:218195] CHIP:IN: (S) Sending msg 54656360 on secure session with LSID: 51718 - [1666962275.529319][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:34329 | 54656360 | [Interaction Model (1) / Report Data (0x05) / Session = 205 / Exchange = 33089] - [1666962275.529340][218195:218195] CHIP:DMG: Header Flags = - [1666962275.529349][218195:218195] CHIP:DMG: { - [1666962275.529370][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962275.529379][218195:218195] CHIP:DMG: { - [1666962275.532995][218195:218195] CHIP:DMG: AckMsg = 218406525 - [1666962275.533014][218195:218195] CHIP:DMG: NeedsAck = true - [1666962275.533023][218195:218195] CHIP:DMG: } - [1666962275.533047][218195:218195] CHIP:DMG: } - [1666962275.533056][218195:218195] CHIP:DMG: - [1666962275.533073][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962275.533082][218195:218195] CHIP:DMG: { - [1666962275.533090][218195:218195] CHIP:DMG: data = 00cd000068fd410349555f503cf1e95a3d4dafa36db2330c402e42095fba00ed65fc64eb115fac620bf21eba932216766b550ab7bef78b62415b002c885297c361daf085daa7 - [1666962275.533100][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962275.533108][218195:218195] CHIP:DMG: } - [1666962275.533116][218195:218195] CHIP:DMG: - [1666962275.533132][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962275.533141][218195:218195] CHIP:DMG: { - [1666962275.533149][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d24040318360218181818290424ff0118 - [1666962275.533158][218195:218195] CHIP:DMG: } - [1666962275.533167][218195:218195] CHIP:DMG: - [1666962275.533215][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962275.533228][218195:218195] CHIP:DMG: { - [1666962275.533236][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962275.533252][218195:218195] CHIP:DMG: [ - [1666962275.533262][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962275.533277][218195:218195] CHIP:DMG: { - [1666962275.533288][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962275.533299][218195:218195] CHIP:DMG: { - [1666962275.533312][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666962275.533323][218195:218195] CHIP:DMG: AttributePathIB = - [1666962275.533335][218195:218195] CHIP:DMG: { - [1666962275.533348][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666962275.533361][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962275.533375][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962275.533387][218195:218195] CHIP:DMG: } - [1666962275.533400][218195:218195] CHIP:DMG: - [1666962275.533412][218195:218195] CHIP:DMG: Data = [ - [1666962275.533424][218195:218195] CHIP:DMG: - [1666962275.533436][218195:218195] CHIP:DMG: ], - [1666962275.533447][218195:218195] CHIP:DMG: }, - [1666962275.533462][218195:218195] CHIP:DMG: - [1666962275.533472][218195:218195] CHIP:DMG: }, - [1666962275.533487][218195:218195] CHIP:DMG: - [1666962275.533496][218195:218195] CHIP:DMG: ], - [1666962275.533512][218195:218195] CHIP:DMG: - [1666962275.533523][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962275.533534][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962275.533543][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 5 On TH(bridge-app) Log: + + [1666962275.528464][218195:218195] CHIP:IM: Received Read request + [1666962275.528514][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962275.528527][218195:218195] CHIP:DMG: { + [1666962275.528536][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962275.528547][218195:218195] CHIP:DMG: [ + [1666962275.528557][218195:218195] CHIP:DMG: AttributePathIB = + [1666962275.528568][218195:218195] CHIP:DMG: { + [1666962275.528580][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666962275.528591][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962275.528604][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962275.528614][218195:218195] CHIP:DMG: } + [1666962275.528625][218195:218195] CHIP:DMG: + [1666962275.528637][218195:218195] CHIP:DMG: ], + [1666962275.528652][218195:218195] CHIP:DMG: + [1666962275.528665][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962275.528675][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962275.528683][218195:218195] CHIP:DMG: }, + [1666962275.528730][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962275.528771][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962275.528783][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962275.528791][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0003 (expanded=0) + [1666962275.528805][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v + [1666962275.528820][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962275.528846][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962275.529045][218195:218195] CHIP:EM: <<< [E:33089r M:54656360 (Ack:218406525)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962275.529066][218195:218195] CHIP:IN: (S) Sending msg 54656360 on secure session with LSID: 51718 + [1666962275.529319][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:34329 | 54656360 | [Interaction Model (1) / Report Data (0x05) / Session = 205 / Exchange = 33089] + [1666962275.529340][218195:218195] CHIP:DMG: Header Flags = + [1666962275.529349][218195:218195] CHIP:DMG: { + [1666962275.529370][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962275.529379][218195:218195] CHIP:DMG: { + [1666962275.532995][218195:218195] CHIP:DMG: AckMsg = 218406525 + [1666962275.533014][218195:218195] CHIP:DMG: NeedsAck = true + [1666962275.533023][218195:218195] CHIP:DMG: } + [1666962275.533047][218195:218195] CHIP:DMG: } + [1666962275.533056][218195:218195] CHIP:DMG: + [1666962275.533073][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962275.533082][218195:218195] CHIP:DMG: { + [1666962275.533090][218195:218195] CHIP:DMG: data = 00cd000068fd410349555f503cf1e95a3d4dafa36db2330c402e42095fba00ed65fc64eb115fac620bf21eba932216766b550ab7bef78b62415b002c885297c361daf085daa7 + [1666962275.533100][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962275.533108][218195:218195] CHIP:DMG: } + [1666962275.533116][218195:218195] CHIP:DMG: + [1666962275.533132][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962275.533141][218195:218195] CHIP:DMG: { + [1666962275.533149][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d24040318360218181818290424ff0118 + [1666962275.533158][218195:218195] CHIP:DMG: } + [1666962275.533167][218195:218195] CHIP:DMG: + [1666962275.533215][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962275.533228][218195:218195] CHIP:DMG: { + [1666962275.533236][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962275.533252][218195:218195] CHIP:DMG: [ + [1666962275.533262][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962275.533277][218195:218195] CHIP:DMG: { + [1666962275.533288][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962275.533299][218195:218195] CHIP:DMG: { + [1666962275.533312][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666962275.533323][218195:218195] CHIP:DMG: AttributePathIB = + [1666962275.533335][218195:218195] CHIP:DMG: { + [1666962275.533348][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666962275.533361][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962275.533375][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962275.533387][218195:218195] CHIP:DMG: } + [1666962275.533400][218195:218195] CHIP:DMG: + [1666962275.533412][218195:218195] CHIP:DMG: Data = [ + [1666962275.533424][218195:218195] CHIP:DMG: + [1666962275.533436][218195:218195] CHIP:DMG: ], + [1666962275.533447][218195:218195] CHIP:DMG: }, + [1666962275.533462][218195:218195] CHIP:DMG: + [1666962275.533472][218195:218195] CHIP:DMG: }, + [1666962275.533487][218195:218195] CHIP:DMG: + [1666962275.533496][218195:218195] CHIP:DMG: ], + [1666962275.533512][218195:218195] CHIP:DMG: + [1666962275.533523][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962275.533534][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962275.533543][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 6 - Verify the PartList attribute response with endpoint 6 On TH(bridge-app) Log: - - [1666962322.069585][218195:218195] CHIP:IM: Received Read request - [1666962322.069620][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962322.069628][218195:218195] CHIP:DMG: { - [1666962322.069635][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962322.069643][218195:218195] CHIP:DMG: [ - [1666962322.069651][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.069660][218195:218195] CHIP:DMG: { - [1666962322.069669][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.069678][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.069688][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.069698][218195:218195] CHIP:DMG: } - [1666962322.069707][218195:218195] CHIP:DMG: - [1666962322.069717][218195:218195] CHIP:DMG: ], - [1666962322.069727][218195:218195] CHIP:DMG: - [1666962322.069735][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962322.069744][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962322.069751][218195:218195] CHIP:DMG: }, - [1666962322.069784][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962322.069810][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962322.069820][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962322.069828][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0003 (expanded=0) - [1666962322.069839][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v - [1666962322.069852][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962322.069881][218195:218195] CHIP:DMG: Sending report (payload has 120 bytes)... - [1666962322.069997][218195:218195] CHIP:EM: <<< [E:61474r M:198673228 (Ack:1527385)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962322.070010][218195:218195] CHIP:IN: (S) Sending msg 198673228 on secure session with LSID: 51719 - [1666962322.070186][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:47795 | 198673228 | [Interaction Model (1) / Report Data (0x05) / Session = 26100 / Exchange = 61474] - [1666962322.070201][218195:218195] CHIP:DMG: Header Flags = - [1666962322.070208][218195:218195] CHIP:DMG: { - [1666962322.070223][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962322.070231][218195:218195] CHIP:DMG: { - [1666962322.070240][218195:218195] CHIP:DMG: AckMsg = 1527385 - [1666962322.070247][218195:218195] CHIP:DMG: NeedsAck = true - [1666962322.070254][218195:218195] CHIP:DMG: } - [1666962322.070267][218195:218195] CHIP:DMG: } - [1666962322.070274][218195:218195] CHIP:DMG: - [1666962322.070285][218195:218195] CHIP:DMG: Encrypted Payload (154 bytes) = - [1666962322.070293][218195:218195] CHIP:DMG: { - [1666962322.070300][218195:218195] CHIP:DMG: data = 00f465004c83d70b8dd5f204c35c1301ed6422583364d49a1257668127b3f4c329e30af47ff9d53cb04aee346c538e1422ce52597d607bc680895af69b21d8fb926cb371afed3907237b74939d013e10d528c7297b933b31b6ab2bb341b32e38a0abe30861d527ac5296ac0a0abd024b6490b3ff32cdaa311158c3f0289fa40db5d8cdea27a5da94e3258328151acdfcbc97f8a2a90d5b1d71b5 - [1666962322.070311][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962322.070319][218195:218195] CHIP:DMG: } - [1666962322.070326][218195:218195] CHIP:DMG: - [1666962322.070340][218195:218195] CHIP:DMG: Decrypted Payload (120 bytes) = - [1666962322.070347][218195:218195] CHIP:DMG: { - [1666962322.070355][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040318360218181815350126004d2fac6c370124020624031d240403340518240207181815350126004d2fac6c370124020624031d240403340518240208181815350126004d2fac6c370124020624031d240403340518240209181818290424ff0118 - [1666962322.070364][218195:218195] CHIP:DMG: } - [1666962322.070371][218195:218195] CHIP:DMG: - [1666962322.070419][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962322.070425][218195:218195] CHIP:DMG: { - [1666962322.070433][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962322.070444][218195:218195] CHIP:DMG: [ - [1666962322.070451][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.070465][218195:218195] CHIP:DMG: { - [1666962322.070473][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.070484][218195:218195] CHIP:DMG: { - [1666962322.070493][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.070504][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.070514][218195:218195] CHIP:DMG: { - [1666962322.070525][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.070536][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.070547][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.070557][218195:218195] CHIP:DMG: } - [1666962322.070569][218195:218195] CHIP:DMG: - [1666962322.070579][218195:218195] CHIP:DMG: Data = [ - [1666962322.070590][218195:218195] CHIP:DMG: - [1666962322.070602][218195:218195] CHIP:DMG: ], - [1666962322.070612][218195:218195] CHIP:DMG: }, - [1666962322.070624][218195:218195] CHIP:DMG: - [1666962322.070632][218195:218195] CHIP:DMG: }, - [1666962322.070649][218195:218195] CHIP:DMG: - [1666962322.070656][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.070668][218195:218195] CHIP:DMG: { - [1666962322.070676][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.070686][218195:218195] CHIP:DMG: { - [1666962322.070696][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.070707][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.070717][218195:218195] CHIP:DMG: { - [1666962322.070726][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.070737][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.070749][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.070759][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962322.070769][218195:218195] CHIP:DMG: } - [1666962322.070781][218195:218195] CHIP:DMG: - [1666962322.070792][218195:218195] CHIP:DMG: Data = 7, - [1666962322.070803][218195:218195] CHIP:DMG: }, - [1666962322.070815][218195:218195] CHIP:DMG: - [1666962322.070823][218195:218195] CHIP:DMG: }, - [1666962322.070839][218195:218195] CHIP:DMG: - [1666962322.070847][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.070860][218195:218195] CHIP:DMG: { - [1666962322.070869][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.070878][218195:218195] CHIP:DMG: { - [1666962322.070887][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.070898][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.070908][218195:218195] CHIP:DMG: { - [1666962322.070919][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.070929][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.070942][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.070952][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962322.070962][218195:218195] CHIP:DMG: } - [1666962322.070974][218195:218195] CHIP:DMG: - [1666962322.070985][218195:218195] CHIP:DMG: Data = 8, - [1666962322.070996][218195:218195] CHIP:DMG: }, - [1666962322.071008][218195:218195] CHIP:DMG: - [1666962322.071016][218195:218195] CHIP:DMG: }, - [1666962322.071032][218195:218195] CHIP:DMG: - [1666962322.071040][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.071053][218195:218195] CHIP:DMG: { - [1666962322.071059][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.071067][218195:218195] CHIP:DMG: { - [1666962322.071073][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.071081][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.071104][218195:218195] CHIP:DMG: { - [1666962322.071123][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.071131][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.071139][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.071150][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962322.071158][218195:218195] CHIP:DMG: } - [1666962322.071167][218195:218195] CHIP:DMG: - [1666962322.071175][218195:218195] CHIP:DMG: Data = 9, - [1666962322.071182][218195:218195] CHIP:DMG: }, - [1666962322.071191][218195:218195] CHIP:DMG: - [1666962322.071197][218195:218195] CHIP:DMG: }, - [1666962322.071206][218195:218195] CHIP:DMG: - [1666962322.071212][218195:218195] CHIP:DMG: ], - [1666962322.071229][218195:218195] CHIP:DMG: - [1666962322.071236][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962322.071242][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962322.071248][218195:218195] CHIP:DMG: } - [1666962322.071254][218195:218195] CHIP:DMG: + Verify the PartList attribute response with endpoint 6 On TH(bridge-app) Log: + + [1666962322.069585][218195:218195] CHIP:IM: Received Read request + [1666962322.069620][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962322.069628][218195:218195] CHIP:DMG: { + [1666962322.069635][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962322.069643][218195:218195] CHIP:DMG: [ + [1666962322.069651][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.069660][218195:218195] CHIP:DMG: { + [1666962322.069669][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.069678][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.069688][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.069698][218195:218195] CHIP:DMG: } + [1666962322.069707][218195:218195] CHIP:DMG: + [1666962322.069717][218195:218195] CHIP:DMG: ], + [1666962322.069727][218195:218195] CHIP:DMG: + [1666962322.069735][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962322.069744][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962322.069751][218195:218195] CHIP:DMG: }, + [1666962322.069784][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962322.069810][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962322.069820][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962322.069828][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0003 (expanded=0) + [1666962322.069839][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v + [1666962322.069852][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962322.069881][218195:218195] CHIP:DMG: Sending report (payload has 120 bytes)... + [1666962322.069997][218195:218195] CHIP:EM: <<< [E:61474r M:198673228 (Ack:1527385)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962322.070010][218195:218195] CHIP:IN: (S) Sending msg 198673228 on secure session with LSID: 51719 + [1666962322.070186][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:47795 | 198673228 | [Interaction Model (1) / Report Data (0x05) / Session = 26100 / Exchange = 61474] + [1666962322.070201][218195:218195] CHIP:DMG: Header Flags = + [1666962322.070208][218195:218195] CHIP:DMG: { + [1666962322.070223][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962322.070231][218195:218195] CHIP:DMG: { + [1666962322.070240][218195:218195] CHIP:DMG: AckMsg = 1527385 + [1666962322.070247][218195:218195] CHIP:DMG: NeedsAck = true + [1666962322.070254][218195:218195] CHIP:DMG: } + [1666962322.070267][218195:218195] CHIP:DMG: } + [1666962322.070274][218195:218195] CHIP:DMG: + [1666962322.070285][218195:218195] CHIP:DMG: Encrypted Payload (154 bytes) = + [1666962322.070293][218195:218195] CHIP:DMG: { + [1666962322.070300][218195:218195] CHIP:DMG: data = 00f465004c83d70b8dd5f204c35c1301ed6422583364d49a1257668127b3f4c329e30af47ff9d53cb04aee346c538e1422ce52597d607bc680895af69b21d8fb926cb371afed3907237b74939d013e10d528c7297b933b31b6ab2bb341b32e38a0abe30861d527ac5296ac0a0abd024b6490b3ff32cdaa311158c3f0289fa40db5d8cdea27a5da94e3258328151acdfcbc97f8a2a90d5b1d71b5 + [1666962322.070311][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962322.070319][218195:218195] CHIP:DMG: } + [1666962322.070326][218195:218195] CHIP:DMG: + [1666962322.070340][218195:218195] CHIP:DMG: Decrypted Payload (120 bytes) = + [1666962322.070347][218195:218195] CHIP:DMG: { + [1666962322.070355][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040318360218181815350126004d2fac6c370124020624031d240403340518240207181815350126004d2fac6c370124020624031d240403340518240208181815350126004d2fac6c370124020624031d240403340518240209181818290424ff0118 + [1666962322.070364][218195:218195] CHIP:DMG: } + [1666962322.070371][218195:218195] CHIP:DMG: + [1666962322.070419][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962322.070425][218195:218195] CHIP:DMG: { + [1666962322.070433][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962322.070444][218195:218195] CHIP:DMG: [ + [1666962322.070451][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962322.070465][218195:218195] CHIP:DMG: { + [1666962322.070473][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962322.070484][218195:218195] CHIP:DMG: { + [1666962322.070493][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666962322.070504][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.070514][218195:218195] CHIP:DMG: { + [1666962322.070525][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.070536][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.070547][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.070557][218195:218195] CHIP:DMG: } + [1666962322.070569][218195:218195] CHIP:DMG: + [1666962322.070579][218195:218195] CHIP:DMG: Data = [ + [1666962322.070590][218195:218195] CHIP:DMG: + [1666962322.070602][218195:218195] CHIP:DMG: ], + [1666962322.070612][218195:218195] CHIP:DMG: }, + [1666962322.070624][218195:218195] CHIP:DMG: + [1666962322.070632][218195:218195] CHIP:DMG: }, + [1666962322.070649][218195:218195] CHIP:DMG: + [1666962322.070656][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962322.070668][218195:218195] CHIP:DMG: { + [1666962322.070676][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962322.070686][218195:218195] CHIP:DMG: { + [1666962322.070696][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666962322.070707][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.070717][218195:218195] CHIP:DMG: { + [1666962322.070726][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.070737][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.070749][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.070759][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962322.070769][218195:218195] CHIP:DMG: } + [1666962322.070781][218195:218195] CHIP:DMG: + [1666962322.070792][218195:218195] CHIP:DMG: Data = 7, + [1666962322.070803][218195:218195] CHIP:DMG: }, + [1666962322.070815][218195:218195] CHIP:DMG: + [1666962322.070823][218195:218195] CHIP:DMG: }, + [1666962322.070839][218195:218195] CHIP:DMG: + [1666962322.070847][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962322.070860][218195:218195] CHIP:DMG: { + [1666962322.070869][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962322.070878][218195:218195] CHIP:DMG: { + [1666962322.070887][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666962322.070898][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.070908][218195:218195] CHIP:DMG: { + [1666962322.070919][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.070929][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.070942][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.070952][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962322.070962][218195:218195] CHIP:DMG: } + [1666962322.070974][218195:218195] CHIP:DMG: + [1666962322.070985][218195:218195] CHIP:DMG: Data = 8, + [1666962322.071182][218195:218195] CHIP:DMG: }, + [1666962322.071191][218195:218195] CHIP:DMG: + [1666962322.071197][218195:218195] CHIP:DMG: }, + [1666962322.071206][218195:218195] CHIP:DMG: + [1666962322.071212][218195:218195] CHIP:DMG: ], + [1666962322.071229][218195:218195] CHIP:DMG: + [1666962322.071236][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962322.071242][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962322.071248][218195:218195] CHIP:DMG: } + [1666962322.071254][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 7 - Verify the PartList attribute response with endpoint 7 On TH(bridge-app) Log: - - [1666962362.557106][218195:218195] CHIP:IM: Received Read request - [1666962362.557147][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962362.557158][218195:218195] CHIP:DMG: { - [1666962362.557166][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962362.557177][218195:218195] CHIP:DMG: [ - [1666962362.557186][218195:218195] CHIP:DMG: AttributePathIB = - [1666962362.557196][218195:218195] CHIP:DMG: { - [1666962362.557206][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666962362.557217][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962362.557228][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962362.557237][218195:218195] CHIP:DMG: } - [1666962362.557249][218195:218195] CHIP:DMG: - [1666962362.557258][218195:218195] CHIP:DMG: ], - [1666962362.557269][218195:218195] CHIP:DMG: - [1666962362.557279][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962362.557289][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962362.557297][218195:218195] CHIP:DMG: }, - [1666962362.557335][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962362.557372][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962362.557385][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962362.557394][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0003 (expanded=0) - [1666962362.557407][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v - [1666962362.557421][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962362.557446][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962362.557583][218195:218195] CHIP:EM: <<< [E:12102r M:186746901 (Ack:224939109)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962362.557603][218195:218195] CHIP:IN: (S) Sending msg 186746901 on secure session with LSID: 51720 - [1666962362.557774][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45695 | 186746901 | [Interaction Model (1) / Report Data (0x05) / Session = 44401 / Exchange = 12102] - [1666962362.557794][218195:218195] CHIP:DMG: Header Flags = - [1666962362.557804][218195:218195] CHIP:DMG: { - [1666962362.557821][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962362.557830][218195:218195] CHIP:DMG: { - [1666962362.557840][218195:218195] CHIP:DMG: AckMsg = 224939109 - [1666962362.557849][218195:218195] CHIP:DMG: NeedsAck = true - [1666962362.557858][218195:218195] CHIP:DMG: } - [1666962362.557871][218195:218195] CHIP:DMG: } - [1666962362.557879][218195:218195] CHIP:DMG: - [1666962362.557892][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962362.557900][218195:218195] CHIP:DMG: { - [1666962362.557909][218195:218195] CHIP:DMG: data = 0071ad001588210b02370802970509c2ed65336ec135d9e4705a5485be6d348078f88c0b68cc9b52190f938ddae1ebe842531c0f341e7ed9ebb36297cf2f4e55365f639b4428 - [1666962362.557918][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962362.557927][218195:218195] CHIP:DMG: } - [1666962362.557935][218195:218195] CHIP:DMG: - [1666962362.557949][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962362.557957][218195:218195] CHIP:DMG: { - [1666962362.557966][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d24040318360218181818290424ff0118 - [1666962362.557975][218195:218195] CHIP:DMG: } - [1666962362.557983][218195:218195] CHIP:DMG: - [1666962362.558017][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962362.558029][218195:218195] CHIP:DMG: { - [1666962362.558038][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962362.558051][218195:218195] CHIP:DMG: [ - [1666962362.558061][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962362.558075][218195:218195] CHIP:DMG: { - [1666962362.558085][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962362.558095][218195:218195] CHIP:DMG: { - [1666962362.558106][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, - [1666962362.558116][218195:218195] CHIP:DMG: AttributePathIB = - [1666962362.558127][218195:218195] CHIP:DMG: { - [1666962362.558138][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666962362.558153][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962362.558167][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962362.558180][218195:218195] CHIP:DMG: } - [1666962362.558192][218195:218195] CHIP:DMG: - [1666962362.558203][218195:218195] CHIP:DMG: Data = [ - [1666962362.558214][218195:218195] CHIP:DMG: - [1666962362.558226][218195:218195] CHIP:DMG: ], - [1666962362.558235][218195:218195] CHIP:DMG: }, - [1666962362.558248][218195:218195] CHIP:DMG: - [1666962362.558257][218195:218195] CHIP:DMG: }, - [1666962362.558271][218195:218195] CHIP:DMG: - [1666962362.558279][218195:218195] CHIP:DMG: ], - [1666962362.558293][218195:218195] CHIP:DMG: - [1666962362.558303][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962362.558313][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962362.558321][218195:218195] CHIP:DMG: } - + Verify the PartList attribute response with endpoint 7 On TH(bridge-app) Log: + + [1666962362.557106][218195:218195] CHIP:IM: Received Read request + [1666962362.557147][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962362.557158][218195:218195] CHIP:DMG: { + [1666962362.557166][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962362.557177][218195:218195] CHIP:DMG: [ + [1666962362.557186][218195:218195] CHIP:DMG: AttributePathIB = + [1666962362.557196][218195:218195] CHIP:DMG: { + [1666962362.557206][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666962362.557217][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962362.557228][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962362.557237][218195:218195] CHIP:DMG: } + [1666962362.557249][218195:218195] CHIP:DMG: + [1666962362.557258][218195:218195] CHIP:DMG: ], + [1666962362.557269][218195:218195] CHIP:DMG: + [1666962362.557279][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962362.557289][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962362.557297][218195:218195] CHIP:DMG: }, + [1666962362.557335][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962362.557372][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962362.557385][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962362.557394][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0003 (expanded=0) + [1666962362.557407][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v + [1666962362.557421][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962362.557446][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962362.557583][218195:218195] CHIP:EM: <<< [E:12102r M:186746901 (Ack:224939109)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962362.557603][218195:218195] CHIP:IN: (S) Sending msg 186746901 on secure session with LSID: 51720 + [1666962362.557774][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45695 | 186746901 | [Interaction Model (1) / Report Data (0x05) / Session = 44401 / Exchange = 12102] + [1666962362.557794][218195:218195] CHIP:DMG: Header Flags = + [1666962362.557804][218195:218195] CHIP:DMG: { + [1666962362.557821][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962362.557830][218195:218195] CHIP:DMG: { + [1666962362.557840][218195:218195] CHIP:DMG: AckMsg = 224939109 + [1666962362.557849][218195:218195] CHIP:DMG: NeedsAck = true + [1666962362.557858][218195:218195] CHIP:DMG: } + [1666962362.557871][218195:218195] CHIP:DMG: } + [1666962362.557879][218195:218195] CHIP:DMG: + [1666962362.557892][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962362.557900][218195:218195] CHIP:DMG: { + [1666962362.557909][218195:218195] CHIP:DMG: data = 0071ad001588210b02370802970509c2ed65336ec135d9e4705a5485be6d348078f88c0b68cc9b52190f938ddae1ebe842531c0f341e7ed9ebb36297cf2f4e55365f639b4428 + [1666962362.557918][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962362.557927][218195:218195] CHIP:DMG: } + [1666962362.557935][218195:218195] CHIP:DMG: + [1666962362.557949][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962362.557957][218195:218195] CHIP:DMG: { + [1666962362.557966][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d24040318360218181818290424ff0118 + [1666962362.557975][218195:218195] CHIP:DMG: } + [1666962362.557983][218195:218195] CHIP:DMG: + [1666962362.558017][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962362.558029][218195:218195] CHIP:DMG: { + [1666962362.558038][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962362.558051][218195:218195] CHIP:DMG: [ + [1666962362.558061][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962362.558075][218195:218195] CHIP:DMG: { + [1666962362.558085][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962362.558095][218195:218195] CHIP:DMG: { + [1666962362.558106][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, + [1666962362.558116][218195:218195] CHIP:DMG: AttributePathIB = + [1666962362.558127][218195:218195] CHIP:DMG: { + [1666962362.558138][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666962362.558153][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962362.558167][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962362.558180][218195:218195] CHIP:DMG: } + [1666962362.558192][218195:218195] CHIP:DMG: + [1666962362.558203][218195:218195] CHIP:DMG: Data = [ + [1666962362.558214][218195:218195] CHIP:DMG: + [1666962362.558226][218195:218195] CHIP:DMG: ], + [1666962362.558235][218195:218195] CHIP:DMG: }, + [1666962362.558248][218195:218195] CHIP:DMG: + [1666962362.558257][218195:218195] CHIP:DMG: }, + [1666962362.558271][218195:218195] CHIP:DMG: + [1666962362.558279][218195:218195] CHIP:DMG: ], + [1666962362.558293][218195:218195] CHIP:DMG: + [1666962362.558303][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962362.558313][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962362.558321][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 8 - Verify the PartList attribute response with endpoint 8 On TH(bridge-app) Log: - - [1666962423.861269][218195:218195] CHIP:IM: Received Read request - [1666962423.861296][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962423.861303][218195:218195] CHIP:DMG: { - [1666962423.861310][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962423.861318][218195:218195] CHIP:DMG: [ - [1666962423.861324][218195:218195] CHIP:DMG: AttributePathIB = - [1666962423.861331][218195:218195] CHIP:DMG: { - [1666962423.861338][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666962423.861346][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962423.861352][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962423.861358][218195:218195] CHIP:DMG: } - [1666962423.861365][218195:218195] CHIP:DMG: - [1666962423.861370][218195:218195] CHIP:DMG: ], - [1666962423.861378][218195:218195] CHIP:DMG: - [1666962423.861383][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962423.861389][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962423.861394][218195:218195] CHIP:DMG: }, - [1666962423.861419][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962423.861438][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962423.861445][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962423.861450][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0003 (expanded=0) - [1666962423.861460][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v - [1666962423.861471][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962423.861487][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962423.861589][218195:218195] CHIP:EM: <<< [E:44387r M:147068856 (Ack:205489082)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962423.861600][218195:218195] CHIP:IN: (S) Sending msg 147068856 on secure session with LSID: 51722 - [1666962423.861726][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:52860 | 147068856 | [Interaction Model (1) / Report Data (0x05) / Session = 56538 / Exchange = 44387] - [1666962423.861738][218195:218195] CHIP:DMG: Header Flags = - [1666962423.861743][218195:218195] CHIP:DMG: { - [1666962423.861755][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962423.861760][218195:218195] CHIP:DMG: { - [1666962423.861767][218195:218195] CHIP:DMG: AckMsg = 205489082 - [1666962423.861774][218195:218195] CHIP:DMG: NeedsAck = true - [1666962423.861781][218195:218195] CHIP:DMG: } - [1666962423.861791][218195:218195] CHIP:DMG: } - [1666962423.861797][218195:218195] CHIP:DMG: - [1666962423.861806][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962423.861811][218195:218195] CHIP:DMG: { - [1666962423.861816][218195:218195] CHIP:DMG: data = 00dadc00b817c4087f92461275319767af0cdd53b8d38e6560ac0d02db733ab6de1c8963cd37b2c093d3ad8da69006a9974bba741e9a5184dfe57f62f30d78a055a5ea64afc3 - [1666962423.861822][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962423.861827][218195:218195] CHIP:DMG: } - [1666962423.861832][218195:218195] CHIP:DMG: - [1666962423.861841][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962423.861846][218195:218195] CHIP:DMG: { - [1666962423.861851][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d24040318360218181818290424ff0118 - [1666962423.861857][218195:218195] CHIP:DMG: } - [1666962423.861862][218195:218195] CHIP:DMG: - [1666962423.861883][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962423.861889][218195:218195] CHIP:DMG: { - [1666962423.861893][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962423.861902][218195:218195] CHIP:DMG: [ - [1666962423.861907][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962423.861916][218195:218195] CHIP:DMG: { - [1666962423.861922][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962423.861928][218195:218195] CHIP:DMG: { - [1666962423.861935][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, - [1666962423.861941][218195:218195] CHIP:DMG: AttributePathIB = - [1666962423.861947][218195:218195] CHIP:DMG: { - [1666962423.861954][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666962423.861960][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962423.861967][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962423.861973][218195:218195] CHIP:DMG: } - [1666962423.861981][218195:218195] CHIP:DMG: - [1666962423.861987][218195:218195] CHIP:DMG: Data = [ - [1666962423.861994][218195:218195] CHIP:DMG: - [1666962423.862000][218195:218195] CHIP:DMG: ], - [1666962423.862006][218195:218195] CHIP:DMG: }, - [1666962423.862014][218195:218195] CHIP:DMG: - [1666962423.862020][218195:218195] CHIP:DMG: }, - [1666962423.862028][218195:218195] CHIP:DMG: - [1666962423.862033][218195:218195] CHIP:DMG: ], - [1666962423.862042][218195:218195] CHIP:DMG: - [1666962423.862047][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962423.862053][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962423.862058][218195:218195] CHIP:DMG: } - [1666962423.862063][218195:218195] CHIP:DMG: + Verify the PartList attribute response with endpoint 8 On TH(bridge-app) Log: + + [1666962423.861269][218195:218195] CHIP:IM: Received Read request + [1666962423.861296][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962423.861303][218195:218195] CHIP:DMG: { + [1666962423.861310][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962423.861318][218195:218195] CHIP:DMG: [ + [1666962423.861324][218195:218195] CHIP:DMG: AttributePathIB = + [1666962423.861331][218195:218195] CHIP:DMG: { + [1666962423.861338][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666962423.861346][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962423.861352][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962423.861358][218195:218195] CHIP:DMG: } + [1666962423.861365][218195:218195] CHIP:DMG: + [1666962423.861370][218195:218195] CHIP:DMG: ], + [1666962423.861378][218195:218195] CHIP:DMG: + [1666962423.861383][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962423.861389][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962423.861394][218195:218195] CHIP:DMG: }, + [1666962423.861419][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962423.861438][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962423.861445][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962423.861450][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0003 (expanded=0) + [1666962423.861460][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v + [1666962423.861471][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962423.861487][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962423.861589][218195:218195] CHIP:EM: <<< [E:44387r M:147068856 (Ack:205489082)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962423.861600][218195:218195] CHIP:IN: (S) Sending msg 147068856 on secure session with LSID: 51722 + [1666962423.861726][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:52860 | 147068856 | [Interaction Model (1) / Report Data (0x05) / Session = 56538 / Exchange = 44387] + [1666962423.861738][218195:218195] CHIP:DMG: Header Flags = + [1666962423.861743][218195:218195] CHIP:DMG: { + [1666962423.861755][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962423.861760][218195:218195] CHIP:DMG: { + [1666962423.861767][218195:218195] CHIP:DMG: AckMsg = 205489082 + [1666962423.861774][218195:218195] CHIP:DMG: NeedsAck = true + [1666962423.861781][218195:218195] CHIP:DMG: } + [1666962423.861791][218195:218195] CHIP:DMG: } + [1666962423.861797][218195:218195] CHIP:DMG: + [1666962423.861806][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962423.861811][218195:218195] CHIP:DMG: { + [1666962423.861816][218195:218195] CHIP:DMG: data = 00dadc00b817c4087f92461275319767af0cdd53b8d38e6560ac0d02db733ab6de1c8963cd37b2c093d3ad8da69006a9974bba741e9a5184dfe57f62f30d78a055a5ea64afc3 + [1666962423.861822][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962423.861827][218195:218195] CHIP:DMG: } + [1666962423.861832][218195:218195] CHIP:DMG: + [1666962423.861841][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962423.861846][218195:218195] CHIP:DMG: { + [1666962423.861851][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d24040318360218181818290424ff0118 + [1666962423.861857][218195:218195] CHIP:DMG: } + [1666962423.861862][218195:218195] CHIP:DMG: + [1666962423.861883][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962423.861889][218195:218195] CHIP:DMG: { + [1666962423.861893][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962423.861902][218195:218195] CHIP:DMG: [ + [1666962423.861907][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962423.861916][218195:218195] CHIP:DMG: { + [1666962423.861922][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962423.861928][218195:218195] CHIP:DMG: { + [1666962423.861935][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, + [1666962423.861941][218195:218195] CHIP:DMG: AttributePathIB = + [1666962423.861947][218195:218195] CHIP:DMG: { + [1666962423.861954][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666962423.861960][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962423.861967][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962423.861973][218195:218195] CHIP:DMG: } + [1666962423.861981][218195:218195] CHIP:DMG: + [1666962423.861987][218195:218195] CHIP:DMG: Data = [ + [1666962423.861994][218195:218195] CHIP:DMG: + [1666962423.862000][218195:218195] CHIP:DMG: ], + [1666962423.862006][218195:218195] CHIP:DMG: }, + [1666962423.862014][218195:218195] CHIP:DMG: + [1666962423.862020][218195:218195] CHIP:DMG: }, + [1666962423.862028][218195:218195] CHIP:DMG: + [1666962423.862033][218195:218195] CHIP:DMG: ], + [1666962423.862042][218195:218195] CHIP:DMG: + [1666962423.862047][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962423.862053][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962423.862058][218195:218195] CHIP:DMG: } + [1666962423.862063][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 9 - Verify the PartList attribute response with endpoint 9 On TH(bridge-app) Log: - - [1666962496.027253][218195:218195] CHIP:IM: Received Read request - [1666962496.027291][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962496.027300][218195:218195] CHIP:DMG: { - [1666962496.027307][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962496.027315][218195:218195] CHIP:DMG: [ - [1666962496.027321][218195:218195] CHIP:DMG: AttributePathIB = - [1666962496.027330][218195:218195] CHIP:DMG: { - [1666962496.027338][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666962496.027347][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962496.027356][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962496.027364][218195:218195] CHIP:DMG: } - [1666962496.027373][218195:218195] CHIP:DMG: - [1666962496.027380][218195:218195] CHIP:DMG: ], - [1666962496.027390][218195:218195] CHIP:DMG: - [1666962496.027399][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962496.027406][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962496.027413][218195:218195] CHIP:DMG: }, - [1666962496.027449][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962496.027484][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962496.027494][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962496.027501][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0003 (expanded=0) - [1666962496.027514][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v - [1666962496.027527][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962496.027550][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962496.027706][218195:218195] CHIP:EM: <<< [E:8905r M:160325129 (Ack:28368292)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962496.027724][218195:218195] CHIP:IN: (S) Sending msg 160325129 on secure session with LSID: 51723 - [1666962496.027908][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33003 | 160325129 | [Interaction Model (1) / Report Data (0x05) / Session = 48426 / Exchange = 8905] - [1666962496.027927][218195:218195] CHIP:DMG: Header Flags = - [1666962496.027934][218195:218195] CHIP:DMG: { - [1666962496.027949][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962496.027956][218195:218195] CHIP:DMG: { - [1666962496.028073][218195:218195] CHIP:DMG: AckMsg = 28368292 - [1666962496.028082][218195:218195] CHIP:DMG: NeedsAck = true - [1666962496.028089][218195:218195] CHIP:DMG: } - [1666962496.028102][218195:218195] CHIP:DMG: } - [1666962496.028109][218195:218195] CHIP:DMG: - [1666962496.028120][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962496.028126][218195:218195] CHIP:DMG: { - [1666962496.028134][218195:218195] CHIP:DMG: data = 002abd00095e8e096c066e8e125a0d87cd379abecc3c6dcb3bd64285825f2bc01cdf3a255f4ba9a3ba34f70e8ec314f2df04872275a5807a4bf6ee1e8cdb94b31fe9f11ff31b - [1666962496.028142][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962496.028149][218195:218195] CHIP:DMG: } - [1666962496.028157][218195:218195] CHIP:DMG: - [1666962496.028171][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962496.028178][218195:218195] CHIP:DMG: { - [1666962496.028185][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040318360218181818290424ff0118 - [1666962496.028193][218195:218195] CHIP:DMG: } - [1666962496.028199][218195:218195] CHIP:DMG: - [1666962496.028235][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962496.028243][218195:218195] CHIP:DMG: { - [1666962496.028250][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962496.028262][218195:218195] CHIP:DMG: [ - [1666962496.028270][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962496.028285][218195:218195] CHIP:DMG: { - [1666962496.028293][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962496.028302][218195:218195] CHIP:DMG: { - [1666962496.028311][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, - [1666962496.028320][218195:218195] CHIP:DMG: AttributePathIB = - [1666962496.028331][218195:218195] CHIP:DMG: { - [1666962496.028344][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666962496.028354][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962496.028364][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962496.028373][218195:218195] CHIP:DMG: } - [1666962496.028384][218195:218195] CHIP:DMG: - [1666962496.028393][218195:218195] CHIP:DMG: Data = [ - [1666962496.028403][218195:218195] CHIP:DMG: - [1666962496.028412][218195:218195] CHIP:DMG: ], - [1666962496.028422][218195:218195] CHIP:DMG: }, - [1666962496.028434][218195:218195] CHIP:DMG: - [1666962496.028442][218195:218195] CHIP:DMG: }, - [1666962496.028454][218195:218195] CHIP:DMG: - [1666962496.028463][218195:218195] CHIP:DMG: ], - [1666962496.028475][218195:218195] CHIP:DMG: - [1666962496.028483][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962496.028491][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962496.028498][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 9 On TH(bridge-app) Log: + + [1666962496.027253][218195:218195] CHIP:IM: Received Read request + [1666962496.027291][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962496.027300][218195:218195] CHIP:DMG: { + [1666962496.027307][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962496.027315][218195:218195] CHIP:DMG: [ + [1666962496.027321][218195:218195] CHIP:DMG: AttributePathIB = + [1666962496.027330][218195:218195] CHIP:DMG: { + [1666962496.027338][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666962496.027347][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962496.027356][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962496.027364][218195:218195] CHIP:DMG: } + [1666962496.027373][218195:218195] CHIP:DMG: + [1666962496.027380][218195:218195] CHIP:DMG: ], + [1666962496.027390][218195:218195] CHIP:DMG: + [1666962496.027399][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962496.027406][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962496.027413][218195:218195] CHIP:DMG: }, + [1666962496.027449][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962496.027484][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962496.027494][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962496.027501][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0003 (expanded=0) + [1666962496.027514][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v + [1666962496.027527][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962496.027550][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962496.027706][218195:218195] CHIP:EM: <<< [E:8905r M:160325129 (Ack:28368292)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962496.027724][218195:218195] CHIP:IN: (S) Sending msg 160325129 on secure session with LSID: 51723 + [1666962496.027908][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33003 | 160325129 | [Interaction Model (1) / Report Data (0x05) / Session = 48426 / Exchange = 8905] + [1666962496.027927][218195:218195] CHIP:DMG: Header Flags = + [1666962496.027934][218195:218195] CHIP:DMG: { + [1666962496.027949][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962496.027956][218195:218195] CHIP:DMG: { + [1666962496.028073][218195:218195] CHIP:DMG: AckMsg = 28368292 + [1666962496.028082][218195:218195] CHIP:DMG: NeedsAck = true + [1666962496.028089][218195:218195] CHIP:DMG: } + [1666962496.028102][218195:218195] CHIP:DMG: } + [1666962496.028109][218195:218195] CHIP:DMG: + [1666962496.028120][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962496.028126][218195:218195] CHIP:DMG: { + [1666962496.028134][218195:218195] CHIP:DMG: data = 002abd00095e8e096c066e8e125a0d87cd379abecc3c6dcb3bd64285825f2bc01cdf3a255f4ba9a3ba34f70e8ec314f2df04872275a5807a4bf6ee1e8cdb94b31fe9f11ff31b + [1666962496.028142][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962496.028149][218195:218195] CHIP:DMG: } + [1666962496.028157][218195:218195] CHIP:DMG: + [1666962496.028171][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962496.028178][218195:218195] CHIP:DMG: { + [1666962496.028185][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040318360218181818290424ff0118 + [1666962496.028193][218195:218195] CHIP:DMG: } + [1666962496.028199][218195:218195] CHIP:DMG: + [1666962496.028235][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962496.028243][218195:218195] CHIP:DMG: { + [1666962496.028250][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962496.028262][218195:218195] CHIP:DMG: [ + [1666962496.028270][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962496.028285][218195:218195] CHIP:DMG: { + [1666962496.028293][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962496.028302][218195:218195] CHIP:DMG: { + [1666962496.028311][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, + [1666962496.028320][218195:218195] CHIP:DMG: AttributePathIB = + [1666962496.028331][218195:218195] CHIP:DMG: { + [1666962496.028344][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666962496.028354][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962496.028364][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962496.028373][218195:218195] CHIP:DMG: } + [1666962496.028384][218195:218195] CHIP:DMG: + [1666962496.028393][218195:218195] CHIP:DMG: Data = [ + [1666962496.028403][218195:218195] CHIP:DMG: + [1666962496.028412][218195:218195] CHIP:DMG: ], + [1666962496.028422][218195:218195] CHIP:DMG: }, + [1666962496.028434][218195:218195] CHIP:DMG: + [1666962496.028442][218195:218195] CHIP:DMG: }, + [1666962496.028454][218195:218195] CHIP:DMG: + [1666962496.028463][218195:218195] CHIP:DMG: ], + [1666962496.028475][218195:218195] CHIP:DMG: + [1666962496.028483][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962496.028491][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962496.028498][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 10 - Verify the PartList attribute response with endpoint 10 On TH(bridge-app) Log: - - [1666962545.266945][218195:218195] CHIP:IM: Received Read request - [1666962545.266979][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962545.266986][218195:218195] CHIP:DMG: { - [1666962545.266993][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962545.267002][218195:218195] CHIP:DMG: [ - [1666962545.267009][218195:218195] CHIP:DMG: AttributePathIB = - [1666962545.267018][218195:218195] CHIP:DMG: { - [1666962545.267027][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666962545.267037][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962545.267046][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962545.267054][218195:218195] CHIP:DMG: } - [1666962545.267063][218195:218195] CHIP:DMG: - [1666962545.267071][218195:218195] CHIP:DMG: ], - [1666962545.267082][218195:218195] CHIP:DMG: - [1666962545.267100][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962545.267108][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962545.267115][218195:218195] CHIP:DMG: }, - [1666962545.267147][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962545.267172][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962545.267181][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962545.267189][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0003 (expanded=0) - [1666962545.267200][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v - [1666962545.267213][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962545.267235][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962545.267342][218195:218195] CHIP:EM: <<< [E:24189r M:59534941 (Ack:136750873)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962545.267355][218195:218195] CHIP:IN: (S) Sending msg 59534941 on secure session with LSID: 51724 - [1666962545.267489][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:48547 | 59534941 | [Interaction Model (1) / Report Data (0x05) / Session = 30602 / Exchange = 24189] - [1666962545.267502][218195:218195] CHIP:DMG: Header Flags = - [1666962545.267510][218195:218195] CHIP:DMG: { - [1666962545.267524][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962545.267531][218195:218195] CHIP:DMG: { - [1666962545.267540][218195:218195] CHIP:DMG: AckMsg = 136750873 - [1666962545.267547][218195:218195] CHIP:DMG: NeedsAck = true - [1666962545.267554][218195:218195] CHIP:DMG: } - [1666962545.267567][218195:218195] CHIP:DMG: } - [1666962545.267574][218195:218195] CHIP:DMG: - [1666962545.267585][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962545.267592][218195:218195] CHIP:DMG: { - [1666962545.267599][218195:218195] CHIP:DMG: data = 008a77005d6e8c03f404045b94379c834b72702e0ba16795c503220436544b6b0b381b216a1e3b46cb5ebcc08f78bf5e83ff6e1b7beae8c3735bb8dfc85db4e28576c43a7565 - [1666962545.267608][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962545.267615][218195:218195] CHIP:DMG: } - [1666962545.267622][218195:218195] CHIP:DMG: - [1666962545.267634][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962545.267641][218195:218195] CHIP:DMG: { - [1666962545.267649][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d24040318360218181818290424ff0118 - [1666962545.267657][218195:218195] CHIP:DMG: } - [1666962545.267663][218195:218195] CHIP:DMG: - [1666962545.267692][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962545.267698][218195:218195] CHIP:DMG: { - [1666962545.267705][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962545.267717][218195:218195] CHIP:DMG: [ - [1666962545.267724][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962545.267737][218195:218195] CHIP:DMG: { - [1666962545.267745][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962545.267755][218195:218195] CHIP:DMG: { - [1666962545.267764][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666962545.267775][218195:218195] CHIP:DMG: AttributePathIB = - [1666962545.267786][218195:218195] CHIP:DMG: { - [1666962545.267797][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666962545.267809][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962545.267822][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962545.267832][218195:218195] CHIP:DMG: } - [1666962545.267844][218195:218195] CHIP:DMG: - [1666962545.267854][218195:218195] CHIP:DMG: Data = [ - [1666962545.267865][218195:218195] CHIP:DMG: - [1666962545.267876][218195:218195] CHIP:DMG: ], - [1666962545.267884][218195:218195] CHIP:DMG: }, - [1666962545.267896][218195:218195] CHIP:DMG: - [1666962545.267905][218195:218195] CHIP:DMG: }, - [1666962545.267916][218195:218195] CHIP:DMG: - [1666962545.267924][218195:218195] CHIP:DMG: ], - [1666962545.267935][218195:218195] CHIP:DMG: - [1666962545.267943][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962545.267952][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962545.267959][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 10 On TH(bridge-app) Log: + + [1666962545.266945][218195:218195] CHIP:IM: Received Read request + [1666962545.266979][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962545.266986][218195:218195] CHIP:DMG: { + [1666962545.266993][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962545.267002][218195:218195] CHIP:DMG: [ + [1666962545.267009][218195:218195] CHIP:DMG: AttributePathIB = + [1666962545.267018][218195:218195] CHIP:DMG: { + [1666962545.267027][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666962545.267037][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962545.267046][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962545.267054][218195:218195] CHIP:DMG: } + [1666962545.267063][218195:218195] CHIP:DMG: + [1666962545.267071][218195:218195] CHIP:DMG: ], + [1666962545.267082][218195:218195] CHIP:DMG: + [1666962545.267100][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962545.267108][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962545.267115][218195:218195] CHIP:DMG: }, + [1666962545.267147][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962545.267172][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962545.267181][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962545.267189][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0003 (expanded=0) + [1666962545.267200][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v + [1666962545.267213][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962545.267235][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962545.267342][218195:218195] CHIP:EM: <<< [E:24189r M:59534941 (Ack:136750873)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962545.267355][218195:218195] CHIP:IN: (S) Sending msg 59534941 on secure session with LSID: 51724 + [1666962545.267489][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:48547 | 59534941 | [Interaction Model (1) / Report Data (0x05) / Session = 30602 / Exchange = 24189] + [1666962545.267502][218195:218195] CHIP:DMG: Header Flags = + [1666962545.267510][218195:218195] CHIP:DMG: { + [1666962545.267524][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962545.267531][218195:218195] CHIP:DMG: { + [1666962545.267540][218195:218195] CHIP:DMG: AckMsg = 136750873 + [1666962545.267547][218195:218195] CHIP:DMG: NeedsAck = true + [1666962545.267554][218195:218195] CHIP:DMG: } + [1666962545.267567][218195:218195] CHIP:DMG: } + [1666962545.267574][218195:218195] CHIP:DMG: + [1666962545.267585][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962545.267592][218195:218195] CHIP:DMG: { + [1666962545.267599][218195:218195] CHIP:DMG: data = 008a77005d6e8c03f404045b94379c834b72702e0ba16795c503220436544b6b0b381b216a1e3b46cb5ebcc08f78bf5e83ff6e1b7beae8c3735bb8dfc85db4e28576c43a7565 + [1666962545.267608][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962545.267615][218195:218195] CHIP:DMG: } + [1666962545.267622][218195:218195] CHIP:DMG: + [1666962545.267634][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962545.267641][218195:218195] CHIP:DMG: { + [1666962545.267649][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d24040318360218181818290424ff0118 + [1666962545.267657][218195:218195] CHIP:DMG: } + [1666962545.267663][218195:218195] CHIP:DMG: + [1666962545.267692][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962545.267698][218195:218195] CHIP:DMG: { + [1666962545.267705][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962545.267717][218195:218195] CHIP:DMG: [ + [1666962545.267724][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962545.267737][218195:218195] CHIP:DMG: { + [1666962545.267745][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962545.267755][218195:218195] CHIP:DMG: { + [1666962545.267764][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666962545.267775][218195:218195] CHIP:DMG: AttributePathIB = + [1666962545.267786][218195:218195] CHIP:DMG: { + [1666962545.267797][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666962545.267809][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962545.267822][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962545.267832][218195:218195] CHIP:DMG: } + [1666962545.267844][218195:218195] CHIP:DMG: + [1666962545.267854][218195:218195] CHIP:DMG: Data = [ + [1666962545.267865][218195:218195] CHIP:DMG: + [1666962545.267876][218195:218195] CHIP:DMG: ], + [1666962545.267884][218195:218195] CHIP:DMG: }, + [1666962545.267896][218195:218195] CHIP:DMG: + [1666962545.267905][218195:218195] CHIP:DMG: }, + [1666962545.267916][218195:218195] CHIP:DMG: + [1666962545.267924][218195:218195] CHIP:DMG: ], + [1666962545.267935][218195:218195] CHIP:DMG: + [1666962545.267943][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962545.267952][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962545.267959][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 11 - Verify the PartList attribute response with endpoint 11 On TH(bridge-app) Log: - - [1666962605.941370][218195:218195] CHIP:IM: Received Read request - [1666962605.941421][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962605.941433][218195:218195] CHIP:DMG: { - [1666962605.941444][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962605.941457][218195:218195] CHIP:DMG: [ - [1666962605.941468][218195:218195] CHIP:DMG: AttributePathIB = - [1666962605.941482][218195:218195] CHIP:DMG: { - [1666962605.941495][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666962605.941508][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962605.941522][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962605.941535][218195:218195] CHIP:DMG: } - [1666962605.941550][218195:218195] CHIP:DMG: - [1666962605.941561][218195:218195] CHIP:DMG: ], - [1666962605.941576][218195:218195] CHIP:DMG: - [1666962605.941589][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962605.941600][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962605.941611][218195:218195] CHIP:DMG: }, - [1666962605.941660][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962605.941704][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962605.941719][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962605.941730][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0003 (expanded=0) - [1666962605.941747][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v - [1666962605.941765][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962605.941796][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962605.941969][218195:218195] CHIP:EM: <<< [E:53228r M:194033500 (Ack:241544232)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962605.941995][218195:218195] CHIP:IN: (S) Sending msg 194033500 on secure session with LSID: 51725 - [1666962605.942217][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45700 | 194033500 | [Interaction Model (1) / Report Data (0x05) / Session = 60703 / Exchange = 53228] - [1666962605.942243][218195:218195] CHIP:DMG: Header Flags = - [1666962605.942254][218195:218195] CHIP:DMG: { - [1666962605.942277][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962605.942288][218195:218195] CHIP:DMG: { - [1666962605.946293][218195:218195] CHIP:DMG: AckMsg = 241544232 - [1666962605.946325][218195:218195] CHIP:DMG: NeedsAck = true - [1666962605.946339][218195:218195] CHIP:DMG: } - [1666962605.946376][218195:218195] CHIP:DMG: } - [1666962605.946393][218195:218195] CHIP:DMG: - [1666962605.946424][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962605.946439][218195:218195] CHIP:DMG: { - [1666962605.946455][218195:218195] CHIP:DMG: data = 001fed005cb7900b4a137fb3c5753516fcbff9678f1b2cbf9cd04d6df60e3a9bdebf9a6f9713b60c34567f235d2aa407a9e18ed6dfdb1eb2ef70245e7b8a7a5213192b956d81 - [1666962605.946470][218195:218195] CHIP:DMG: buffer_ptr = 94136416766624 - [1666962605.946484][218195:218195] CHIP:DMG: } - [1666962605.946498][218195:218195] CHIP:DMG: - [1666962605.946525][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962605.946541][218195:218195] CHIP:DMG: { - [1666962605.946556][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d24040318360218181818290424ff0118 - [1666962605.946572][218195:218195] CHIP:DMG: } - [1666962605.946586][218195:218195] CHIP:DMG: - [1666962605.946696][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962605.946715][218195:218195] CHIP:DMG: { - [1666962605.946729][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962605.946747][218195:218195] CHIP:DMG: [ - [1666962605.946761][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962605.946782][218195:218195] CHIP:DMG: { - [1666962605.946796][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962605.946810][218195:218195] CHIP:DMG: { - [1666962605.946826][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666962605.946840][218195:218195] CHIP:DMG: AttributePathIB = - [1666962605.946854][218195:218195] CHIP:DMG: { - [1666962605.946883][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666962605.946898][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962605.946914][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962605.946927][218195:218195] CHIP:DMG: } - [1666962605.946944][218195:218195] CHIP:DMG: - [1666962605.946958][218195:218195] CHIP:DMG: Data = [ - [1666962605.946972][218195:218195] CHIP:DMG: - [1666962605.946987][218195:218195] CHIP:DMG: ], - [1666962605.946999][218195:218195] CHIP:DMG: }, - [1666962605.947016][218195:218195] CHIP:DMG: - [1666962605.947028][218195:218195] CHIP:DMG: }, - [1666962605.947044][218195:218195] CHIP:DMG: - [1666962605.947056][218195:218195] CHIP:DMG: ], - [1666962605.947074][218195:218195] CHIP:DMG: - [1666962605.947103][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962605.947120][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962605.947132][218195:218195] CHIP:DMG: } - [1666962605.947147][218195:218195] CHIP:DMG: + Verify the PartList attribute response with endpoint 11 On TH(bridge-app) Log: + + [1666962605.941370][218195:218195] CHIP:IM: Received Read request + [1666962605.941421][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962605.941433][218195:218195] CHIP:DMG: { + [1666962605.941444][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962605.941457][218195:218195] CHIP:DMG: [ + [1666962605.941468][218195:218195] CHIP:DMG: AttributePathIB = + [1666962605.941482][218195:218195] CHIP:DMG: { + [1666962605.941495][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666962605.941508][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962605.941522][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962605.941535][218195:218195] CHIP:DMG: } + [1666962605.941550][218195:218195] CHIP:DMG: + [1666962605.941561][218195:218195] CHIP:DMG: ], + [1666962605.941576][218195:218195] CHIP:DMG: + [1666962605.941589][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962605.941600][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962605.941611][218195:218195] CHIP:DMG: }, + [1666962605.941660][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962605.941704][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962605.941719][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962605.941730][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0003 (expanded=0) + [1666962605.941747][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v + [1666962605.941765][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962605.941796][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962605.941969][218195:218195] CHIP:EM: <<< [E:53228r M:194033500 (Ack:241544232)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962605.941995][218195:218195] CHIP:IN: (S) Sending msg 194033500 on secure session with LSID: 51725 + [1666962605.942217][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45700 | 194033500 | [Interaction Model (1) / Report Data (0x05) / Session = 60703 / Exchange = 53228] + [1666962605.942243][218195:218195] CHIP:DMG: Header Flags = + [1666962605.942254][218195:218195] CHIP:DMG: { + [1666962605.942277][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962605.942288][218195:218195] CHIP:DMG: { + [1666962605.946293][218195:218195] CHIP:DMG: AckMsg = 241544232 + [1666962605.946325][218195:218195] CHIP:DMG: NeedsAck = true + [1666962605.946339][218195:218195] CHIP:DMG: } + [1666962605.946376][218195:218195] CHIP:DMG: } + [1666962605.946393][218195:218195] CHIP:DMG: + [1666962605.946424][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962605.946439][218195:218195] CHIP:DMG: { + [1666962605.946455][218195:218195] CHIP:DMG: data = 001fed005cb7900b4a137fb3c5753516fcbff9678f1b2cbf9cd04d6df60e3a9bdebf9a6f9713b60c34567f235d2aa407a9e18ed6dfdb1eb2ef70245e7b8a7a5213192b956d81 + [1666962605.946470][218195:218195] CHIP:DMG: buffer_ptr = 94136416766624 + [1666962605.946484][218195:218195] CHIP:DMG: } + [1666962605.946498][218195:218195] CHIP:DMG: + [1666962605.946525][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962605.946541][218195:218195] CHIP:DMG: { + [1666962605.946556][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d24040318360218181818290424ff0118 + [1666962605.946572][218195:218195] CHIP:DMG: } + [1666962605.946586][218195:218195] CHIP:DMG: + [1666962605.946696][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962605.946715][218195:218195] CHIP:DMG: { + [1666962605.946729][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962605.946747][218195:218195] CHIP:DMG: [ + [1666962605.946761][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962605.946782][218195:218195] CHIP:DMG: { + [1666962605.946796][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962605.946810][218195:218195] CHIP:DMG: { + [1666962605.946826][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666962605.946840][218195:218195] CHIP:DMG: AttributePathIB = + [1666962605.946854][218195:218195] CHIP:DMG: { + [1666962605.946883][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666962605.946898][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962605.946914][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962605.946927][218195:218195] CHIP:DMG: } + [1666962605.946944][218195:218195] CHIP:DMG: + [1666962605.946958][218195:218195] CHIP:DMG: Data = [ + [1666962605.946972][218195:218195] CHIP:DMG: + [1666962605.946987][218195:218195] CHIP:DMG: ], + [1666962605.946999][218195:218195] CHIP:DMG: }, + [1666962605.947016][218195:218195] CHIP:DMG: + [1666962605.947028][218195:218195] CHIP:DMG: }, + [1666962605.947044][218195:218195] CHIP:DMG: + [1666962605.947056][218195:218195] CHIP:DMG: ], + [1666962605.947074][218195:218195] CHIP:DMG: + [1666962605.947103][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962605.947120][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962605.947132][218195:218195] CHIP:DMG: } + [1666962605.947147][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 12 - Verify the PartList attribute response with endpoint 12 On TH(bridge-app) Log: - - [1666962633.918167][218195:218195] CHIP:IM: Received Read request - [1666962633.918280][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962633.918309][218195:218195] CHIP:DMG: { - [1666962633.918332][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962633.918356][218195:218195] CHIP:DMG: [ - [1666962633.918376][218195:218195] CHIP:DMG: AttributePathIB = - [1666962633.918404][218195:218195] CHIP:DMG: { - [1666962633.918435][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666962633.918466][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962633.918498][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962633.918527][218195:218195] CHIP:DMG: } - [1666962633.918562][218195:218195] CHIP:DMG: - [1666962633.918590][218195:218195] CHIP:DMG: ], - [1666962633.918626][218195:218195] CHIP:DMG: - [1666962633.918655][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962633.918683][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962633.918709][218195:218195] CHIP:DMG: }, - [1666962633.918817][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962633.918912][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962633.918947][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962633.918976][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0003 (expanded=0) - [1666962633.919018][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v - [1666962633.919060][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962633.919174][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962633.919525][218195:218195] CHIP:EM: <<< [E:35660r M:223187611 (Ack:233122113)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962633.919569][218195:218195] CHIP:IN: (S) Sending msg 223187611 on secure session with LSID: 51726 - [1666962633.920056][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36920 | 223187611 | [Interaction Model (1) / Report Data (0x05) / Session = 9443 / Exchange = 35660] - [1666962633.920109][218195:218195] CHIP:DMG: Header Flags = - [1666962633.920135][218195:218195] CHIP:DMG: { - [1666962633.920191][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962633.920217][218195:218195] CHIP:DMG: { - [1666962633.920247][218195:218195] CHIP:DMG: AckMsg = 233122113 - [1666962633.920274][218195:218195] CHIP:DMG: NeedsAck = true - [1666962633.920298][218195:218195] CHIP:DMG: } - [1666962633.920341][218195:218195] CHIP:DMG: } - [1666962633.920369][218195:218195] CHIP:DMG: - [1666962633.920402][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962633.920429][218195:218195] CHIP:DMG: { - [1666962633.920457][218195:218195] CHIP:DMG: data = 00e324009b924d0de62b84bd7b24624502b15e2ec8b599c529c8ac3a956f5e9a79da1da8c1aa91b82ba68ef69977ca852087f29101f04a5ac0a4d021c627302b9504b6d3223f - [1666962633.920482][218195:218195] CHIP:DMG: buffer_ptr = 94136416766688 - [1666962633.920507][218195:218195] CHIP:DMG: } - [1666962633.920528][218195:218195] CHIP:DMG: - [1666962633.920579][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962633.920607][218195:218195] CHIP:DMG: { - [1666962633.920632][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d24040318360218181818290424ff0118 - [1666962633.920659][218195:218195] CHIP:DMG: } - [1666962633.920684][218195:218195] CHIP:DMG: - [1666962633.920786][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962633.920814][218195:218195] CHIP:DMG: { - [1666962633.920837][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962633.920874][218195:218195] CHIP:DMG: [ - [1666962633.920901][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962633.920945][218195:218195] CHIP:DMG: { - [1666962633.920972][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962633.921004][218195:218195] CHIP:DMG: { - [1666962633.921039][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666962633.921085][218195:218195] CHIP:DMG: AttributePathIB = - [1666962633.921119][218195:218195] CHIP:DMG: { - [1666962633.921153][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666962633.921187][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962633.921229][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962633.921262][218195:218195] CHIP:DMG: } - [1666962633.921298][218195:218195] CHIP:DMG: - [1666962633.921331][218195:218195] CHIP:DMG: Data = [ - [1666962633.921366][218195:218195] CHIP:DMG: - [1666962633.921399][218195:218195] CHIP:DMG: ], - [1666962633.921430][218195:218195] CHIP:DMG: }, - [1666962633.921471][218195:218195] CHIP:DMG: - [1666962633.921501][218195:218195] CHIP:DMG: }, - [1666962633.921541][218195:218195] CHIP:DMG: - [1666962633.921570][218195:218195] CHIP:DMG: ], - [1666962633.921610][218195:218195] CHIP:DMG: - [1666962633.921641][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962633.921670][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962633.921695][218195:218195] CHIP:DMG: } - [1666962633.921723][218195:218195] CHIP:DMG: - - ./chip-tool descriptor read parts-list 1 13 - - Verify the PartList attribute response with endpoint 13 On TH(bridge-app) Log: - - [1666962673.106887][218195:218195] CHIP:IM: Received Read request - [1666962673.106920][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962673.106927][218195:218195] CHIP:DMG: { - [1666962673.106934][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962673.106943][218195:218195] CHIP:DMG: [ - [1666962673.106951][218195:218195] CHIP:DMG: AttributePathIB = - [1666962673.106960][218195:218195] CHIP:DMG: { - [1666962673.106969][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666962673.106978][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962673.106988][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962673.106997][218195:218195] CHIP:DMG: } - [1666962673.107007][218195:218195] CHIP:DMG: - [1666962673.107015][218195:218195] CHIP:DMG: ], - [1666962673.107026][218195:218195] CHIP:DMG: - [1666962673.107033][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962673.107042][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962673.107049][218195:218195] CHIP:DMG: }, - [1666962673.107081][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962673.107120][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962673.107130][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962673.107138][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=d AttributeId=0x0000_0003 (expanded=0) - [1666962673.107149][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=13 p=v - [1666962673.107162][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962673.107184][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962673.107292][218195:218195] CHIP:EM: <<< [E:54576r M:192461937 (Ack:92650181)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962673.107304][218195:218195] CHIP:IN: (S) Sending msg 192461937 on secure session with LSID: 51727 - [1666962673.107438][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:48254 | 192461937 | [Interaction Model (1) / Report Data (0x05) / Session = 26753 / Exchange = 54576] - [1666962673.107452][218195:218195] CHIP:DMG: Header Flags = - [1666962673.107459][218195:218195] CHIP:DMG: { - [1666962673.107474][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962673.107481][218195:218195] CHIP:DMG: { - [1666962673.107490][218195:218195] CHIP:DMG: AckMsg = 92650181 - [1666962673.107497][218195:218195] CHIP:DMG: NeedsAck = true - [1666962673.107504][218195:218195] CHIP:DMG: } - [1666962673.107517][218195:218195] CHIP:DMG: } - [1666962673.107524][218195:218195] CHIP:DMG: - [1666962673.107536][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962673.107543][218195:218195] CHIP:DMG: { - [1666962673.107550][218195:218195] CHIP:DMG: data = 0081680071bc780bf00a274e8929a9bc304a85e9477043931f3d4ac244eadb4ef8445cc8f478e90ccc88289152f3fe2c881bde5b4abd18c203cfeae79957eb3cb177cdfb23f9 - [1666962673.107558][218195:218195] CHIP:DMG: buffer_ptr = 94136416766832 - [1666962673.107565][218195:218195] CHIP:DMG: } - [1666962673.107573][218195:218195] CHIP:DMG: - [1666962673.107586][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962673.107593][218195:218195] CHIP:DMG: { - [1666962673.107601][218195:218195] CHIP:DMG: data = 15360115350126008fecadea370124020d24031d24040318360218181818290424ff0118 - [1666962673.107608][218195:218195] CHIP:DMG: } - [1666962673.107615][218195:218195] CHIP:DMG: - [1666962673.107643][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962673.107649][218195:218195] CHIP:DMG: { - [1666962673.107656][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962673.107669][218195:218195] CHIP:DMG: [ - [1666962673.107677][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962673.107690][218195:218195] CHIP:DMG: { - [1666962673.107698][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962673.107707][218195:218195] CHIP:DMG: { - [1666962673.107717][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666962673.107728][218195:218195] CHIP:DMG: AttributePathIB = - [1666962673.107738][218195:218195] CHIP:DMG: { - [1666962673.107750][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666962673.107760][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962673.107772][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962673.107782][218195:218195] CHIP:DMG: } - [1666962673.107795][218195:218195] CHIP:DMG: - [1666962673.107803][218195:218195] CHIP:DMG: Data = [ - [1666962673.107816][218195:218195] CHIP:DMG: - [1666962673.107826][218195:218195] CHIP:DMG: ], - [1666962673.107836][218195:218195] CHIP:DMG: }, - [1666962673.107848][218195:218195] CHIP:DMG: - [1666962673.107857][218195:218195] CHIP:DMG: }, - [1666962673.107869][218195:218195] CHIP:DMG: - [1666962673.107876][218195:218195] CHIP:DMG: ], - [1666962673.107888][218195:218195] CHIP:DMG: - [1666962673.107896][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962673.107904][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962673.107911][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 12 On TH(bridge-app) Log: + + [1666962633.918167][218195:218195] CHIP:IM: Received Read request + [1666962633.918280][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962633.918309][218195:218195] CHIP:DMG: { + [1666962633.918332][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962633.918356][218195:218195] CHIP:DMG: [ + [1666962633.918376][218195:218195] CHIP:DMG: AttributePathIB = + [1666962633.918404][218195:218195] CHIP:DMG: { + [1666962633.918435][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666962633.918466][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962633.918498][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962633.918527][218195:218195] CHIP:DMG: } + [1666962633.918562][218195:218195] CHIP:DMG: + [1666962633.918590][218195:218195] CHIP:DMG: ], + [1666962633.918626][218195:218195] CHIP:DMG: + [1666962633.918655][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962633.918683][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962633.918709][218195:218195] CHIP:DMG: }, + [1666962633.918817][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962633.918912][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962633.918947][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962633.918976][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0003 (expanded=0) + [1666962633.919018][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v + [1666962633.919060][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962633.919174][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962633.919525][218195:218195] CHIP:EM: <<< [E:35660r M:223187611 (Ack:233122113)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962633.919569][218195:218195] CHIP:IN: (S) Sending msg 223187611 on secure session with LSID: 51726 + [1666962633.920056][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36920 | 223187611 | [Interaction Model (1) / Report Data (0x05) / Session = 9443 / Exchange = 35660] + [1666962633.920109][218195:218195] CHIP:DMG: Header Flags = + [1666962633.920135][218195:218195] CHIP:DMG: { + [1666962633.920191][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962633.920217][218195:218195] CHIP:DMG: { + [1666962633.920247][218195:218195] CHIP:DMG: AckMsg = 233122113 + [1666962633.920274][218195:218195] CHIP:DMG: NeedsAck = true + [1666962633.920298][218195:218195] CHIP:DMG: } + [1666962633.920341][218195:218195] CHIP:DMG: } + [1666962633.920369][218195:218195] CHIP:DMG: + [1666962633.920402][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962633.920429][218195:218195] CHIP:DMG: { + [1666962633.920457][218195:218195] CHIP:DMG: data = 00e324009b924d0de62b84bd7b24624502b15e2ec8b599c529c8ac3a956f5e9a79da1da8c1aa91b82ba68ef69977ca852087f29101f04a5ac0a4d021c627302b9504b6d3223f + [1666962633.920482][218195:218195] CHIP:DMG: buffer_ptr = 94136416766688 + [1666962633.920507][218195:218195] CHIP:DMG: } + [1666962633.920528][218195:218195] CHIP:DMG: + [1666962633.920579][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962633.920607][218195:218195] CHIP:DMG: { + [1666962633.920632][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d24040318360218181818290424ff0118 + [1666962633.920659][218195:218195] CHIP:DMG: } + [1666962633.920684][218195:218195] CHIP:DMG: + [1666962633.920786][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962633.920814][218195:218195] CHIP:DMG: { + [1666962633.920837][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962633.920874][218195:218195] CHIP:DMG: [ + [1666962633.920901][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962633.920945][218195:218195] CHIP:DMG: { + [1666962633.920972][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962633.921004][218195:218195] CHIP:DMG: { + [1666962633.921039][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666962633.921085][218195:218195] CHIP:DMG: AttributePathIB = + [1666962633.921119][218195:218195] CHIP:DMG: { + [1666962633.921153][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666962633.921187][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962633.921229][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962633.921262][218195:218195] CHIP:DMG: } + [1666962633.921298][218195:218195] CHIP:DMG: + [1666962633.921331][218195:218195] CHIP:DMG: Data = [ + [1666962633.921366][218195:218195] CHIP:DMG: + [1666962633.921399][218195:218195] CHIP:DMG: ], + [1666962633.921430][218195:218195] CHIP:DMG: }, + [1666962633.921471][218195:218195] CHIP:DMG: + [1666962633.921501][218195:218195] CHIP:DMG: }, + [1666962633.921541][218195:218195] CHIP:DMG: + [1666962633.921570][218195:218195] CHIP:DMG: ], + [1666962633.921610][218195:218195] CHIP:DMG: + [1666962633.921641][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962633.921670][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962633.921695][218195:218195] CHIP:DMG: } + [1666962633.921723][218195:218195] CHIP:DMG: disabled: true - - label: "Verify DUT contains the (supported) devices from the above list" + - label: + "Step 1b: Verify DUT contains the (supported) devices from the above + list" PICS: MCORE.DEVLIST.UseDevices verification: | ./chip-tool descriptor read device-type-list 1 1 - Verify the DeviceTypeList attribute response with endpoint 1 On TH(bridge-app) Log: - - [1666960977.561385][218195:218195] CHIP:IM: Received Read request - [1666960977.561428][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666960977.561438][218195:218195] CHIP:DMG: { - [1666960977.561447][218195:218195] CHIP:DMG: AttributePathIBs = - [1666960977.561459][218195:218195] CHIP:DMG: [ - [1666960977.561468][218195:218195] CHIP:DMG: AttributePathIB = - [1666960977.561480][218195:218195] CHIP:DMG: { - [1666960977.561491][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666960977.561502][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666960977.561513][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666960977.561523][218195:218195] CHIP:DMG: } - [1666960977.561536][218195:218195] CHIP:DMG: - [1666960977.561545][218195:218195] CHIP:DMG: ], - [1666960977.561558][218195:218195] CHIP:DMG: - [1666960977.561569][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666960977.561579][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666960977.561589][218195:218195] CHIP:DMG: }, - [1666960977.561628][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666960977.561663][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666960977.561674][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666960977.561684][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0000 (expanded=0) - [1666960977.561699][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v - [1666960977.561715][218195:218195] CHIP:DMG: AccessControl: allowed - [1666960977.561742][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... - [1666960977.561915][218195:218195] CHIP:EM: <<< [E:19859r M:66858920 (Ack:246619441)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666960977.561936][218195:218195] CHIP:IN: (S) Sending msg 66858920 on secure session with LSID: 51698 - [1666960977.562174][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:50021 | 66858920 | [Interaction Model (1) / Report Data (0x05) / Session = 21485 / Exchange = 19859] - [1666960977.562195][218195:218195] CHIP:DMG: Header Flags = - [1666960977.562203][218195:218195] CHIP:DMG: { - [1666960977.562224][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666960977.562233][218195:218195] CHIP:DMG: { - [1666960977.571149][218195:218195] CHIP:DMG: AckMsg = 246619441 - [1666960977.571171][218195:218195] CHIP:DMG: NeedsAck = true - [1666960977.571182][218195:218195] CHIP:DMG: } - [1666960977.571201][218195:218195] CHIP:DMG: } - [1666960977.571210][218195:218195] CHIP:DMG: - [1666960977.571227][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = - [1666960977.571236][218195:218195] CHIP:DMG: { - [1666960977.571246][218195:218195] CHIP:DMG: data = 00ed5300a82ffc0337a52e258f659192777c3fadf81100acb86097c2bea918d8e138754797c4ae4527571aa330996cef214c3db379588b2e869e461467568c1778cefd252b3962d5e5af522edf6a23860e1a3d443093f8d6345dd2244d69fa3b5e3720f1b7321a1f - [1666960977.571257][218195:218195] CHIP:DMG: buffer_ptr = 94136416758448 - [1666960977.571266][218195:218195] CHIP:DMG: } - [1666960977.571274][218195:218195] CHIP:DMG: - [1666960977.571290][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = - [1666960977.571299][218195:218195] CHIP:DMG: { - [1666960977.571308][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404001836021818181535012600189f3e59370124020124031d240400340518350224000e24010118181818290424ff0118 - [1666960977.571317][218195:218195] CHIP:DMG: } - [1666960977.571325][218195:218195] CHIP:DMG: - [1666960977.571382][218195:218195] CHIP:DMG: ReportDataMessage = - [1666960977.571398][218195:218195] CHIP:DMG: { - [1666960977.571406][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666960977.571420][218195:218195] CHIP:DMG: [ - [1666960977.571427][218195:218195] CHIP:DMG: AttributeReportIB = - [1666960977.571440][218195:218195] CHIP:DMG: { - [1666960977.571455][218195:218195] CHIP:DMG: AttributeDataIB = - [1666960977.571470][218195:218195] CHIP:DMG: { - [1666960977.571484][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666960977.571495][218195:218195] CHIP:DMG: AttributePathIB = - [1666960977.571505][218195:218195] CHIP:DMG: { - [1666960977.571516][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666960977.571528][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666960977.571542][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666960977.571552][218195:218195] CHIP:DMG: } - [1666960977.571565][218195:218195] CHIP:DMG: - [1666960977.571576][218195:218195] CHIP:DMG: Data = [ - [1666960977.571588][218195:218195] CHIP:DMG: - [1666960977.571599][218195:218195] CHIP:DMG: ], - [1666960977.571608][218195:218195] CHIP:DMG: }, - [1666960977.571622][218195:218195] CHIP:DMG: - [1666960977.571631][218195:218195] CHIP:DMG: }, - [1666960977.571650][218195:218195] CHIP:DMG: - [1666960977.571659][218195:218195] CHIP:DMG: AttributeReportIB = - [1666960977.571674][218195:218195] CHIP:DMG: { - [1666960977.571683][218195:218195] CHIP:DMG: AttributeDataIB = - [1666960977.571693][218195:218195] CHIP:DMG: { - [1666960977.571703][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666960977.571713][218195:218195] CHIP:DMG: AttributePathIB = - [1666960977.571724][218195:218195] CHIP:DMG: { - [1666960977.571735][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666960977.571746][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666960977.571757][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666960977.571767][218195:218195] CHIP:DMG: ListIndex = Null, - [1666960977.571777][218195:218195] CHIP:DMG: } - [1666960977.571789][218195:218195] CHIP:DMG: - [1666960977.571799][218195:218195] CHIP:DMG: Data = - [1666960977.571811][218195:218195] CHIP:DMG: { - [1666960977.571822][218195:218195] CHIP:DMG: 0x0 = 14, - [1666960977.571833][218195:218195] CHIP:DMG: 0x1 = 1, - [1666960977.571845][218195:218195] CHIP:DMG: }, - [1666960977.571855][218195:218195] CHIP:DMG: }, - [1666960977.571868][218195:218195] CHIP:DMG: - [1666960977.571877][218195:218195] CHIP:DMG: }, - [1666960977.571891][218195:218195] CHIP:DMG: - [1666960977.571900][218195:218195] CHIP:DMG: ], - [1666960977.571918][218195:218195] CHIP:DMG: - [1666960977.571929][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666960977.571939][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666960977.571948][218195:218195] CHIP:DMG: } - - ./chip-tool descriptor read device-type-list 1 2 - - Verify the DeviceTypeList attribute response with endpoint 2 On TH(bridge-app) Log: - - [1666961027.989897][218195:218195] CHIP:IM: Received Read request - [1666961027.989925][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961027.989932][218195:218195] CHIP:DMG: { - [1666961027.989938][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961027.989945][218195:218195] CHIP:DMG: [ - [1666961027.989951][218195:218195] CHIP:DMG: AttributePathIB = - [1666961027.989958][218195:218195] CHIP:DMG: { - [1666961027.989965][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666961027.989971][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961027.989978][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961027.989984][218195:218195] CHIP:DMG: } - [1666961027.989991][218195:218195] CHIP:DMG: - [1666961027.989997][218195:218195] CHIP:DMG: ], - [1666961027.990007][218195:218195] CHIP:DMG: - [1666961027.990013][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961027.990019][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961027.990025][218195:218195] CHIP:DMG: }, - [1666961027.990049][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961027.990075][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961027.990084][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961027.990090][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=2 AttributeId=0x0000_0000 (expanded=0) - [1666961027.990105][218195:218195] CHIP:DMG: Sending report (payload has 33 bytes)... - [1666961027.990205][218195:218195] CHIP:EM: <<< [E:25377r M:99613400 (Ack:20435852)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961027.990220][218195:218195] CHIP:IN: (S) Sending msg 99613400 on secure session with LSID: 51699 - [1666961027.990335][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:59337 | 99613400 | [Interaction Model (1) / Report Data (0x05) / Session = 25530 / Exchange = 25377] - [1666961027.990350][218195:218195] CHIP:DMG: Header Flags = - [1666961027.990356][218195:218195] CHIP:DMG: { - [1666961027.990368][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961027.990374][218195:218195] CHIP:DMG: { - [1666961027.990380][218195:218195] CHIP:DMG: AckMsg = 20435852 - [1666961027.990385][218195:218195] CHIP:DMG: NeedsAck = true - [1666961027.990391][218195:218195] CHIP:DMG: } - [1666961027.990400][218195:218195] CHIP:DMG: } - [1666961027.990406][218195:218195] CHIP:DMG: - [1666961027.990414][218195:218195] CHIP:DMG: Encrypted Payload (67 bytes) = - [1666961027.990420][218195:218195] CHIP:DMG: { - [1666961027.990425][218195:218195] CHIP:DMG: data = 00ba6300d8faef05a3171dc2f01fdfeb17482c05dff74f84b12f10b422b3d9f698cfa5e53a094002e2a28de508c04cfa811aaf4bf156fabd7fbf11fadd813d59acb663 - [1666961027.990431][218195:218195] CHIP:DMG: buffer_ptr = 94136416758992 - [1666961027.990437][218195:218195] CHIP:DMG: } - [1666961027.990443][218195:218195] CHIP:DMG: - [1666961027.990452][218195:218195] CHIP:DMG: Decrypted Payload (33 bytes) = - [1666961027.990457][218195:218195] CHIP:DMG: { - [1666961027.990463][218195:218195] CHIP:DMG: data = 153601153500370024020224031d24040018350124007f18181818290424ff0118 - [1666961027.990469][218195:218195] CHIP:DMG: } - [1666961027.990474][218195:218195] CHIP:DMG: - [1666961027.990495][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961027.990502][218195:218195] CHIP:DMG: { - [1666961027.990508][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961027.990517][218195:218195] CHIP:DMG: [ - [1666961027.990523][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961027.990533][218195:218195] CHIP:DMG: { - [1666961027.990540][218195:218195] CHIP:DMG: AttributeStatusIB = - [1666961027.990547][218195:218195] CHIP:DMG: { - [1666961027.990553][218195:218195] CHIP:DMG: AttributePathIB = - [1666961027.990561][218195:218195] CHIP:DMG: { - [1666961027.990568][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666961027.990575][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961027.990583][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961027.990593][218195:218195] CHIP:DMG: } - [1666961027.990603][218195:218195] CHIP:DMG: - [1666961027.990613][218195:218195] CHIP:DMG: StatusIB = - [1666961027.990621][218195:218195] CHIP:DMG: { - [1666961027.990629][218195:218195] CHIP:DMG: status = 0x7f (UNSUPPORTED_ENDPOINT), - [1666961027.990635][218195:218195] CHIP:DMG: }, - [1666961027.990643][218195:218195] CHIP:DMG: - [1666961027.990649][218195:218195] CHIP:DMG: }, - [1666961027.990657][218195:218195] CHIP:DMG: - [1666961027.990663][218195:218195] CHIP:DMG: }, - [1666961027.990672][218195:218195] CHIP:DMG: - [1666961027.990678][218195:218195] CHIP:DMG: ], - [1666961027.990687][218195:218195] CHIP:DMG: - [1666961027.990693][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961027.990700][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961027.990705][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 1 On TH(bridge-app) Log: + + [1666960977.561385][218195:218195] CHIP:IM: Received Read request + [1666960977.561428][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666960977.561438][218195:218195] CHIP:DMG: { + [1666960977.561447][218195:218195] CHIP:DMG: AttributePathIBs = + [1666960977.561459][218195:218195] CHIP:DMG: [ + [1666960977.561468][218195:218195] CHIP:DMG: AttributePathIB = + [1666960977.561480][218195:218195] CHIP:DMG: { + [1666960977.561491][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666960977.561502][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666960977.561513][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666960977.561523][218195:218195] CHIP:DMG: } + [1666960977.561536][218195:218195] CHIP:DMG: + [1666960977.561545][218195:218195] CHIP:DMG: ], + [1666960977.561558][218195:218195] CHIP:DMG: + [1666960977.561569][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666960977.561579][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666960977.561589][218195:218195] CHIP:DMG: }, + [1666960977.561628][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666960977.561663][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666960977.561674][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666960977.561684][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1666960977.561699][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v + [1666960977.561715][218195:218195] CHIP:DMG: AccessControl: allowed + [1666960977.561742][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... + [1666960977.561915][218195:218195] CHIP:EM: <<< [E:19859r M:66858920 (Ack:246619441)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666960977.561936][218195:218195] CHIP:IN: (S) Sending msg 66858920 on secure session with LSID: 51698 + [1666960977.562174][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:50021 | 66858920 | [Interaction Model (1) / Report Data (0x05) / Session = 21485 / Exchange = 19859] + [1666960977.562195][218195:218195] CHIP:DMG: Header Flags = + [1666960977.562203][218195:218195] CHIP:DMG: { + [1666960977.562224][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666960977.562233][218195:218195] CHIP:DMG: { + [1666960977.571149][218195:218195] CHIP:DMG: AckMsg = 246619441 + [1666960977.571171][218195:218195] CHIP:DMG: NeedsAck = true + [1666960977.571182][218195:218195] CHIP:DMG: } + [1666960977.571201][218195:218195] CHIP:DMG: } + [1666960977.571210][218195:218195] CHIP:DMG: + [1666960977.571227][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = + [1666960977.571236][218195:218195] CHIP:DMG: { + [1666960977.571246][218195:218195] CHIP:DMG: data = 00ed5300a82ffc0337a52e258f659192777c3fadf81100acb86097c2bea918d8e138754797c4ae4527571aa330996cef214c3db379588b2e869e461467568c1778cefd252b3962d5e5af522edf6a23860e1a3d443093f8d6345dd2244d69fa3b5e3720f1b7321a1f + [1666960977.571257][218195:218195] CHIP:DMG: buffer_ptr = 94136416758448 + [1666960977.571266][218195:218195] CHIP:DMG: } + [1666960977.571274][218195:218195] CHIP:DMG: + [1666960977.571290][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = + [1666960977.571299][218195:218195] CHIP:DMG: { + [1666960977.571308][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404001836021818181535012600189f3e59370124020124031d240400340518350224000e24010118181818290424ff0118 + [1666960977.571317][218195:218195] CHIP:DMG: } + [1666960977.571325][218195:218195] CHIP:DMG: + [1666960977.571382][218195:218195] CHIP:DMG: ReportDataMessage = + [1666960977.571398][218195:218195] CHIP:DMG: { + [1666960977.571406][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666960977.571420][218195:218195] CHIP:DMG: [ + [1666960977.571427][218195:218195] CHIP:DMG: AttributeReportIB = + [1666960977.571440][218195:218195] CHIP:DMG: { + [1666960977.571455][218195:218195] CHIP:DMG: AttributeDataIB = + [1666960977.571470][218195:218195] CHIP:DMG: { + [1666960977.571484][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666960977.571495][218195:218195] CHIP:DMG: AttributePathIB = + [1666960977.571505][218195:218195] CHIP:DMG: { + [1666960977.571516][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666960977.571528][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666960977.571542][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666960977.571552][218195:218195] CHIP:DMG: } + [1666960977.571565][218195:218195] CHIP:DMG: + [1666960977.571576][218195:218195] CHIP:DMG: Data = [ + [1666960977.571588][218195:218195] CHIP:DMG: + [1666960977.571599][218195:218195] CHIP:DMG: ], + [1666960977.571608][218195:218195] CHIP:DMG: }, + [1666960977.571622][218195:218195] CHIP:DMG: + [1666960977.571631][218195:218195] CHIP:DMG: }, + [1666960977.571650][218195:218195] CHIP:DMG: + [1666960977.571659][218195:218195] CHIP:DMG: AttributeReportIB = + [1666960977.571674][218195:218195] CHIP:DMG: { + [1666960977.571683][218195:218195] CHIP:DMG: AttributeDataIB = + [1666960977.571693][218195:218195] CHIP:DMG: { + [1666960977.571703][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666960977.571713][218195:218195] CHIP:DMG: AttributePathIB = + [1666960977.571724][218195:218195] CHIP:DMG: { + [1666960977.571735][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666960977.571746][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666960977.571757][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666960977.571767][218195:218195] CHIP:DMG: ListIndex = Null, + [1666960977.571777][218195:218195] CHIP:DMG: } + [1666960977.571789][218195:218195] CHIP:DMG: + [1666960977.571799][218195:218195] CHIP:DMG: Data = + [1666960977.571811][218195:218195] CHIP:DMG: { + [1666960977.571822][218195:218195] CHIP:DMG: 0x0 = 14, + [1666960977.571833][218195:218195] CHIP:DMG: 0x1 = 1, + [1666960977.571845][218195:218195] CHIP:DMG: }, + [1666960977.571855][218195:218195] CHIP:DMG: }, + [1666960977.571868][218195:218195] CHIP:DMG: + [1666960977.571877][218195:218195] CHIP:DMG: }, + [1666960977.571891][218195:218195] CHIP:DMG: + [1666960977.571900][218195:218195] CHIP:DMG: ], + [1666960977.571918][218195:218195] CHIP:DMG: + [1666960977.571929][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666960977.571939][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666960977.571948][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 3 - Verify the DeviceTypeList attribute response with endpoint 3 On TH(bridge-app) Log: - - [1666961101.342071][218195:218195] CHIP:IM: Received Read request - [1666961101.342101][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961101.342108][218195:218195] CHIP:DMG: { - [1666961101.342114][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961101.342121][218195:218195] CHIP:DMG: [ - [1666961101.342127][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.342134][218195:218195] CHIP:DMG: { - [1666961101.342142][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.342149][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.342157][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.342163][218195:218195] CHIP:DMG: } - [1666961101.342171][218195:218195] CHIP:DMG: - [1666961101.342177][218195:218195] CHIP:DMG: ], - [1666961101.342185][218195:218195] CHIP:DMG: - [1666961101.342191][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961101.342197][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961101.342203][218195:218195] CHIP:DMG: }, - [1666961101.342228][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961101.342255][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961101.342265][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961101.342271][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0000 (expanded=0) - [1666961101.342282][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v - [1666961101.342293][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961101.342318][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961101.342441][218195:218195] CHIP:EM: <<< [E:3417r M:212393572 (Ack:105083298)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961101.342459][218195:218195] CHIP:IN: (S) Sending msg 212393572 on secure session with LSID: 51700 - [1666961101.342589][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44267 | 212393572 | [Interaction Model (1) / Report Data (0x05) / Session = 11791 / Exchange = 3417] - [1666961101.342604][218195:218195] CHIP:DMG: Header Flags = - [1666961101.342611][218195:218195] CHIP:DMG: { - [1666961101.342622][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961101.342628][218195:218195] CHIP:DMG: { - [1666961101.342634][218195:218195] CHIP:DMG: AckMsg = 105083298 - [1666961101.342641][218195:218195] CHIP:DMG: NeedsAck = true - [1666961101.342648][218195:218195] CHIP:DMG: } - [1666961101.342659][218195:218195] CHIP:DMG: } - [1666961101.342667][218195:218195] CHIP:DMG: - [1666961101.342678][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961101.342684][218195:218195] CHIP:DMG: { - [1666961101.342691][218195:218195] CHIP:DMG: data = 000f2e0064dea80c8cfef495c5759ac96f27191961a9c1afd0a1cab14789f583fb3854a360f8d9271d5559eb5fb212b5b719e7dd276609906f33b528a21c8b2a827a87e3592e0f676065663d9251ac776805d148faa12589f780dd5f1ef0ba4f48487cea1f0b1ec8b9e706830d4f1b1536473018479f5ee5722f7738ecf5e210d08ac0471989aa4649a179 - [1666961101.342700][218195:218195] CHIP:DMG: buffer_ptr = 94136416759072 - [1666961101.342708][218195:218195] CHIP:DMG: } - [1666961101.342714][218195:218195] CHIP:DMG: - [1666961101.342726][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961101.342734][218195:218195] CHIP:DMG: { - [1666961101.342744][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d2404001836021818181535012600378216b4370124020324031d2404003405183502250000012401011818181535012600378216b4370124020324031d240400340518350224001324010118181818290424ff0118 - [1666961101.342752][218195:218195] CHIP:DMG: } - [1666961101.342759][218195:218195] CHIP:DMG: - [1666961101.342810][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961101.342818][218195:218195] CHIP:DMG: { - [1666961101.342824][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961101.342836][218195:218195] CHIP:DMG: [ - [1666961101.342844][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961101.342855][218195:218195] CHIP:DMG: { - [1666961101.342862][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961101.342870][218195:218195] CHIP:DMG: { - [1666961101.342878][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666961101.342888][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.342897][218195:218195] CHIP:DMG: { - [1666961101.342905][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.342914][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.342925][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.342933][218195:218195] CHIP:DMG: } - [1666961101.342943][218195:218195] CHIP:DMG: - [1666961101.342951][218195:218195] CHIP:DMG: Data = [ - [1666961101.342959][218195:218195] CHIP:DMG: - [1666961101.342971][218195:218195] CHIP:DMG: ], - [1666961101.342977][218195:218195] CHIP:DMG: }, - [1666961101.342986][218195:218195] CHIP:DMG: - [1666961101.342991][218195:218195] CHIP:DMG: }, - [1666961101.343005][218195:218195] CHIP:DMG: - [1666961101.343011][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961101.343022][218195:218195] CHIP:DMG: { - [1666961101.343029][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961101.343037][218195:218195] CHIP:DMG: { - [1666961101.343044][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666961101.343051][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.343059][218195:218195] CHIP:DMG: { - [1666961101.343067][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.343075][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.343084][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.343109][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961101.343119][218195:218195] CHIP:DMG: } - [1666961101.343127][218195:218195] CHIP:DMG: - [1666961101.343135][218195:218195] CHIP:DMG: Data = - [1666961101.343143][218195:218195] CHIP:DMG: { - [1666961101.343150][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961101.343162][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961101.343170][218195:218195] CHIP:DMG: }, - [1666961101.343177][218195:218195] CHIP:DMG: }, - [1666961101.343186][218195:218195] CHIP:DMG: - [1666961101.343194][218195:218195] CHIP:DMG: }, - [1666961101.343210][218195:218195] CHIP:DMG: - [1666961101.343216][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961101.343226][218195:218195] CHIP:DMG: { - [1666961101.343231][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961101.343238][218195:218195] CHIP:DMG: { - [1666961101.343244][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666961101.343250][218195:218195] CHIP:DMG: AttributePathIB = - [1666961101.343256][218195:218195] CHIP:DMG: { - [1666961101.343263][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666961101.343270][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961101.343276][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961101.343283][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961101.343289][218195:218195] CHIP:DMG: } - [1666961101.343297][218195:218195] CHIP:DMG: - [1666961101.343303][218195:218195] CHIP:DMG: Data = - [1666961101.343309][218195:218195] CHIP:DMG: { - [1666961101.343316][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961101.343323][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961101.343330][218195:218195] CHIP:DMG: }, - [1666961101.343335][218195:218195] CHIP:DMG: }, - [1666961101.343344][218195:218195] CHIP:DMG: - [1666961101.343349][218195:218195] CHIP:DMG: }, - [1666961101.343358][218195:218195] CHIP:DMG: - [1666961101.343364][218195:218195] CHIP:DMG: ], - [1666961101.343379][218195:218195] CHIP:DMG: - [1666961101.343385][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961101.343391][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961101.343395][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 3 On TH(bridge-app) Log: + + [1666961101.342071][218195:218195] CHIP:IM: Received Read request + [1666961101.342101][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961101.342108][218195:218195] CHIP:DMG: { + [1666961101.342114][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961101.342121][218195:218195] CHIP:DMG: [ + [1666961101.342127][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.342134][218195:218195] CHIP:DMG: { + [1666961101.342142][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.342149][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.342157][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.342163][218195:218195] CHIP:DMG: } + [1666961101.342171][218195:218195] CHIP:DMG: + [1666961101.342177][218195:218195] CHIP:DMG: ], + [1666961101.342185][218195:218195] CHIP:DMG: + [1666961101.342191][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961101.342197][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961101.342203][218195:218195] CHIP:DMG: }, + [1666961101.342228][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961101.342255][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961101.342265][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961101.342271][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0000 (expanded=0) + [1666961101.342282][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v + [1666961101.342293][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961101.342318][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961101.342441][218195:218195] CHIP:EM: <<< [E:3417r M:212393572 (Ack:105083298)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961101.342459][218195:218195] CHIP:IN: (S) Sending msg 212393572 on secure session with LSID: 51700 + [1666961101.342589][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44267 | 212393572 | [Interaction Model (1) / Report Data (0x05) / Session = 11791 / Exchange = 3417] + [1666961101.342604][218195:218195] CHIP:DMG: Header Flags = + [1666961101.342611][218195:218195] CHIP:DMG: { + [1666961101.342622][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961101.342628][218195:218195] CHIP:DMG: { + [1666961101.342634][218195:218195] CHIP:DMG: AckMsg = 105083298 + [1666961101.342641][218195:218195] CHIP:DMG: NeedsAck = true + [1666961101.342648][218195:218195] CHIP:DMG: } + [1666961101.342659][218195:218195] CHIP:DMG: } + [1666961101.342667][218195:218195] CHIP:DMG: + [1666961101.342678][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961101.342684][218195:218195] CHIP:DMG: { + [1666961101.342691][218195:218195] CHIP:DMG: data = 000f2e0064dea80c8cfef495c5759ac96f27191961a9c1afd0a1cab14789f583fb3854a360f8d9271d5559eb5fb212b5b719e7dd276609906f33b528a21c8b2a827a87e3592e0f676065663d9251ac776805d148faa12589f780dd5f1ef0ba4f48487cea1f0b1ec8b9e706830d4f1b1536473018479f5ee5722f7738ecf5e210d08ac0471989aa4649a179 + [1666961101.342700][218195:218195] CHIP:DMG: buffer_ptr = 94136416759072 + [1666961101.342708][218195:218195] CHIP:DMG: } + [1666961101.342714][218195:218195] CHIP:DMG: + [1666961101.342726][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961101.342734][218195:218195] CHIP:DMG: { + [1666961101.342744][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d2404001836021818181535012600378216b4370124020324031d2404003405183502250000012401011818181535012600378216b4370124020324031d240400340518350224001324010118181818290424ff0118 + [1666961101.342752][218195:218195] CHIP:DMG: } + [1666961101.342759][218195:218195] CHIP:DMG: + [1666961101.342810][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961101.342818][218195:218195] CHIP:DMG: { + [1666961101.342824][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961101.342836][218195:218195] CHIP:DMG: [ + [1666961101.342844][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961101.342855][218195:218195] CHIP:DMG: { + [1666961101.342862][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961101.342870][218195:218195] CHIP:DMG: { + [1666961101.342878][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666961101.342888][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.342897][218195:218195] CHIP:DMG: { + [1666961101.342905][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.342914][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.342925][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.342933][218195:218195] CHIP:DMG: } + [1666961101.342943][218195:218195] CHIP:DMG: + [1666961101.342951][218195:218195] CHIP:DMG: Data = [ + [1666961101.342959][218195:218195] CHIP:DMG: + [1666961101.342971][218195:218195] CHIP:DMG: ], + [1666961101.342977][218195:218195] CHIP:DMG: }, + [1666961101.342986][218195:218195] CHIP:DMG: + [1666961101.342991][218195:218195] CHIP:DMG: }, + [1666961101.343005][218195:218195] CHIP:DMG: + [1666961101.343011][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961101.343022][218195:218195] CHIP:DMG: { + [1666961101.343029][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961101.343037][218195:218195] CHIP:DMG: { + [1666961101.343044][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666961101.343051][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.343059][218195:218195] CHIP:DMG: { + [1666961101.343067][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.343075][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.343084][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.343109][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961101.343119][218195:218195] CHIP:DMG: } + [1666961101.343127][218195:218195] CHIP:DMG: + [1666961101.343135][218195:218195] CHIP:DMG: Data = + [1666961101.343143][218195:218195] CHIP:DMG: { + [1666961101.343150][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961101.343162][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961101.343170][218195:218195] CHIP:DMG: }, + [1666961101.343177][218195:218195] CHIP:DMG: }, + [1666961101.343186][218195:218195] CHIP:DMG: + [1666961101.343194][218195:218195] CHIP:DMG: }, + [1666961101.343210][218195:218195] CHIP:DMG: + [1666961101.343216][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961101.343226][218195:218195] CHIP:DMG: { + [1666961101.343231][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961101.343238][218195:218195] CHIP:DMG: { + [1666961101.343244][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666961101.343250][218195:218195] CHIP:DMG: AttributePathIB = + [1666961101.343256][218195:218195] CHIP:DMG: { + [1666961101.343263][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666961101.343270][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961101.343276][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961101.343283][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961101.343289][218195:218195] CHIP:DMG: } + [1666961101.343297][218195:218195] CHIP:DMG: + [1666961101.343303][218195:218195] CHIP:DMG: Data = + [1666961101.343309][218195:218195] CHIP:DMG: { + [1666961101.343316][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961101.343323][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961101.343330][218195:218195] CHIP:DMG: }, + [1666961101.343335][218195:218195] CHIP:DMG: }, + [1666961101.343344][218195:218195] CHIP:DMG: + [1666961101.343349][218195:218195] CHIP:DMG: }, + [1666961101.343358][218195:218195] CHIP:DMG: + [1666961101.343364][218195:218195] CHIP:DMG: ], + [1666961101.343379][218195:218195] CHIP:DMG: + [1666961101.343385][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961101.343391][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961101.343395][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 4 - Verify the DeviceTypeList attribute response with endpoint 4 On TH(bridge-app) Log: - - 1666961162.773915][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961162.773928][218195:218195] CHIP:DMG: { - [1666961162.773939][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961162.773952][218195:218195] CHIP:DMG: [ - [1666961162.773961][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.773973][218195:218195] CHIP:DMG: { - [1666961162.773986][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.773997][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.774008][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.774018][218195:218195] CHIP:DMG: } - [1666961162.774030][218195:218195] CHIP:DMG: - [1666961162.774043][218195:218195] CHIP:DMG: ], - [1666961162.774055][218195:218195] CHIP:DMG: - [1666961162.774066][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961162.774075][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961162.774084][218195:218195] CHIP:DMG: }, - [1666961162.774126][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961162.774176][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961162.774195][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961162.774204][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0000 (expanded=0) - [1666961162.774219][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v - [1666961162.774238][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961162.774277][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961162.774481][218195:218195] CHIP:EM: <<< [E:60120r M:2398263 (Ack:82187971)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961162.774510][218195:218195] CHIP:IN: (S) Sending msg 2398263 on secure session with LSID: 51701 - [1666961162.774763][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:56820 | 2398263 | [Interaction Model (1) / Report Data (0x05) / Session = 49517 / Exchange = 60120] - [1666961162.774791][218195:218195] CHIP:DMG: Header Flags = - [1666961162.774804][218195:218195] CHIP:DMG: { - [1666961162.774826][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961162.774837][218195:218195] CHIP:DMG: { - [1666961162.781902][218195:218195] CHIP:DMG: AckMsg = 82187971 - [1666961162.781929][218195:218195] CHIP:DMG: NeedsAck = true - [1666961162.781944][218195:218195] CHIP:DMG: } - [1666961162.781971][218195:218195] CHIP:DMG: } - [1666961162.781984][218195:218195] CHIP:DMG: - [1666961162.782007][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961162.782020][218195:218195] CHIP:DMG: { - [1666961162.782035][218195:218195] CHIP:DMG: data = 006dc10037982400ac494faea33b4f6e6ff3bea20c93b1b9b7dda5acfd39645a7b9a894ca6185ac94e00f1e59f38049f09c83c9288f15822eccf2438108e9f7592087d73d86b9a9387ef12051e0e613d8f68a37185ac6f8e73fc042d19dbd8714ee61fc1cb3466ae2e059145362db76158d6748fff4a6ff044e7fdad0d952f29867ace2b92e4bac30c4536 - [1666961162.782052][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 - [1666961162.782066][218195:218195] CHIP:DMG: } - [1666961162.782079][218195:218195] CHIP:DMG: - [1666961162.782105][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961162.782119][218195:218195] CHIP:DMG: { - [1666961162.782137][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d2404001836021818181535012600c90e9a3a370124020424031d2404003405183502250002032401011818181535012600c90e9a3a370124020424031d240400340518350224001324010118181818290424ff0118 - [1666961162.782151][218195:218195] CHIP:DMG: } - [1666961162.782159][218195:218195] CHIP:DMG: - [1666961162.782248][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961162.782264][218195:218195] CHIP:DMG: { - [1666961162.782273][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961162.782289][218195:218195] CHIP:DMG: [ - [1666961162.782299][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961162.782316][218195:218195] CHIP:DMG: { - [1666961162.782328][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961162.782343][218195:218195] CHIP:DMG: { - [1666961162.782358][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666961162.782378][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.782395][218195:218195] CHIP:DMG: { - [1666961162.782412][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.782429][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.782446][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.782463][218195:218195] CHIP:DMG: } - [1666961162.782482][218195:218195] CHIP:DMG: - [1666961162.782498][218195:218195] CHIP:DMG: Data = [ - [1666961162.782515][218195:218195] CHIP:DMG: - [1666961162.782533][218195:218195] CHIP:DMG: ], - [1666961162.782551][218195:218195] CHIP:DMG: }, - [1666961162.782572][218195:218195] CHIP:DMG: - [1666961162.782588][218195:218195] CHIP:DMG: }, - [1666961162.782616][218195:218195] CHIP:DMG: - [1666961162.782630][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961162.782654][218195:218195] CHIP:DMG: { - [1666961162.782669][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961162.782689][218195:218195] CHIP:DMG: { - [1666961162.782706][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666961162.782722][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.782741][218195:218195] CHIP:DMG: { - [1666961162.782759][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.782777][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.782795][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.782824][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961162.782838][218195:218195] CHIP:DMG: } - [1666961162.782853][218195:218195] CHIP:DMG: - [1666961162.782865][218195:218195] CHIP:DMG: Data = - [1666961162.782878][218195:218195] CHIP:DMG: { - [1666961162.782892][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961162.782908][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961162.782922][218195:218195] CHIP:DMG: }, - [1666961162.782933][218195:218195] CHIP:DMG: }, - [1666961162.782950][218195:218195] CHIP:DMG: - [1666961162.782961][218195:218195] CHIP:DMG: }, - [1666961162.782993][218195:218195] CHIP:DMG: - [1666961162.783004][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961162.783022][218195:218195] CHIP:DMG: { - [1666961162.783037][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961162.783050][218195:218195] CHIP:DMG: { - [1666961162.783065][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666961162.783077][218195:218195] CHIP:DMG: AttributePathIB = - [1666961162.783141][218195:218195] CHIP:DMG: { - [1666961162.783155][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666961162.783167][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961162.783180][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961162.783196][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961162.783208][218195:218195] CHIP:DMG: } - [1666961162.783238][218195:218195] CHIP:DMG: - [1666961162.783257][218195:218195] CHIP:DMG: Data = - [1666961162.783274][218195:218195] CHIP:DMG: { - [1666961162.783291][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961162.783308][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961162.783324][218195:218195] CHIP:DMG: }, - [1666961162.783338][218195:218195] CHIP:DMG: }, - [1666961162.783358][218195:218195] CHIP:DMG: - [1666961162.783372][218195:218195] CHIP:DMG: }, - [1666961162.783392][218195:218195] CHIP:DMG: - [1666961162.783407][218195:218195] CHIP:DMG: ], - [1666961162.783435][218195:218195] CHIP:DMG: - [1666961162.783447][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961162.783458][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961162.783468][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 4 On TH(bridge-app) Log: + + 1666961162.773915][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961162.773928][218195:218195] CHIP:DMG: { + [1666961162.773939][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961162.773952][218195:218195] CHIP:DMG: [ + [1666961162.773961][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.773973][218195:218195] CHIP:DMG: { + [1666961162.773986][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.773997][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.774008][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.774018][218195:218195] CHIP:DMG: } + [1666961162.774030][218195:218195] CHIP:DMG: + [1666961162.774043][218195:218195] CHIP:DMG: ], + [1666961162.774055][218195:218195] CHIP:DMG: + [1666961162.774066][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961162.774075][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961162.774084][218195:218195] CHIP:DMG: }, + [1666961162.774126][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961162.774176][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961162.774195][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961162.774204][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0000 (expanded=0) + [1666961162.774219][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v + [1666961162.774238][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961162.774277][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961162.774481][218195:218195] CHIP:EM: <<< [E:60120r M:2398263 (Ack:82187971)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961162.774510][218195:218195] CHIP:IN: (S) Sending msg 2398263 on secure session with LSID: 51701 + [1666961162.774763][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:56820 | 2398263 | [Interaction Model (1) / Report Data (0x05) / Session = 49517 / Exchange = 60120] + [1666961162.774791][218195:218195] CHIP:DMG: Header Flags = + [1666961162.774804][218195:218195] CHIP:DMG: { + [1666961162.774826][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961162.774837][218195:218195] CHIP:DMG: { + [1666961162.781902][218195:218195] CHIP:DMG: AckMsg = 82187971 + [1666961162.781929][218195:218195] CHIP:DMG: NeedsAck = true + [1666961162.781944][218195:218195] CHIP:DMG: } + [1666961162.781971][218195:218195] CHIP:DMG: } + [1666961162.781984][218195:218195] CHIP:DMG: + [1666961162.782007][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961162.782020][218195:218195] CHIP:DMG: { + [1666961162.782035][218195:218195] CHIP:DMG: data = 006dc10037982400ac494faea33b4f6e6ff3bea20c93b1b9b7dda5acfd39645a7b9a894ca6185ac94e00f1e59f38049f09c83c9288f15822eccf2438108e9f7592087d73d86b9a9387ef12051e0e613d8f68a37185ac6f8e73fc042d19dbd8714ee61fc1cb3466ae2e059145362db76158d6748fff4a6ff044e7fdad0d952f29867ace2b92e4bac30c4536 + [1666961162.782052][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 + [1666961162.782066][218195:218195] CHIP:DMG: } + [1666961162.782079][218195:218195] CHIP:DMG: + [1666961162.782105][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961162.782119][218195:218195] CHIP:DMG: { + [1666961162.782137][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d2404001836021818181535012600c90e9a3a370124020424031d2404003405183502250002032401011818181535012600c90e9a3a370124020424031d240400340518350224001324010118181818290424ff0118 + [1666961162.782151][218195:218195] CHIP:DMG: } + [1666961162.782159][218195:218195] CHIP:DMG: + [1666961162.782248][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961162.782264][218195:218195] CHIP:DMG: { + [1666961162.782273][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961162.782289][218195:218195] CHIP:DMG: [ + [1666961162.782299][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961162.782316][218195:218195] CHIP:DMG: { + [1666961162.782328][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961162.782343][218195:218195] CHIP:DMG: { + [1666961162.782358][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666961162.782378][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.782395][218195:218195] CHIP:DMG: { + [1666961162.782412][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.782429][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.782446][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.782463][218195:218195] CHIP:DMG: } + [1666961162.782482][218195:218195] CHIP:DMG: + [1666961162.782498][218195:218195] CHIP:DMG: Data = [ + [1666961162.782515][218195:218195] CHIP:DMG: + [1666961162.782533][218195:218195] CHIP:DMG: ], + [1666961162.782551][218195:218195] CHIP:DMG: }, + [1666961162.782572][218195:218195] CHIP:DMG: + [1666961162.782588][218195:218195] CHIP:DMG: }, + [1666961162.782616][218195:218195] CHIP:DMG: + [1666961162.782630][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961162.782654][218195:218195] CHIP:DMG: { + [1666961162.782669][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961162.782689][218195:218195] CHIP:DMG: { + [1666961162.782706][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666961162.782722][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.782741][218195:218195] CHIP:DMG: { + [1666961162.782759][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.782777][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.782795][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.782824][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961162.782838][218195:218195] CHIP:DMG: } + [1666961162.782853][218195:218195] CHIP:DMG: + [1666961162.782865][218195:218195] CHIP:DMG: Data = + [1666961162.782878][218195:218195] CHIP:DMG: { + [1666961162.782892][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961162.782908][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961162.782922][218195:218195] CHIP:DMG: }, + [1666961162.782933][218195:218195] CHIP:DMG: }, + [1666961162.782950][218195:218195] CHIP:DMG: + [1666961162.782961][218195:218195] CHIP:DMG: }, + [1666961162.782993][218195:218195] CHIP:DMG: + [1666961162.783004][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961162.783022][218195:218195] CHIP:DMG: { + [1666961162.783037][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961162.783050][218195:218195] CHIP:DMG: { + [1666961162.783065][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666961162.783077][218195:218195] CHIP:DMG: AttributePathIB = + [1666961162.783141][218195:218195] CHIP:DMG: { + [1666961162.783155][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666961162.783167][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961162.783180][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961162.783196][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961162.783208][218195:218195] CHIP:DMG: } + [1666961162.783238][218195:218195] CHIP:DMG: + [1666961162.783257][218195:218195] CHIP:DMG: Data = + [1666961162.783274][218195:218195] CHIP:DMG: { + [1666961162.783291][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961162.783308][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961162.783324][218195:218195] CHIP:DMG: }, + [1666961162.783338][218195:218195] CHIP:DMG: }, + [1666961162.783358][218195:218195] CHIP:DMG: + [1666961162.783372][218195:218195] CHIP:DMG: }, + [1666961162.783392][218195:218195] CHIP:DMG: + [1666961162.783407][218195:218195] CHIP:DMG: ], + [1666961162.783435][218195:218195] CHIP:DMG: + [1666961162.783447][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961162.783458][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961162.783468][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 5 - Verify the DeviceTypeList attribute response with endpoint 5 On TH(bridge-app) Log: - - [1666961235.484701][218195:218195] CHIP:IM: Received Read request - [1666961235.484743][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961235.484753][218195:218195] CHIP:DMG: { - [1666961235.484761][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961235.484771][218195:218195] CHIP:DMG: [ - [1666961235.484779][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.484789][218195:218195] CHIP:DMG: { - [1666961235.484799][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.484810][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.484821][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.484830][218195:218195] CHIP:DMG: } - [1666961235.484841][218195:218195] CHIP:DMG: - [1666961235.484850][218195:218195] CHIP:DMG: ], - [1666961235.484861][218195:218195] CHIP:DMG: - [1666961235.484871][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961235.484880][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961235.484888][218195:218195] CHIP:DMG: }, - [1666961235.484925][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961235.484960][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961235.484972][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961235.484980][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0000 (expanded=0) - [1666961235.484992][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v - [1666961235.485007][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961235.485037][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961235.485186][218195:218195] CHIP:EM: <<< [E:50203r M:208940516 (Ack:32767592)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961235.485206][218195:218195] CHIP:IN: (S) Sending msg 208940516 on secure session with LSID: 51702 - [1666961235.485386][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43440 | 208940516 | [Interaction Model (1) / Report Data (0x05) / Session = 6556 / Exchange = 50203] - [1666961235.485405][218195:218195] CHIP:DMG: Header Flags = - [1666961235.485413][218195:218195] CHIP:DMG: { - [1666961235.485431][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961235.485439][218195:218195] CHIP:DMG: { - [1666961235.485449][218195:218195] CHIP:DMG: AckMsg = 32767592 - [1666961235.485457][218195:218195] CHIP:DMG: NeedsAck = true - [1666961235.485465][218195:218195] CHIP:DMG: } - [1666961235.485478][218195:218195] CHIP:DMG: } - [1666961235.485486][218195:218195] CHIP:DMG: - [1666961235.485498][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961235.485506][218195:218195] CHIP:DMG: { - [1666961235.485514][218195:218195] CHIP:DMG: data = 009c1900e42d740c5e046660bfb2ae8cc6e84b9c4e5700d100371ff13de7dac8d901ed191ec2e3ff333574e183ca5b915f2e3241b193db787a57de9a6c389514ab3f309b97254a5298bd6845c465ebceb9190538155101797132a13763688b7c375deeb09647eb0bfdec374315c43a3272f4e2eb0bc79b661cd513823e973904316cbf54e63ac9385227a7 - [1666961235.490016][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 - [1666961235.490039][218195:218195] CHIP:DMG: } - [1666961235.490050][218195:218195] CHIP:DMG: - [1666961235.490079][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961235.490089][218195:218195] CHIP:DMG: { - [1666961235.490098][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d2404001836021818181535012600dc5a8687370124020524031d2404003405183502250002032401011818181535012600dc5a8687370124020524031d240400340518350224001324010118181818290424ff0118 - [1666961235.490109][218195:218195] CHIP:DMG: } - [1666961235.490118][218195:218195] CHIP:DMG: - [1666961235.490196][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961235.490209][218195:218195] CHIP:DMG: { - [1666961235.490218][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961235.490235][218195:218195] CHIP:DMG: [ - [1666961235.490246][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961235.490264][218195:218195] CHIP:DMG: { - [1666961235.490276][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961235.490290][218195:218195] CHIP:DMG: { - [1666961235.490304][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666961235.490317][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.490331][218195:218195] CHIP:DMG: { - [1666961235.490345][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.490360][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.490375][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.490387][218195:218195] CHIP:DMG: } - [1666961235.490402][218195:218195] CHIP:DMG: - [1666961235.490414][218195:218195] CHIP:DMG: Data = [ - [1666961235.490425][218195:218195] CHIP:DMG: - [1666961235.490438][218195:218195] CHIP:DMG: ], - [1666961235.490449][218195:218195] CHIP:DMG: }, - [1666961235.490463][218195:218195] CHIP:DMG: - [1666961235.490473][218195:218195] CHIP:DMG: }, - [1666961235.490491][218195:218195] CHIP:DMG: - [1666961235.490501][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961235.490517][218195:218195] CHIP:DMG: { - [1666961235.490527][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961235.490539][218195:218195] CHIP:DMG: { - [1666961235.490551][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666961235.490562][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.490575][218195:218195] CHIP:DMG: { - [1666961235.490587][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.490600][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.490613][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.490625][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961235.490635][218195:218195] CHIP:DMG: } - [1666961235.490652][218195:218195] CHIP:DMG: - [1666961235.490660][218195:218195] CHIP:DMG: Data = - [1666961235.490670][218195:218195] CHIP:DMG: { - [1666961235.490686][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961235.490698][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961235.490709][218195:218195] CHIP:DMG: }, - [1666961235.490723][218195:218195] CHIP:DMG: }, - [1666961235.490742][218195:218195] CHIP:DMG: - [1666961235.490753][218195:218195] CHIP:DMG: }, - [1666961235.490778][218195:218195] CHIP:DMG: - [1666961235.490787][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961235.490805][218195:218195] CHIP:DMG: { - [1666961235.490814][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961235.490825][218195:218195] CHIP:DMG: { - [1666961235.490837][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666961235.490847][218195:218195] CHIP:DMG: AttributePathIB = - [1666961235.490860][218195:218195] CHIP:DMG: { - [1666961235.490871][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666961235.490884][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961235.490897][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961235.490911][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961235.490923][218195:218195] CHIP:DMG: } - [1666961235.490937][218195:218195] CHIP:DMG: - [1666961235.490947][218195:218195] CHIP:DMG: Data = - [1666961235.490958][218195:218195] CHIP:DMG: { - [1666961235.490972][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961235.490986][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961235.490999][218195:218195] CHIP:DMG: }, - [1666961235.491010][218195:218195] CHIP:DMG: }, - [1666961235.491025][218195:218195] CHIP:DMG: - [1666961235.491035][218195:218195] CHIP:DMG: }, - [1666961235.491051][218195:218195] CHIP:DMG: - [1666961235.491060][218195:218195] CHIP:DMG: ], - [1666961235.491085][218195:218195] CHIP:DMG: - [1666961235.491115][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961235.491126][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961235.491135][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 5 On TH(bridge-app) Log: + + [1666961235.484701][218195:218195] CHIP:IM: Received Read request + [1666961235.484743][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961235.484753][218195:218195] CHIP:DMG: { + [1666961235.484761][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961235.484771][218195:218195] CHIP:DMG: [ + [1666961235.484779][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.484789][218195:218195] CHIP:DMG: { + [1666961235.484799][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.484810][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.484821][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.484830][218195:218195] CHIP:DMG: } + [1666961235.484841][218195:218195] CHIP:DMG: + [1666961235.484850][218195:218195] CHIP:DMG: ], + [1666961235.484861][218195:218195] CHIP:DMG: + [1666961235.484871][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961235.484880][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961235.484888][218195:218195] CHIP:DMG: }, + [1666961235.484925][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961235.484960][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961235.484972][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961235.484980][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0000 (expanded=0) + [1666961235.484992][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v + [1666961235.485007][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961235.485037][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961235.485186][218195:218195] CHIP:EM: <<< [E:50203r M:208940516 (Ack:32767592)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961235.485206][218195:218195] CHIP:IN: (S) Sending msg 208940516 on secure session with LSID: 51702 + [1666961235.485386][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43440 | 208940516 | [Interaction Model (1) / Report Data (0x05) / Session = 6556 / Exchange = 50203] + [1666961235.485405][218195:218195] CHIP:DMG: Header Flags = + [1666961235.485413][218195:218195] CHIP:DMG: { + [1666961235.485431][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961235.485439][218195:218195] CHIP:DMG: { + [1666961235.485449][218195:218195] CHIP:DMG: AckMsg = 32767592 + [1666961235.485457][218195:218195] CHIP:DMG: NeedsAck = true + [1666961235.485465][218195:218195] CHIP:DMG: } + [1666961235.485478][218195:218195] CHIP:DMG: } + [1666961235.485486][218195:218195] CHIP:DMG: + [1666961235.485498][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961235.485506][218195:218195] CHIP:DMG: { + [1666961235.485514][218195:218195] CHIP:DMG: data = 009c1900e42d740c5e046660bfb2ae8cc6e84b9c4e5700d100371ff13de7dac8d901ed191ec2e3ff333574e183ca5b915f2e3241b193db787a57de9a6c389514ab3f309b97254a5298bd6845c465ebceb9190538155101797132a13763688b7c375deeb09647eb0bfdec374315c43a3272f4e2eb0bc79b661cd513823e973904316cbf54e63ac9385227a7 + [1666961235.490016][218195:218195] CHIP:DMG: buffer_ptr = 94136416759296 + [1666961235.490039][218195:218195] CHIP:DMG: } + [1666961235.490050][218195:218195] CHIP:DMG: + [1666961235.490079][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961235.490089][218195:218195] CHIP:DMG: { + [1666961235.490098][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d2404001836021818181535012600dc5a8687370124020524031d2404003405183502250002032401011818181535012600dc5a8687370124020524031d240400340518350224001324010118181818290424ff0118 + [1666961235.490109][218195:218195] CHIP:DMG: } + [1666961235.490118][218195:218195] CHIP:DMG: + [1666961235.490196][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961235.490209][218195:218195] CHIP:DMG: { + [1666961235.490218][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961235.490235][218195:218195] CHIP:DMG: [ + [1666961235.490246][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961235.490264][218195:218195] CHIP:DMG: { + [1666961235.490276][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961235.490290][218195:218195] CHIP:DMG: { + [1666961235.490304][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666961235.490317][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.490331][218195:218195] CHIP:DMG: { + [1666961235.490345][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.490360][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.490375][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.490387][218195:218195] CHIP:DMG: } + [1666961235.490402][218195:218195] CHIP:DMG: + [1666961235.490414][218195:218195] CHIP:DMG: Data = [ + [1666961235.490425][218195:218195] CHIP:DMG: + [1666961235.490438][218195:218195] CHIP:DMG: ], + [1666961235.490449][218195:218195] CHIP:DMG: }, + [1666961235.490463][218195:218195] CHIP:DMG: + [1666961235.490473][218195:218195] CHIP:DMG: }, + [1666961235.490491][218195:218195] CHIP:DMG: + [1666961235.490501][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961235.490517][218195:218195] CHIP:DMG: { + [1666961235.490527][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961235.490539][218195:218195] CHIP:DMG: { + [1666961235.490551][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666961235.490562][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.490575][218195:218195] CHIP:DMG: { + [1666961235.490587][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.490600][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.490613][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.490625][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961235.490635][218195:218195] CHIP:DMG: } + [1666961235.490652][218195:218195] CHIP:DMG: + [1666961235.490660][218195:218195] CHIP:DMG: Data = + [1666961235.490670][218195:218195] CHIP:DMG: { + [1666961235.490686][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961235.490698][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961235.490709][218195:218195] CHIP:DMG: }, + [1666961235.490723][218195:218195] CHIP:DMG: }, + [1666961235.490742][218195:218195] CHIP:DMG: + [1666961235.490753][218195:218195] CHIP:DMG: }, + [1666961235.490778][218195:218195] CHIP:DMG: + [1666961235.490787][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961235.490805][218195:218195] CHIP:DMG: { + [1666961235.490814][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961235.490825][218195:218195] CHIP:DMG: { + [1666961235.490837][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666961235.490847][218195:218195] CHIP:DMG: AttributePathIB = + [1666961235.490860][218195:218195] CHIP:DMG: { + [1666961235.490871][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666961235.490884][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961235.490897][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961235.490911][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961235.490923][218195:218195] CHIP:DMG: } + [1666961235.490937][218195:218195] CHIP:DMG: + [1666961235.490947][218195:218195] CHIP:DMG: Data = + [1666961235.490958][218195:218195] CHIP:DMG: { + [1666961235.490972][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961235.490986][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961235.490999][218195:218195] CHIP:DMG: }, + [1666961235.491010][218195:218195] CHIP:DMG: }, + [1666961235.491025][218195:218195] CHIP:DMG: + [1666961235.491035][218195:218195] CHIP:DMG: }, + [1666961235.491051][218195:218195] CHIP:DMG: + [1666961235.491060][218195:218195] CHIP:DMG: ], + [1666961235.491085][218195:218195] CHIP:DMG: + [1666961235.491115][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961235.491126][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961235.491135][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 6 - Verify the DeviceTypeList attribute response with endpoint 6 On TH(bridge-app) Log: - - [1666961312.435864][218195:218195] CHIP:IM: Received Read request - [1666961312.435907][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961312.435918][218195:218195] CHIP:DMG: { - [1666961312.435927][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961312.435938][218195:218195] CHIP:DMG: [ - [1666961312.435947][218195:218195] CHIP:DMG: AttributePathIB = - [1666961312.435958][218195:218195] CHIP:DMG: { - [1666961312.435969][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666961312.435983][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961312.435998][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961312.436008][218195:218195] CHIP:DMG: } - [1666961312.436019][218195:218195] CHIP:DMG: - [1666961312.436029][218195:218195] CHIP:DMG: ], - [1666961312.436041][218195:218195] CHIP:DMG: - [1666961312.436052][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961312.436062][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961312.436071][218195:218195] CHIP:DMG: }, - [1666961312.436111][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961312.436152][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961312.436165][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961312.436174][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0000 (expanded=0) - [1666961312.436188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v - [1666961312.436204][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961312.436233][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... - [1666961312.436389][218195:218195] CHIP:EM: <<< [E:21104r M:199575968 (Ack:157464888)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961312.436411][218195:218195] CHIP:IN: (S) Sending msg 199575968 on secure session with LSID: 51703 - [1666961312.436607][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:60440 | 199575968 | [Interaction Model (1) / Report Data (0x05) / Session = 65356 / Exchange = 21104] - [1666961312.436628][218195:218195] CHIP:DMG: Header Flags = - [1666961312.436638][218195:218195] CHIP:DMG: { - [1666961312.436657][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961312.436666][218195:218195] CHIP:DMG: { - [1666961312.436677][218195:218195] CHIP:DMG: AckMsg = 157464888 - [1666961312.436687][218195:218195] CHIP:DMG: NeedsAck = true - [1666961312.436695][218195:218195] CHIP:DMG: } - [1666961312.436710][218195:218195] CHIP:DMG: } - [1666961312.436719][218195:218195] CHIP:DMG: - [1666961312.436731][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = - [1666961312.436740][218195:218195] CHIP:DMG: { - [1666961312.436749][218195:218195] CHIP:DMG: data = 004cff00a049e50b5628dde1918c40ddd26bcbb621153a2f2a5254bad23c4e0606fa54788058e5f767dbc67763050b23b5b037187c8de160cf358241dd94bf6beb79ac8e16c9c7b6d0e6e513dd72803539c67b4440eaf1a4fb52e29c19f6c3a1fd5c6459219d6efa - [1666961312.442311][218195:218195] CHIP:DMG: buffer_ptr = 94136416759440 - [1666961312.442329][218195:218195] CHIP:DMG: } - [1666961312.442339][218195:218195] CHIP:DMG: - [1666961312.442372][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = - [1666961312.442384][218195:218195] CHIP:DMG: { - [1666961312.442395][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040018360218181815350126004d2fac6c370124020624031d240400340518350224001324010118181818290424ff0118 - [1666961312.442405][218195:218195] CHIP:DMG: } - [1666961312.442415][218195:218195] CHIP:DMG: - [1666961312.442479][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961312.442491][218195:218195] CHIP:DMG: { - [1666961312.442501][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961312.442517][218195:218195] CHIP:DMG: [ - [1666961312.442528][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961312.442545][218195:218195] CHIP:DMG: { - [1666961312.442555][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961312.442568][218195:218195] CHIP:DMG: { - [1666961312.442581][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666961312.442605][218195:218195] CHIP:DMG: AttributePathIB = - [1666961312.442629][218195:218195] CHIP:DMG: { - [1666961312.442643][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666961312.442657][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961312.442673][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961312.442687][218195:218195] CHIP:DMG: } - [1666961312.442703][218195:218195] CHIP:DMG: - [1666961312.442717][218195:218195] CHIP:DMG: Data = [ - [1666961312.442731][218195:218195] CHIP:DMG: - [1666961312.442745][218195:218195] CHIP:DMG: ], - [1666961312.442757][218195:218195] CHIP:DMG: }, - [1666961312.442770][218195:218195] CHIP:DMG: - [1666961312.442782][218195:218195] CHIP:DMG: }, - [1666961312.442807][218195:218195] CHIP:DMG: - [1666961312.442819][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961312.442841][218195:218195] CHIP:DMG: { - [1666961312.442851][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961312.442861][218195:218195] CHIP:DMG: { - [1666961312.442870][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666961312.442886][218195:218195] CHIP:DMG: AttributePathIB = - [1666961312.442901][218195:218195] CHIP:DMG: { - [1666961312.442916][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666961312.442931][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961312.442962][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961312.442978][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961312.442998][218195:218195] CHIP:DMG: } - [1666961312.443016][218195:218195] CHIP:DMG: - [1666961312.443033][218195:218195] CHIP:DMG: Data = - [1666961312.443052][218195:218195] CHIP:DMG: { - [1666961312.443069][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961312.443084][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961312.443135][218195:218195] CHIP:DMG: }, - [1666961312.443149][218195:218195] CHIP:DMG: }, - [1666961312.443170][218195:218195] CHIP:DMG: - [1666961312.443183][218195:218195] CHIP:DMG: }, - [1666961312.443203][218195:218195] CHIP:DMG: - [1666961312.443215][218195:218195] CHIP:DMG: ], - [1666961312.443242][218195:218195] CHIP:DMG: - [1666961312.443256][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961312.443270][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961312.443282][218195:218195] CHIP:DMG: } - [1666961312.443295][218195:218195] CHIP:DMG: + Verify the DeviceTypeList attribute response with endpoint 6 On TH(bridge-app) Log: + + [1666961312.435864][218195:218195] CHIP:IM: Received Read request + [1666961312.435907][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961312.435918][218195:218195] CHIP:DMG: { + [1666961312.435927][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961312.435938][218195:218195] CHIP:DMG: [ + [1666961312.435947][218195:218195] CHIP:DMG: AttributePathIB = + [1666961312.435958][218195:218195] CHIP:DMG: { + [1666961312.435969][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666961312.435983][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961312.435998][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961312.436008][218195:218195] CHIP:DMG: } + [1666961312.436019][218195:218195] CHIP:DMG: + [1666961312.436029][218195:218195] CHIP:DMG: ], + [1666961312.436041][218195:218195] CHIP:DMG: + [1666961312.436052][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961312.436062][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961312.436071][218195:218195] CHIP:DMG: }, + [1666961312.436111][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961312.436152][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961312.436165][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961312.436174][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0000 (expanded=0) + [1666961312.436188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v + [1666961312.436204][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961312.436233][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... + [1666961312.436389][218195:218195] CHIP:EM: <<< [E:21104r M:199575968 (Ack:157464888)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961312.436411][218195:218195] CHIP:IN: (S) Sending msg 199575968 on secure session with LSID: 51703 + [1666961312.436607][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:60440 | 199575968 | [Interaction Model (1) / Report Data (0x05) / Session = 65356 / Exchange = 21104] + [1666961312.436628][218195:218195] CHIP:DMG: Header Flags = + [1666961312.436638][218195:218195] CHIP:DMG: { + [1666961312.436657][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961312.436666][218195:218195] CHIP:DMG: { + [1666961312.436677][218195:218195] CHIP:DMG: AckMsg = 157464888 + [1666961312.436687][218195:218195] CHIP:DMG: NeedsAck = true + [1666961312.436695][218195:218195] CHIP:DMG: } + [1666961312.436710][218195:218195] CHIP:DMG: } + [1666961312.436719][218195:218195] CHIP:DMG: + [1666961312.436731][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = + [1666961312.436740][218195:218195] CHIP:DMG: { + [1666961312.436749][218195:218195] CHIP:DMG: data = 004cff00a049e50b5628dde1918c40ddd26bcbb621153a2f2a5254bad23c4e0606fa54788058e5f767dbc67763050b23b5b037187c8de160cf358241dd94bf6beb79ac8e16c9c7b6d0e6e513dd72803539c67b4440eaf1a4fb52e29c19f6c3a1fd5c6459219d6efa + [1666961312.442311][218195:218195] CHIP:DMG: buffer_ptr = 94136416759440 + [1666961312.442329][218195:218195] CHIP:DMG: } + [1666961312.442339][218195:218195] CHIP:DMG: + [1666961312.442372][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = + [1666961312.442384][218195:218195] CHIP:DMG: { + [1666961312.442395][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040018360218181815350126004d2fac6c370124020624031d240400340518350224001324010118181818290424ff0118 + [1666961312.442405][218195:218195] CHIP:DMG: } + [1666961312.442415][218195:218195] CHIP:DMG: + [1666961312.442479][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961312.442491][218195:218195] CHIP:DMG: { + [1666961312.442501][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961312.442517][218195:218195] CHIP:DMG: [ + [1666961312.442528][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961312.442545][218195:218195] CHIP:DMG: { + [1666961312.442555][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961312.442568][218195:218195] CHIP:DMG: { + [1666961312.442581][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666961312.442605][218195:218195] CHIP:DMG: AttributePathIB = + [1666961312.442629][218195:218195] CHIP:DMG: { + [1666961312.442643][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666961312.442657][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961312.442673][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961312.442687][218195:218195] CHIP:DMG: } + [1666961312.442703][218195:218195] CHIP:DMG: + [1666961312.442717][218195:218195] CHIP:DMG: Data = [ + [1666961312.442731][218195:218195] CHIP:DMG: + [1666961312.442745][218195:218195] CHIP:DMG: ], + [1666961312.442757][218195:218195] CHIP:DMG: }, + [1666961312.442770][218195:218195] CHIP:DMG: + [1666961312.442782][218195:218195] CHIP:DMG: }, + [1666961312.442807][218195:218195] CHIP:DMG: + [1666961312.442819][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961312.442841][218195:218195] CHIP:DMG: { + [1666961312.442851][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961312.442861][218195:218195] CHIP:DMG: { + [1666961312.442870][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666961312.442886][218195:218195] CHIP:DMG: AttributePathIB = + [1666961312.442901][218195:218195] CHIP:DMG: { + [1666961312.442916][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666961312.442931][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961312.442962][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961312.442978][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961312.442998][218195:218195] CHIP:DMG: } + [1666961312.443016][218195:218195] CHIP:DMG: + [1666961312.443033][218195:218195] CHIP:DMG: Data = + [1666961312.443052][218195:218195] CHIP:DMG: { + [1666961312.443069][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961312.443084][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961312.443135][218195:218195] CHIP:DMG: }, + [1692177706.209314][8516:8518] CHIP:DMG: { + [1692177706.209348][8516:8518] CHIP:DMG: 0x0 = 17, + [1692177706.209386][8516:8518] CHIP:DMG: 0x1 = 1, + [1692177706.209421][8516:8518] CHIP:DMG: }, + [1666961312.443149][218195:218195] CHIP:DMG: }, + [1666961312.443170][218195:218195] CHIP:DMG: + [1666961312.443183][218195:218195] CHIP:DMG: }, + [1666961312.443203][218195:218195] CHIP:DMG: + [1666961312.443215][218195:218195] CHIP:DMG: ], + [1666961312.443242][218195:218195] CHIP:DMG: + [1666961312.443256][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961312.443270][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961312.443282][218195:218195] CHIP:DMG: } + [1666961312.443295][218195:218195] CHIP:DMG: ./chip-tool descriptor read device-type-list 1 7 - Verify the DeviceTypeList attribute response with endpoint 7 On TH(bridge-app) Log: - - [1666961364.286140][218195:218195] CHIP:IM: Received Read request - [1666961364.286177][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961364.286185][218195:218195] CHIP:DMG: { - [1666961364.286193][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961364.286202][218195:218195] CHIP:DMG: [ - [1666961364.286209][218195:218195] CHIP:DMG: AttributePathIB = - [1666961364.286218][218195:218195] CHIP:DMG: { - [1666961364.286228][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666961364.286237][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961364.286246][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961364.286254][218195:218195] CHIP:DMG: } - [1666961364.286263][218195:218195] CHIP:DMG: - [1666961364.286271][218195:218195] CHIP:DMG: ], - [1666961364.286282][218195:218195] CHIP:DMG: - [1666961364.286291][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961364.286299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961364.286306][218195:218195] CHIP:DMG: }, - [1666961364.286337][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961364.286367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961364.286377][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961364.286385][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0000 (expanded=0) - [1666961364.286397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v - [1666961364.286410][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961364.286435][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... - [1666961364.286561][218195:218195] CHIP:EM: <<< [E:20571r M:215006971 (Ack:132367975)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961364.286578][218195:218195] CHIP:IN: (S) Sending msg 215006971 on secure session with LSID: 51704 - [1666961364.286734][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36519 | 215006971 | [Interaction Model (1) / Report Data (0x05) / Session = 4615 / Exchange = 20571] - [1666961364.286752][218195:218195] CHIP:DMG: Header Flags = - [1666961364.286760][218195:218195] CHIP:DMG: { - [1666961364.286775][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961364.286783][218195:218195] CHIP:DMG: { - [1666961364.293096][218195:218195] CHIP:DMG: AckMsg = 132367975 - [1666961364.293130][218195:218195] CHIP:DMG: NeedsAck = true - [1666961364.293156][218195:218195] CHIP:DMG: } - [1666961364.293190][218195:218195] CHIP:DMG: } - [1666961364.293214][218195:218195] CHIP:DMG: - [1666961364.293248][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = - [1666961364.293273][218195:218195] CHIP:DMG: { - [1666961364.293295][218195:218195] CHIP:DMG: data = 00071200fbbed00c55f10001d54b0896b36ef389b19ccab71aa5a70e1dda15a56c40b699441d5f477e29eda0687b4eaa64dfc21bc687093dc166cad011e8dd6b934d92c7e631952e3204fe3ea8f0f6dee7560945c6a9b25b4d0246d490e22a8275ab95f7b0a6cc6f71 - [1666961364.293322][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 - [1666961364.293335][218195:218195] CHIP:DMG: } - [1666961364.293347][218195:218195] CHIP:DMG: - [1666961364.293368][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = - [1666961364.293380][218195:218195] CHIP:DMG: { - [1666961364.293392][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d2404001836021818181535012600740734f6370124020724031d24040034051835022500020324010118181818290424ff0118 - [1666961364.293404][218195:218195] CHIP:DMG: } - [1666961364.293416][218195:218195] CHIP:DMG: - [1666961364.293482][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961364.293496][218195:218195] CHIP:DMG: { - [1666961364.293506][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961364.293525][218195:218195] CHIP:DMG: [ - [1666961364.293538][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961364.293557][218195:218195] CHIP:DMG: { - [1666961364.293570][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961364.293584][218195:218195] CHIP:DMG: { - [1666961364.293599][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, - [1666961364.293614][218195:218195] CHIP:DMG: AttributePathIB = - [1666961364.293629][218195:218195] CHIP:DMG: { - [1666961364.293644][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666961364.293659][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961364.293675][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961364.293690][218195:218195] CHIP:DMG: } - [1666961364.293706][218195:218195] CHIP:DMG: - [1666961364.293720][218195:218195] CHIP:DMG: Data = [ - [1666961364.293735][218195:218195] CHIP:DMG: - [1666961364.293750][218195:218195] CHIP:DMG: ], - [1666961364.293764][218195:218195] CHIP:DMG: }, - [1666961364.293781][218195:218195] CHIP:DMG: - [1666961364.293794][218195:218195] CHIP:DMG: }, - [1666961364.293818][218195:218195] CHIP:DMG: - [1666961364.293830][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961364.293849][218195:218195] CHIP:DMG: { - [1666961364.293862][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961364.293876][218195:218195] CHIP:DMG: { - [1666961364.293890][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, - [1666961364.293904][218195:218195] CHIP:DMG: AttributePathIB = - [1666961364.293918][218195:218195] CHIP:DMG: { - [1666961364.293933][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666961364.293948][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961364.293963][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961364.293978][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961364.293992][218195:218195] CHIP:DMG: } - [1666961364.294008][218195:218195] CHIP:DMG: - [1666961364.294022][218195:218195] CHIP:DMG: Data = - [1666961364.294036][218195:218195] CHIP:DMG: { - [1666961364.294052][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961364.294068][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961364.294082][218195:218195] CHIP:DMG: }, - [1666961364.294095][218195:218195] CHIP:DMG: }, - [1666961364.294113][218195:218195] CHIP:DMG: - [1666961364.294125][218195:218195] CHIP:DMG: }, - [1666961364.294142][218195:218195] CHIP:DMG: - [1666961364.294154][218195:218195] CHIP:DMG: ], - [1666961364.294177][218195:218195] CHIP:DMG: - [1666961364.294191][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961364.294203][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961364.294214][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 7 On TH(bridge-app) Log: + + [1666961364.286140][218195:218195] CHIP:IM: Received Read request + [1666961364.286177][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961364.286185][218195:218195] CHIP:DMG: { + [1666961364.286193][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961364.286202][218195:218195] CHIP:DMG: [ + [1666961364.286209][218195:218195] CHIP:DMG: AttributePathIB = + [1666961364.286218][218195:218195] CHIP:DMG: { + [1666961364.286228][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666961364.286237][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961364.286246][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961364.286254][218195:218195] CHIP:DMG: } + [1666961364.286263][218195:218195] CHIP:DMG: + [1666961364.286271][218195:218195] CHIP:DMG: ], + [1666961364.286282][218195:218195] CHIP:DMG: + [1666961364.286291][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961364.286299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961364.286306][218195:218195] CHIP:DMG: }, + [1666961364.286337][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961364.286367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961364.286377][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961364.286385][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0000 (expanded=0) + [1666961364.286397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v + [1666961364.286410][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961364.286435][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... + [1666961364.286561][218195:218195] CHIP:EM: <<< [E:20571r M:215006971 (Ack:132367975)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961364.286578][218195:218195] CHIP:IN: (S) Sending msg 215006971 on secure session with LSID: 51704 + [1666961364.286734][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36519 | 215006971 | [Interaction Model (1) / Report Data (0x05) / Session = 4615 / Exchange = 20571] + [1666961364.286752][218195:218195] CHIP:DMG: Header Flags = + [1666961364.286760][218195:218195] CHIP:DMG: { + [1666961364.286775][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961364.286783][218195:218195] CHIP:DMG: { + [1666961364.293096][218195:218195] CHIP:DMG: AckMsg = 132367975 + [1666961364.293130][218195:218195] CHIP:DMG: NeedsAck = true + [1666961364.293156][218195:218195] CHIP:DMG: } + [1666961364.293190][218195:218195] CHIP:DMG: } + [1666961364.293214][218195:218195] CHIP:DMG: + [1666961364.293248][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = + [1666961364.293273][218195:218195] CHIP:DMG: { + [1666961364.293295][218195:218195] CHIP:DMG: data = 00071200fbbed00c55f10001d54b0896b36ef389b19ccab71aa5a70e1dda15a56c40b699441d5f477e29eda0687b4eaa64dfc21bc687093dc166cad011e8dd6b934d92c7e631952e3204fe3ea8f0f6dee7560945c6a9b25b4d0246d490e22a8275ab95f7b0a6cc6f71 + [1666961364.293322][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 + [1666961364.293335][218195:218195] CHIP:DMG: } + [1666961364.293347][218195:218195] CHIP:DMG: + [1666961364.293368][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = + [1666961364.293380][218195:218195] CHIP:DMG: { + [1666961364.293392][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d2404001836021818181535012600740734f6370124020724031d24040034051835022500020324010118181818290424ff0118 + [1666961364.293404][218195:218195] CHIP:DMG: } + [1666961364.293416][218195:218195] CHIP:DMG: + [1666961364.293482][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961364.293496][218195:218195] CHIP:DMG: { + [1666961364.293506][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961364.293525][218195:218195] CHIP:DMG: [ + [1666961364.293538][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961364.293557][218195:218195] CHIP:DMG: { + [1666961364.293570][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961364.293584][218195:218195] CHIP:DMG: { + [1666961364.293599][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, + [1666961364.293614][218195:218195] CHIP:DMG: AttributePathIB = + [1666961364.293629][218195:218195] CHIP:DMG: { + [1666961364.293644][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666961364.293659][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961364.293675][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961364.293690][218195:218195] CHIP:DMG: } + [1666961364.293706][218195:218195] CHIP:DMG: + [1666961364.293720][218195:218195] CHIP:DMG: Data = [ + [1666961364.293735][218195:218195] CHIP:DMG: + [1666961364.293750][218195:218195] CHIP:DMG: ], + [1666961364.293764][218195:218195] CHIP:DMG: }, + [1666961364.293781][218195:218195] CHIP:DMG: + [1666961364.293794][218195:218195] CHIP:DMG: }, + [1666961364.293818][218195:218195] CHIP:DMG: + [1666961364.293830][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961364.293849][218195:218195] CHIP:DMG: { + [1666961364.293862][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961364.293876][218195:218195] CHIP:DMG: { + [1666961364.293890][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, + [1666961364.293904][218195:218195] CHIP:DMG: AttributePathIB = + [1666961364.293918][218195:218195] CHIP:DMG: { + [1666961364.293933][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666961364.293948][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961364.293963][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961364.293978][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961364.293992][218195:218195] CHIP:DMG: } + [1666961364.294008][218195:218195] CHIP:DMG: + [1666961364.294022][218195:218195] CHIP:DMG: Data = + [1666961364.294036][218195:218195] CHIP:DMG: { + [1666961364.294052][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961364.294068][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961364.294082][218195:218195] CHIP:DMG: }, + [1666961364.294095][218195:218195] CHIP:DMG: }, + [1666961364.294113][218195:218195] CHIP:DMG: + [1666961364.294125][218195:218195] CHIP:DMG: }, + [1666961364.294142][218195:218195] CHIP:DMG: + [1666961364.294154][218195:218195] CHIP:DMG: ], + [1666961364.294177][218195:218195] CHIP:DMG: + [1666961364.294191][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961364.294203][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961364.294214][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 8 - Verify the DeviceTypeList attribute response with endpoint 8 On TH(bridge-app) Log: - - [1666961419.607662][218195:218195] CHIP:IM: Received Read request - [1666961419.607690][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961419.607697][218195:218195] CHIP:DMG: { - [1666961419.607704][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961419.607711][218195:218195] CHIP:DMG: [ - [1666961419.607718][218195:218195] CHIP:DMG: AttributePathIB = - [1666961419.607726][218195:218195] CHIP:DMG: { - [1666961419.607733][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666961419.607741][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961419.607749][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961419.607756][218195:218195] CHIP:DMG: } - [1666961419.607764][218195:218195] CHIP:DMG: - [1666961419.607769][218195:218195] CHIP:DMG: ], - [1666961419.607777][218195:218195] CHIP:DMG: - [1666961419.607783][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961419.607788][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961419.607793][218195:218195] CHIP:DMG: }, - [1666961419.607818][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961419.607838][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961419.607845][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961419.607850][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0000 (expanded=0) - [1666961419.607858][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v - [1666961419.607867][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961419.607885][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... - [1666961419.607987][218195:218195] CHIP:EM: <<< [E:25290r M:113624282 (Ack:54059552)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961419.607998][218195:218195] CHIP:IN: (S) Sending msg 113624282 on secure session with LSID: 51705 - [1666961419.608128][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44999 | 113624282 | [Interaction Model (1) / Report Data (0x05) / Session = 36612 / Exchange = 25290] - [1666961419.608143][218195:218195] CHIP:DMG: Header Flags = - [1666961419.608154][218195:218195] CHIP:DMG: { - [1666961419.608167][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961419.608173][218195:218195] CHIP:DMG: { - [1666961419.608181][218195:218195] CHIP:DMG: AckMsg = 54059552 - [1666961419.608211][218195:218195] CHIP:DMG: NeedsAck = true - [1666961419.608227][218195:218195] CHIP:DMG: } - [1666961419.608238][218195:218195] CHIP:DMG: } - [1666961419.608245][218195:218195] CHIP:DMG: - [1666961419.608254][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = - [1666961419.608260][218195:218195] CHIP:DMG: { - [1666961419.608266][218195:218195] CHIP:DMG: data = 00048f00dac4c5068a00f6067a2debbf6b33b35fdbe3fc56b2a163f97b132bec91a04597361fafe7438c0be37c604efda3d4d4ad7071909f234fd3bf48f3e16cb4b41105082a13b45cc9589482c39b8d5af6a9f35b19c07fc1d126c09e37c3cec6880657f43006a87c - [1666961419.608273][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 - [1666961419.608280][218195:218195] CHIP:DMG: } - [1666961419.608286][218195:218195] CHIP:DMG: - [1666961419.608298][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = - [1666961419.608304][218195:218195] CHIP:DMG: { - [1666961419.608309][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d2404001836021818181535012600de39a0f6370124020824031d24040034051835022500020324010118181818290424ff0118 - [1666961419.608314][218195:218195] CHIP:DMG: } - [1666961419.608319][218195:218195] CHIP:DMG: - [1666961419.608351][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961419.608357][218195:218195] CHIP:DMG: { - [1666961419.608362][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961419.608371][218195:218195] CHIP:DMG: [ - [1666961419.608376][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961419.608385][218195:218195] CHIP:DMG: { - [1666961419.608390][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961419.608397][218195:218195] CHIP:DMG: { - [1666961419.608403][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, - [1666961419.608409][218195:218195] CHIP:DMG: AttributePathIB = - [1666961419.608416][218195:218195] CHIP:DMG: { - [1666961419.608422][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666961419.608429][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961419.608436][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961419.608442][218195:218195] CHIP:DMG: } - [1666961419.608450][218195:218195] CHIP:DMG: - [1666961419.608456][218195:218195] CHIP:DMG: Data = [ - [1666961419.608463][218195:218195] CHIP:DMG: - [1666961419.608469][218195:218195] CHIP:DMG: ], - [1666961419.608475][218195:218195] CHIP:DMG: }, - [1666961419.608483][218195:218195] CHIP:DMG: - [1666961419.608489][218195:218195] CHIP:DMG: }, - [1666961419.608501][218195:218195] CHIP:DMG: - [1666961419.608506][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961419.608515][218195:218195] CHIP:DMG: { - [1666961419.608521][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961419.608527][218195:218195] CHIP:DMG: { - [1666961419.608533][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, - [1666961419.608540][218195:218195] CHIP:DMG: AttributePathIB = - [1666961419.608548][218195:218195] CHIP:DMG: { - [1666961419.608558][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666961419.608569][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961419.608583][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961419.608593][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961419.608601][218195:218195] CHIP:DMG: } - [1666961419.608612][218195:218195] CHIP:DMG: - [1666961419.608621][218195:218195] CHIP:DMG: Data = - [1666961419.608628][218195:218195] CHIP:DMG: { - [1666961419.608637][218195:218195] CHIP:DMG: 0x0 = 770, - [1666961419.608646][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961419.608657][218195:218195] CHIP:DMG: }, - [1666961419.608664][218195:218195] CHIP:DMG: }, - [1666961419.608675][218195:218195] CHIP:DMG: - [1666961419.608682][218195:218195] CHIP:DMG: }, - [1666961419.608692][218195:218195] CHIP:DMG: - [1666961419.608700][218195:218195] CHIP:DMG: ], - [1666961419.608712][218195:218195] CHIP:DMG: - [1666961419.608718][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961419.608724][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961419.608729][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 8 On TH(bridge-app) Log: + + [1666961419.607662][218195:218195] CHIP:IM: Received Read request + [1666961419.607690][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961419.607697][218195:218195] CHIP:DMG: { + [1666961419.607704][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961419.607711][218195:218195] CHIP:DMG: [ + [1666961419.607718][218195:218195] CHIP:DMG: AttributePathIB = + [1666961419.607726][218195:218195] CHIP:DMG: { + [1666961419.607733][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666961419.607741][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961419.607749][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961419.607756][218195:218195] CHIP:DMG: } + [1666961419.607764][218195:218195] CHIP:DMG: + [1666961419.607769][218195:218195] CHIP:DMG: ], + [1666961419.607777][218195:218195] CHIP:DMG: + [1666961419.607783][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961419.607788][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961419.607793][218195:218195] CHIP:DMG: }, + [1666961419.607818][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961419.607838][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961419.607845][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961419.607850][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0000 (expanded=0) + [1666961419.607858][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v + [1666961419.607867][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961419.607885][218195:218195] CHIP:DMG: Sending report (payload has 71 bytes)... + [1666961419.607987][218195:218195] CHIP:EM: <<< [E:25290r M:113624282 (Ack:54059552)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961419.607998][218195:218195] CHIP:IN: (S) Sending msg 113624282 on secure session with LSID: 51705 + [1666961419.608128][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:44999 | 113624282 | [Interaction Model (1) / Report Data (0x05) / Session = 36612 / Exchange = 25290] + [1666961419.608143][218195:218195] CHIP:DMG: Header Flags = + [1666961419.608154][218195:218195] CHIP:DMG: { + [1666961419.608167][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961419.608173][218195:218195] CHIP:DMG: { + [1666961419.608181][218195:218195] CHIP:DMG: AckMsg = 54059552 + [1666961419.608211][218195:218195] CHIP:DMG: NeedsAck = true + [1666961419.608227][218195:218195] CHIP:DMG: } + [1666961419.608238][218195:218195] CHIP:DMG: } + [1666961419.608245][218195:218195] CHIP:DMG: + [1666961419.608254][218195:218195] CHIP:DMG: Encrypted Payload (105 bytes) = + [1666961419.608260][218195:218195] CHIP:DMG: { + [1666961419.608266][218195:218195] CHIP:DMG: data = 00048f00dac4c5068a00f6067a2debbf6b33b35fdbe3fc56b2a163f97b132bec91a04597361fafe7438c0be37c604efda3d4d4ad7071909f234fd3bf48f3e16cb4b41105082a13b45cc9589482c39b8d5af6a9f35b19c07fc1d126c09e37c3cec6880657f43006a87c + [1666961419.608273][218195:218195] CHIP:DMG: buffer_ptr = 94136416760016 + [1666961419.608280][218195:218195] CHIP:DMG: } + [1666961419.608286][218195:218195] CHIP:DMG: + [1666961419.608298][218195:218195] CHIP:DMG: Decrypted Payload (71 bytes) = + [1666961419.608304][218195:218195] CHIP:DMG: { + [1666961419.608309][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d2404001836021818181535012600de39a0f6370124020824031d24040034051835022500020324010118181818290424ff0118 + [1666961419.608314][218195:218195] CHIP:DMG: } + [1666961419.608319][218195:218195] CHIP:DMG: + [1666961419.608351][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961419.608357][218195:218195] CHIP:DMG: { + [1666961419.608362][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961419.608371][218195:218195] CHIP:DMG: [ + [1666961419.608376][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961419.608385][218195:218195] CHIP:DMG: { + [1666961419.608390][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961419.608397][218195:218195] CHIP:DMG: { + [1666961419.608403][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, + [1666961419.608409][218195:218195] CHIP:DMG: AttributePathIB = + [1666961419.608416][218195:218195] CHIP:DMG: { + [1666961419.608422][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666961419.608429][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961419.608436][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961419.608442][218195:218195] CHIP:DMG: } + [1666961419.608450][218195:218195] CHIP:DMG: + [1666961419.608456][218195:218195] CHIP:DMG: Data = [ + [1666961419.608463][218195:218195] CHIP:DMG: + [1666961419.608469][218195:218195] CHIP:DMG: ], + [1666961419.608475][218195:218195] CHIP:DMG: }, + [1666961419.608483][218195:218195] CHIP:DMG: + [1666961419.608489][218195:218195] CHIP:DMG: }, + [1666961419.608501][218195:218195] CHIP:DMG: + [1666961419.608506][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961419.608515][218195:218195] CHIP:DMG: { + [1666961419.608521][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961419.608527][218195:218195] CHIP:DMG: { + [1666961419.608533][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, + [1666961419.608540][218195:218195] CHIP:DMG: AttributePathIB = + [1666961419.608548][218195:218195] CHIP:DMG: { + [1666961419.608558][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666961419.608569][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961419.608583][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961419.608593][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961419.608601][218195:218195] CHIP:DMG: } + [1666961419.608612][218195:218195] CHIP:DMG: + [1666961419.608621][218195:218195] CHIP:DMG: Data = + [1666961419.608628][218195:218195] CHIP:DMG: { + [1666961419.608637][218195:218195] CHIP:DMG: 0x0 = 770, + [1666961419.608646][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961419.608657][218195:218195] CHIP:DMG: }, + [1666961419.608664][218195:218195] CHIP:DMG: }, + [1666961419.608675][218195:218195] CHIP:DMG: + [1666961419.608682][218195:218195] CHIP:DMG: }, + [1666961419.608692][218195:218195] CHIP:DMG: + [1666961419.608700][218195:218195] CHIP:DMG: ], + [1666961419.608712][218195:218195] CHIP:DMG: + [1666961419.608718][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961419.608724][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961419.608729][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 9 - Verify the DeviceTypeList attribute response with endpoint 9 On TH(bridge-app) Log: - - [1666961467.313086][218195:218195] CHIP:IM: Received Read request - [1666961467.313117][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961467.313124][218195:218195] CHIP:DMG: { - [1666961467.313131][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961467.313138][218195:218195] CHIP:DMG: [ - [1666961467.313145][218195:218195] CHIP:DMG: AttributePathIB = - [1666961467.313153][218195:218195] CHIP:DMG: { - [1666961467.313161][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666961467.313168][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961467.313176][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961467.313183][218195:218195] CHIP:DMG: } - [1666961467.313192][218195:218195] CHIP:DMG: - [1666961467.313199][218195:218195] CHIP:DMG: ], - [1666961467.313207][218195:218195] CHIP:DMG: - [1666961467.313215][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961467.313222][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961467.313228][218195:218195] CHIP:DMG: }, - [1666961467.313258][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961467.313280][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961467.313289][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961467.313295][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0000 (expanded=0) - [1666961467.313305][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v - [1666961467.313316][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961467.313337][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... - [1666961467.313467][218195:218195] CHIP:EM: <<< [E:31333r M:223107854 (Ack:132183457)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961467.313485][218195:218195] CHIP:IN: (S) Sending msg 223107854 on secure session with LSID: 51706 - [1666961467.313642][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43652 | 223107854 | [Interaction Model (1) / Report Data (0x05) / Session = 60256 / Exchange = 31333] - [1666961467.313661][218195:218195] CHIP:DMG: Header Flags = - [1666961467.313670][218195:218195] CHIP:DMG: { - [1666961467.313687][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961467.313695][218195:218195] CHIP:DMG: { - [1666961467.313704][218195:218195] CHIP:DMG: AckMsg = 132183457 - [1666961467.313710][218195:218195] CHIP:DMG: NeedsAck = true - [1666961467.313717][218195:218195] CHIP:DMG: } - [1666961467.313728][218195:218195] CHIP:DMG: } - [1666961467.313734][218195:218195] CHIP:DMG: - [1666961467.313743][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = - [1666961467.313750][218195:218195] CHIP:DMG: { - [1666961467.313756][218195:218195] CHIP:DMG: data = 0060eb000e5b4c0dc8cb7b4f03ab26aee4997a4c2784dad6607d977c71c095a9c6853d638b8b83791844bbb57e108db126d3c9875c8c863e16b5e7f0ac048c90294cba1104094003d00420249907611764135dace53cd6727f61989741876aa1f661744c3e14d274 - [1666961467.313764][218195:218195] CHIP:DMG: buffer_ptr = 94136416760240 - [1666961467.313770][218195:218195] CHIP:DMG: } - [1666961467.313776][218195:218195] CHIP:DMG: - [1666961467.313788][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = - [1666961467.313794][218195:218195] CHIP:DMG: { - [1666961467.313800][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040018360218181815350126005ebab630370124020924031d240400340518350224001124010118181818290424ff0118 - [1666961467.313807][218195:218195] CHIP:DMG: } - [1666961467.313813][218195:218195] CHIP:DMG: - [1666961467.313852][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961467.313859][218195:218195] CHIP:DMG: { - [1666961467.313865][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961467.313876][218195:218195] CHIP:DMG: [ - [1666961467.313883][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961467.313894][218195:218195] CHIP:DMG: { - [1666961467.313901][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961467.313908][218195:218195] CHIP:DMG: { - [1666961467.313916][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, - [1666961467.313924][218195:218195] CHIP:DMG: AttributePathIB = - [1666961467.313932][218195:218195] CHIP:DMG: { - [1666961467.313940][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666961467.313948][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961467.313957][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961467.313964][218195:218195] CHIP:DMG: } - [1666961467.313974][218195:218195] CHIP:DMG: - [1666961467.313981][218195:218195] CHIP:DMG: Data = [ - [1666961467.313989][218195:218195] CHIP:DMG: - [1666961467.313998][218195:218195] CHIP:DMG: ], - [1666961467.314005][218195:218195] CHIP:DMG: }, - [1666961467.314015][218195:218195] CHIP:DMG: - [1666961467.314022][218195:218195] CHIP:DMG: }, - [1666961467.314036][218195:218195] CHIP:DMG: - [1666961467.314043][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961467.314054][218195:218195] CHIP:DMG: { - [1666961467.314061][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961467.314069][218195:218195] CHIP:DMG: { - [1666961467.314076][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, - [1666961467.314084][218195:218195] CHIP:DMG: AttributePathIB = - [1666961467.314092][218195:218195] CHIP:DMG: { - [1666961467.314100][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666961467.314108][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961467.314116][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961467.314124][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961467.314131][218195:218195] CHIP:DMG: } - [1666961467.314141][218195:218195] CHIP:DMG: - [1666961467.314148][218195:218195] CHIP:DMG: Data = - [1666961467.314156][218195:218195] CHIP:DMG: { - [1666961467.314165][218195:218195] CHIP:DMG: 0x0 = 17, - [1666961467.314174][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961467.314182][218195:218195] CHIP:DMG: }, - [1666961467.314189][218195:218195] CHIP:DMG: }, - [1666961467.314200][218195:218195] CHIP:DMG: - [1666961467.314206][218195:218195] CHIP:DMG: }, - [1666961467.314217][218195:218195] CHIP:DMG: - [1666961467.314224][218195:218195] CHIP:DMG: ], - [1666961467.314238][218195:218195] CHIP:DMG: - [1666961467.314245][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961467.314252][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961467.314259][218195:218195] CHIP:DMG: } - [1666961467.314265][218195:218195] CHIP:DMG: + Verify the DeviceTypeList attribute response with endpoint 9 On TH(bridge-app) Log: + + [1666961467.313086][218195:218195] CHIP:IM: Received Read request + [1666961467.313117][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961467.313124][218195:218195] CHIP:DMG: { + [1666961467.313131][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961467.313138][218195:218195] CHIP:DMG: [ + [1666961467.313145][218195:218195] CHIP:DMG: AttributePathIB = + [1666961467.313153][218195:218195] CHIP:DMG: { + [1666961467.313161][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666961467.313168][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961467.313176][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961467.313183][218195:218195] CHIP:DMG: } + [1666961467.313192][218195:218195] CHIP:DMG: + [1666961467.313199][218195:218195] CHIP:DMG: ], + [1666961467.313207][218195:218195] CHIP:DMG: + [1666961467.313215][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961467.313222][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961467.313228][218195:218195] CHIP:DMG: }, + [1666961467.313258][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961467.313280][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961467.313289][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961467.313295][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0000 (expanded=0) + [1666961467.313305][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v + [1666961467.313316][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961467.313337][218195:218195] CHIP:DMG: Sending report (payload has 70 bytes)... + [1666961467.313467][218195:218195] CHIP:EM: <<< [E:31333r M:223107854 (Ack:132183457)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961467.313485][218195:218195] CHIP:IN: (S) Sending msg 223107854 on secure session with LSID: 51706 + [1666961467.313642][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:43652 | 223107854 | [Interaction Model (1) / Report Data (0x05) / Session = 60256 / Exchange = 31333] + [1666961467.313661][218195:218195] CHIP:DMG: Header Flags = + [1666961467.313670][218195:218195] CHIP:DMG: { + [1666961467.313687][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961467.313695][218195:218195] CHIP:DMG: { + [1666961467.313704][218195:218195] CHIP:DMG: AckMsg = 132183457 + [1666961467.313710][218195:218195] CHIP:DMG: NeedsAck = true + [1666961467.313717][218195:218195] CHIP:DMG: } + [1666961467.313728][218195:218195] CHIP:DMG: } + [1666961467.313734][218195:218195] CHIP:DMG: + [1666961467.313743][218195:218195] CHIP:DMG: Encrypted Payload (104 bytes) = + [1666961467.313750][218195:218195] CHIP:DMG: { + [1666961467.313756][218195:218195] CHIP:DMG: data = 0060eb000e5b4c0dc8cb7b4f03ab26aee4997a4c2784dad6607d977c71c095a9c6853d638b8b83791844bbb57e108db126d3c9875c8c863e16b5e7f0ac048c90294cba1104094003d00420249907611764135dace53cd6727f61989741876aa1f661744c3e14d274 + [1666961467.313764][218195:218195] CHIP:DMG: buffer_ptr = 94136416760240 + [1666961467.313770][218195:218195] CHIP:DMG: } + [1666961467.313776][218195:218195] CHIP:DMG: + [1666961467.313788][218195:218195] CHIP:DMG: Decrypted Payload (70 bytes) = + [1666961467.313794][218195:218195] CHIP:DMG: { + [1666961467.313800][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040018360218181815350126005ebab630370124020924031d240400340518350224001124010118181818290424ff0118 + [1666961467.313807][218195:218195] CHIP:DMG: } + [1666961467.313813][218195:218195] CHIP:DMG: + [1666961467.313852][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961467.313859][218195:218195] CHIP:DMG: { + [1666961467.313865][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961467.313876][218195:218195] CHIP:DMG: [ + [1666961467.313883][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961467.313894][218195:218195] CHIP:DMG: { + [1666961467.313901][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961467.313908][218195:218195] CHIP:DMG: { + [1666961467.313916][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, + [1666961467.313924][218195:218195] CHIP:DMG: AttributePathIB = + [1666961467.313932][218195:218195] CHIP:DMG: { + [1666961467.313940][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666961467.313948][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961467.313957][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961467.313964][218195:218195] CHIP:DMG: } + [1666961467.313974][218195:218195] CHIP:DMG: + [1666961467.313981][218195:218195] CHIP:DMG: Data = [ + [1666961467.313989][218195:218195] CHIP:DMG: + [1666961467.313998][218195:218195] CHIP:DMG: ], + [1666961467.314005][218195:218195] CHIP:DMG: }, + [1666961467.314015][218195:218195] CHIP:DMG: + [1666961467.314022][218195:218195] CHIP:DMG: }, + [1666961467.314036][218195:218195] CHIP:DMG: + [1666961467.314043][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961467.314054][218195:218195] CHIP:DMG: { + [1666961467.314061][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961467.314069][218195:218195] CHIP:DMG: { + [1666961467.314076][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, + [1666961467.314084][218195:218195] CHIP:DMG: AttributePathIB = + [1666961467.314092][218195:218195] CHIP:DMG: { + [1666961467.314100][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666961467.314108][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961467.314116][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961467.314124][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961467.314131][218195:218195] CHIP:DMG: } + [1666961467.314141][218195:218195] CHIP:DMG: + [1666961467.314148][218195:218195] CHIP:DMG: Data = + [1692177790.671511][8520:8522] CHIP:DMG: { + [1692177790.671544][8520:8522] CHIP:DMG: 0x0 = 256, + [1692177790.671579][8520:8522] CHIP:DMG: 0x1 = 1, + [1692177790.671614][8520:8522] CHIP:DMG: }, + [1692177790.671646][8520:8522] CHIP:DMG: { + [1692177790.671678][8520:8522] CHIP:DMG: 0x0 = 19, + [1692177790.671713][8520:8522] CHIP:DMG: 0x1 = 1, + [1692177790.671748][8520:8522] CHIP:DMG: }, + [1666961467.314189][218195:218195] CHIP:DMG: }, + [1666961467.314200][218195:218195] CHIP:DMG: + [1666961467.314206][218195:218195] CHIP:DMG: }, + [1666961467.314217][218195:218195] CHIP:DMG: + [1666961467.314224][218195:218195] CHIP:DMG: ], + [1666961467.314238][218195:218195] CHIP:DMG: + [1666961467.314245][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961467.314252][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961467.314259][218195:218195] CHIP:DMG: } + [1666961467.314265][218195:218195] CHIP:DMG: ./chip-tool descriptor read device-type-list 1 10 - Verify the DeviceTypeList attribute response with endpoint 10 On TH(bridge-app) Log: - - [1666961546.940423][218195:218195] CHIP:IM: Received Read request - [1666961546.940503][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961546.940529][218195:218195] CHIP:DMG: { - [1666961546.940550][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961546.940575][218195:218195] CHIP:DMG: [ - [1666961546.940594][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.940617][218195:218195] CHIP:DMG: { - [1666961546.940641][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.940672][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.940700][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.940719][218195:218195] CHIP:DMG: } - [1666961546.940749][218195:218195] CHIP:DMG: - [1666961546.940771][218195:218195] CHIP:DMG: ], - [1666961546.940802][218195:218195] CHIP:DMG: - [1666961546.940823][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961546.940847][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961546.940870][218195:218195] CHIP:DMG: }, - [1666961546.940978][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961546.941112][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961546.941146][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961546.941163][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0000 (expanded=0) - [1666961546.941188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v - [1666961546.941216][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961546.941289][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961546.941647][218195:218195] CHIP:EM: <<< [E:63227r M:213194411 (Ack:173600094)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961546.941691][218195:218195] CHIP:IN: (S) Sending msg 213194411 on secure session with LSID: 51708 - [1666961546.942785][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:41272 | 213194411 | [Interaction Model (1) / Report Data (0x05) / Session = 36448 / Exchange = 63227] - [1666961546.942827][218195:218195] CHIP:DMG: Header Flags = - [1666961546.942847][218195:218195] CHIP:DMG: { - [1666961546.942885][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961546.942905][218195:218195] CHIP:DMG: { - [1666961546.942930][218195:218195] CHIP:DMG: AckMsg = 173600094 - [1666961546.942951][218195:218195] CHIP:DMG: NeedsAck = true - [1666961546.942971][218195:218195] CHIP:DMG: } - [1666961546.943006][218195:218195] CHIP:DMG: } - [1666961546.943025][218195:218195] CHIP:DMG: - [1666961546.943057][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961546.943076][218195:218195] CHIP:DMG: { - [1666961546.943128][218195:218195] CHIP:DMG: data = 00608e00ab16b50c9cee8eaa9a5a4ff449e0616dcf56b98b6256f025c41d8fd954f2531270f2d21f94df7c3cdd58b2076e8bc8942578ad5a3b49aca6ab527c7a6901dbf7a8639504d895243c625dbd5eab8cf3049dc4dab884ebcd04aedaf490a8cf7fa920e7c18051699de553857d7081b44eb74be37210b021bdf379dff1078fb33f80dc34c6714ae7f2 - [1666961546.943157][218195:218195] CHIP:DMG: buffer_ptr = 94136416760416 - [1666961546.943177][218195:218195] CHIP:DMG: } - [1666961546.943198][218195:218195] CHIP:DMG: - [1666961546.943237][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961546.943257][218195:218195] CHIP:DMG: { - [1666961546.943279][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d2404001836021818181535012600b298fda8370124020a24031d2404003405183502250000012401011818181535012600b298fda8370124020a24031d240400340518350224001324010118181818290424ff0118 - [1666961546.943302][218195:218195] CHIP:DMG: } - [1666961546.943320][218195:218195] CHIP:DMG: - [1666961546.943461][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961546.943483][218195:218195] CHIP:DMG: { - [1666961546.943501][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961546.943533][218195:218195] CHIP:DMG: [ - [1666961546.943549][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961546.943581][218195:218195] CHIP:DMG: { - [1666961546.943599][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961546.943621][218195:218195] CHIP:DMG: { - [1666961546.943644][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666961546.943669][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.943693][218195:218195] CHIP:DMG: { - [1666961546.943718][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.943748][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.943777][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.943803][218195:218195] CHIP:DMG: } - [1666961546.943830][218195:218195] CHIP:DMG: - [1666961546.943856][218195:218195] CHIP:DMG: Data = [ - [1666961546.943879][218195:218195] CHIP:DMG: - [1666961546.943911][218195:218195] CHIP:DMG: ], - [1666961546.943931][218195:218195] CHIP:DMG: }, - [1666961546.943960][218195:218195] CHIP:DMG: - [1666961546.943977][218195:218195] CHIP:DMG: }, - [1666961546.944016][218195:218195] CHIP:DMG: - [1666961546.944033][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961546.944066][218195:218195] CHIP:DMG: { - [1666961546.944083][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961546.944104][218195:218195] CHIP:DMG: { - [1666961546.944127][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666961546.944151][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.944178][218195:218195] CHIP:DMG: { - [1666961546.944200][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.944229][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.944257][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.944286][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961546.944307][218195:218195] CHIP:DMG: } - [1666961546.944335][218195:218195] CHIP:DMG: - [1666961546.944356][218195:218195] CHIP:DMG: Data = - [1666961546.944378][218195:218195] CHIP:DMG: { - [1666961546.944405][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961546.944431][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961546.944455][218195:218195] CHIP:DMG: }, - [1666961546.944476][218195:218195] CHIP:DMG: }, - [1666961546.944506][218195:218195] CHIP:DMG: - [1666961546.944523][218195:218195] CHIP:DMG: }, - [1666961546.944565][218195:218195] CHIP:DMG: - [1666961546.944582][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961546.944614][218195:218195] CHIP:DMG: { - [1666961546.944631][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961546.944652][218195:218195] CHIP:DMG: { - [1666961546.944678][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666961546.944697][218195:218195] CHIP:DMG: AttributePathIB = - [1666961546.944722][218195:218195] CHIP:DMG: { - [1666961546.944744][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666961546.944770][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961546.944798][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961546.944830][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961546.944856][218195:218195] CHIP:DMG: } - [1666961546.944886][218195:218195] CHIP:DMG: - [1666961546.944907][218195:218195] CHIP:DMG: Data = - [1666961546.944930][218195:218195] CHIP:DMG: { - [1666961546.944954][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961546.944981][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961546.945003][218195:218195] CHIP:DMG: }, - [1666961546.945023][218195:218195] CHIP:DMG: }, - [1666961546.945053][218195:218195] CHIP:DMG: - [1666961546.945073][218195:218195] CHIP:DMG: }, - [1666961546.945104][218195:218195] CHIP:DMG: - [1666961546.945120][218195:218195] CHIP:DMG: ], - [1666961546.945168][218195:218195] CHIP:DMG: - [1666961546.945187][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961546.945208][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961546.945226][218195:218195] CHIP:DMG: } - [1666961546.945246][218195:218195] CHIP:DMG: + Verify the DeviceTypeList attribute response with endpoint 10 On TH(bridge-app) Log: + + [1666961546.940423][218195:218195] CHIP:IM: Received Read request + [1666961546.940503][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961546.940529][218195:218195] CHIP:DMG: { + [1666961546.940550][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961546.940575][218195:218195] CHIP:DMG: [ + [1666961546.940594][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.940617][218195:218195] CHIP:DMG: { + [1666961546.940641][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.940672][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.940700][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.940719][218195:218195] CHIP:DMG: } + [1666961546.940749][218195:218195] CHIP:DMG: + [1666961546.940771][218195:218195] CHIP:DMG: ], + [1666961546.940802][218195:218195] CHIP:DMG: + [1666961546.940823][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961546.940847][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961546.940870][218195:218195] CHIP:DMG: }, + [1666961546.940978][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961546.941112][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961546.941146][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961546.941163][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0000 (expanded=0) + [1666961546.941188][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v + [1666961546.941216][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961546.941289][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961546.941647][218195:218195] CHIP:EM: <<< [E:63227r M:213194411 (Ack:173600094)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961546.941691][218195:218195] CHIP:IN: (S) Sending msg 213194411 on secure session with LSID: 51708 + [1666961546.942785][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:41272 | 213194411 | [Interaction Model (1) / Report Data (0x05) / Session = 36448 / Exchange = 63227] + [1666961546.942827][218195:218195] CHIP:DMG: Header Flags = + [1666961546.942847][218195:218195] CHIP:DMG: { + [1666961546.942885][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961546.942905][218195:218195] CHIP:DMG: { + [1666961546.942930][218195:218195] CHIP:DMG: AckMsg = 173600094 + [1666961546.942951][218195:218195] CHIP:DMG: NeedsAck = true + [1666961546.942971][218195:218195] CHIP:DMG: } + [1666961546.943006][218195:218195] CHIP:DMG: } + [1666961546.943025][218195:218195] CHIP:DMG: + [1666961546.943057][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961546.943076][218195:218195] CHIP:DMG: { + [1666961546.943128][218195:218195] CHIP:DMG: data = 00608e00ab16b50c9cee8eaa9a5a4ff449e0616dcf56b98b6256f025c41d8fd954f2531270f2d21f94df7c3cdd58b2076e8bc8942578ad5a3b49aca6ab527c7a6901dbf7a8639504d895243c625dbd5eab8cf3049dc4dab884ebcd04aedaf490a8cf7fa920e7c18051699de553857d7081b44eb74be37210b021bdf379dff1078fb33f80dc34c6714ae7f2 + [1666961546.943157][218195:218195] CHIP:DMG: buffer_ptr = 94136416760416 + [1666961546.943177][218195:218195] CHIP:DMG: } + [1666961546.943198][218195:218195] CHIP:DMG: + [1666961546.943237][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961546.943257][218195:218195] CHIP:DMG: { + [1666961546.943279][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d2404001836021818181535012600b298fda8370124020a24031d2404003405183502250000012401011818181535012600b298fda8370124020a24031d240400340518350224001324010118181818290424ff0118 + [1666961546.943302][218195:218195] CHIP:DMG: } + [1666961546.943320][218195:218195] CHIP:DMG: + [1666961546.943461][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961546.943483][218195:218195] CHIP:DMG: { + [1666961546.943501][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961546.943533][218195:218195] CHIP:DMG: [ + [1666961546.943549][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961546.943581][218195:218195] CHIP:DMG: { + [1666961546.943599][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961546.943621][218195:218195] CHIP:DMG: { + [1666961546.943644][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666961546.943669][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.943693][218195:218195] CHIP:DMG: { + [1666961546.943718][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.943748][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.943777][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.943803][218195:218195] CHIP:DMG: } + [1666961546.943830][218195:218195] CHIP:DMG: + [1666961546.943856][218195:218195] CHIP:DMG: Data = [ + [1666961546.943879][218195:218195] CHIP:DMG: + [1666961546.943911][218195:218195] CHIP:DMG: ], + [1666961546.943931][218195:218195] CHIP:DMG: }, + [1666961546.943960][218195:218195] CHIP:DMG: + [1666961546.943977][218195:218195] CHIP:DMG: }, + [1666961546.944016][218195:218195] CHIP:DMG: + [1666961546.944033][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961546.944066][218195:218195] CHIP:DMG: { + [1666961546.944083][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961546.944104][218195:218195] CHIP:DMG: { + [1666961546.944127][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666961546.944151][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.944178][218195:218195] CHIP:DMG: { + [1666961546.944200][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.944229][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.944257][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.944286][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961546.944307][218195:218195] CHIP:DMG: } + [1666961546.944335][218195:218195] CHIP:DMG: + [1666961546.944356][218195:218195] CHIP:DMG: Data = + [1666961546.944378][218195:218195] CHIP:DMG: { + [1666961546.944405][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961546.944431][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961546.944455][218195:218195] CHIP:DMG: }, + [1666961546.944476][218195:218195] CHIP:DMG: }, + [1666961546.944506][218195:218195] CHIP:DMG: + [1666961546.944523][218195:218195] CHIP:DMG: }, + [1666961546.944565][218195:218195] CHIP:DMG: + [1666961546.944582][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961546.944614][218195:218195] CHIP:DMG: { + [1666961546.944631][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961546.944652][218195:218195] CHIP:DMG: { + [1666961546.944678][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666961546.944697][218195:218195] CHIP:DMG: AttributePathIB = + [1666961546.944722][218195:218195] CHIP:DMG: { + [1666961546.944744][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666961546.944770][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961546.944798][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961546.944830][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961546.944856][218195:218195] CHIP:DMG: } + [1666961546.944886][218195:218195] CHIP:DMG: + [1666961546.944907][218195:218195] CHIP:DMG: Data = + [1666961546.944930][218195:218195] CHIP:DMG: { + [1666961546.944954][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961546.944981][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961546.945003][218195:218195] CHIP:DMG: }, + [1666961546.945023][218195:218195] CHIP:DMG: }, + [1666961546.945053][218195:218195] CHIP:DMG: + [1666961546.945073][218195:218195] CHIP:DMG: }, + [1666961546.945104][218195:218195] CHIP:DMG: + [1666961546.945120][218195:218195] CHIP:DMG: ], + [1666961546.945168][218195:218195] CHIP:DMG: + [1666961546.945187][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961546.945208][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961546.945226][218195:218195] CHIP:DMG: } + [1666961546.945246][218195:218195] CHIP:DMG: ./chip-tool descriptor read device-type-list 1 11 - Verify the DeviceTypeList attribute response with endpoint 11 On TH(bridge-app) Log: - - [1666961579.870142][218195:218195] CHIP:IM: Received Read request - [1666961579.870175][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961579.870183][218195:218195] CHIP:DMG: { - [1666961579.870191][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961579.870200][218195:218195] CHIP:DMG: [ - [1666961579.870208][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.870218][218195:218195] CHIP:DMG: { - [1666961579.870227][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.870236][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.870245][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.870253][218195:218195] CHIP:DMG: } - [1666961579.870264][218195:218195] CHIP:DMG: - [1666961579.870272][218195:218195] CHIP:DMG: ], - [1666961579.870283][218195:218195] CHIP:DMG: - [1666961579.870291][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961579.870299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961579.870307][218195:218195] CHIP:DMG: }, - [1666961579.870341][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961579.870367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961579.870376][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961579.870384][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0000 (expanded=0) - [1666961579.870397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v - [1666961579.870409][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961579.870434][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961579.870567][218195:218195] CHIP:EM: <<< [E:57809r M:173952829 (Ack:211280019)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961579.870584][218195:218195] CHIP:IN: (S) Sending msg 173952829 on secure session with LSID: 51709 - [1666961579.870751][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:49700 | 173952829 | [Interaction Model (1) / Report Data (0x05) / Session = 12754 / Exchange = 57809] - [1666961579.870769][218195:218195] CHIP:DMG: Header Flags = - [1666961579.870776][218195:218195] CHIP:DMG: { - [1666961579.870794][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961579.870800][218195:218195] CHIP:DMG: { - [1666961579.870810][218195:218195] CHIP:DMG: AckMsg = 211280019 - [1666961579.870818][218195:218195] CHIP:DMG: NeedsAck = true - [1666961579.870828][218195:218195] CHIP:DMG: } - [1666961579.870844][218195:218195] CHIP:DMG: } - [1666961579.870851][218195:218195] CHIP:DMG: - [1666961579.870862][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961579.870869][218195:218195] CHIP:DMG: { - [1666961579.870877][218195:218195] CHIP:DMG: data = 00d231003d4f5e0abdba620c4ead4243411697906f237c8b0d75654d1c3f2be08ff6a10a58363ac41cb8ebb15d7b2a424ba75a24044fd5b0395df2b49ff555bb9102fb82d920f3e70514aef7a6def7988e00cedff3c0ec50779eda009869e6f8cd63e5543bb834b6b211caccbbbce56038d7887de53664614f04f837f1f4e06da41a2ff37b01864ac4843c - [1666961579.870887][218195:218195] CHIP:DMG: buffer_ptr = 94136416760608 - [1666961579.870894][218195:218195] CHIP:DMG: } - [1666961579.870901][218195:218195] CHIP:DMG: - [1666961579.870915][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961579.870922][218195:218195] CHIP:DMG: { - [1666961579.870930][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d2404001836021818181535012600768e2de0370124020b24031d2404003405183502250000012401011818181535012600768e2de0370124020b24031d240400340518350224001324010118181818290424ff0118 - [1666961579.870939][218195:218195] CHIP:DMG: } - [1666961579.870946][218195:218195] CHIP:DMG: - [1666961579.870998][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961579.871007][218195:218195] CHIP:DMG: { - [1666961579.871014][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961579.871027][218195:218195] CHIP:DMG: [ - [1666961579.871034][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961579.871047][218195:218195] CHIP:DMG: { - [1666961579.871055][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961579.871065][218195:218195] CHIP:DMG: { - [1666961579.871075][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666961579.871108][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.871120][218195:218195] CHIP:DMG: { - [1666961579.871130][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.871142][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.871154][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.871164][218195:218195] CHIP:DMG: } - [1666961579.871176][218195:218195] CHIP:DMG: - [1666961579.871185][218195:218195] CHIP:DMG: Data = [ - [1666961579.871196][218195:218195] CHIP:DMG: - [1666961579.871208][218195:218195] CHIP:DMG: ], - [1666961579.871217][218195:218195] CHIP:DMG: }, - [1666961579.871230][218195:218195] CHIP:DMG: - [1666961579.871237][218195:218195] CHIP:DMG: }, - [1666961579.871255][218195:218195] CHIP:DMG: - [1666961579.871262][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961579.871276][218195:218195] CHIP:DMG: { - [1666961579.871283][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961579.871293][218195:218195] CHIP:DMG: { - [1666961579.871303][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666961579.871311][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.871321][218195:218195] CHIP:DMG: { - [1666961579.871331][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.871342][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.871354][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.871364][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961579.871375][218195:218195] CHIP:DMG: } - [1666961579.871387][218195:218195] CHIP:DMG: - [1666961579.871396][218195:218195] CHIP:DMG: Data = - [1666961579.871405][218195:218195] CHIP:DMG: { - [1666961579.871416][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961579.871427][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961579.871439][218195:218195] CHIP:DMG: }, - [1666961579.871448][218195:218195] CHIP:DMG: }, - [1666961579.871461][218195:218195] CHIP:DMG: - [1666961579.871468][218195:218195] CHIP:DMG: }, - [1666961579.871487][218195:218195] CHIP:DMG: - [1666961579.871494][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961579.871508][218195:218195] CHIP:DMG: { - [1666961579.871516][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961579.871525][218195:218195] CHIP:DMG: { - [1666961579.871535][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666961579.871543][218195:218195] CHIP:DMG: AttributePathIB = - [1666961579.871554][218195:218195] CHIP:DMG: { - [1666961579.871563][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666961579.871574][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961579.871586][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961579.871597][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961579.871608][218195:218195] CHIP:DMG: } - [1666961579.871620][218195:218195] CHIP:DMG: - [1666961579.871628][218195:218195] CHIP:DMG: Data = - [1666961579.871638][218195:218195] CHIP:DMG: { - [1666961579.871648][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961579.871659][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961579.871670][218195:218195] CHIP:DMG: }, - [1666961579.871679][218195:218195] CHIP:DMG: }, - [1666961579.871692][218195:218195] CHIP:DMG: - [1666961579.871700][218195:218195] CHIP:DMG: }, - [1666961579.871714][218195:218195] CHIP:DMG: - [1666961579.871721][218195:218195] CHIP:DMG: ], - [1666961579.871742][218195:218195] CHIP:DMG: - [1666961579.871750][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961579.871759][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961579.871767][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 11 On TH(bridge-app) Log: + + [1666961579.870142][218195:218195] CHIP:IM: Received Read request + [1666961579.870175][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961579.870183][218195:218195] CHIP:DMG: { + [1666961579.870191][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961579.870200][218195:218195] CHIP:DMG: [ + [1666961579.870208][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.870218][218195:218195] CHIP:DMG: { + [1666961579.870227][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.870236][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.870245][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.870253][218195:218195] CHIP:DMG: } + [1666961579.870264][218195:218195] CHIP:DMG: + [1666961579.870272][218195:218195] CHIP:DMG: ], + [1666961579.870283][218195:218195] CHIP:DMG: + [1666961579.870291][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961579.870299][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961579.870307][218195:218195] CHIP:DMG: }, + [1666961579.870341][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961579.870367][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961579.870376][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961579.870384][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0000 (expanded=0) + [1666961579.870397][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v + [1666961579.870409][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961579.870434][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961579.870567][218195:218195] CHIP:EM: <<< [E:57809r M:173952829 (Ack:211280019)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961579.870584][218195:218195] CHIP:IN: (S) Sending msg 173952829 on secure session with LSID: 51709 + [1666961579.870751][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:49700 | 173952829 | [Interaction Model (1) / Report Data (0x05) / Session = 12754 / Exchange = 57809] + [1666961579.870769][218195:218195] CHIP:DMG: Header Flags = + [1666961579.870776][218195:218195] CHIP:DMG: { + [1666961579.870794][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961579.870800][218195:218195] CHIP:DMG: { + [1666961579.870810][218195:218195] CHIP:DMG: AckMsg = 211280019 + [1666961579.870818][218195:218195] CHIP:DMG: NeedsAck = true + [1666961579.870828][218195:218195] CHIP:DMG: } + [1666961579.870844][218195:218195] CHIP:DMG: } + [1666961579.870851][218195:218195] CHIP:DMG: + [1666961579.870862][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961579.870869][218195:218195] CHIP:DMG: { + [1666961579.870877][218195:218195] CHIP:DMG: data = 00d231003d4f5e0abdba620c4ead4243411697906f237c8b0d75654d1c3f2be08ff6a10a58363ac41cb8ebb15d7b2a424ba75a24044fd5b0395df2b49ff555bb9102fb82d920f3e70514aef7a6def7988e00cedff3c0ec50779eda009869e6f8cd63e5543bb834b6b211caccbbbce56038d7887de53664614f04f837f1f4e06da41a2ff37b01864ac4843c + [1666961579.870887][218195:218195] CHIP:DMG: buffer_ptr = 94136416760608 + [1666961579.870894][218195:218195] CHIP:DMG: } + [1666961579.870901][218195:218195] CHIP:DMG: + [1666961579.870915][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961579.870922][218195:218195] CHIP:DMG: { + [1666961579.870930][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d2404001836021818181535012600768e2de0370124020b24031d2404003405183502250000012401011818181535012600768e2de0370124020b24031d240400340518350224001324010118181818290424ff0118 + [1666961579.870939][218195:218195] CHIP:DMG: } + [1666961579.870946][218195:218195] CHIP:DMG: + [1666961579.870998][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961579.871007][218195:218195] CHIP:DMG: { + [1666961579.871014][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961579.871027][218195:218195] CHIP:DMG: [ + [1666961579.871034][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961579.871047][218195:218195] CHIP:DMG: { + [1666961579.871055][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961579.871065][218195:218195] CHIP:DMG: { + [1666961579.871075][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666961579.871108][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.871120][218195:218195] CHIP:DMG: { + [1666961579.871130][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.871142][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.871154][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.871164][218195:218195] CHIP:DMG: } + [1666961579.871176][218195:218195] CHIP:DMG: + [1666961579.871185][218195:218195] CHIP:DMG: Data = [ + [1666961579.871196][218195:218195] CHIP:DMG: + [1666961579.871208][218195:218195] CHIP:DMG: ], + [1666961579.871217][218195:218195] CHIP:DMG: }, + [1666961579.871230][218195:218195] CHIP:DMG: + [1666961579.871237][218195:218195] CHIP:DMG: }, + [1666961579.871255][218195:218195] CHIP:DMG: + [1666961579.871262][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961579.871276][218195:218195] CHIP:DMG: { + [1666961579.871283][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961579.871293][218195:218195] CHIP:DMG: { + [1666961579.871303][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666961579.871311][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.871321][218195:218195] CHIP:DMG: { + [1666961579.871331][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.871342][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.871354][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.871364][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961579.871375][218195:218195] CHIP:DMG: } + [1666961579.871387][218195:218195] CHIP:DMG: + [1666961579.871396][218195:218195] CHIP:DMG: Data = + [1666961579.871405][218195:218195] CHIP:DMG: { + [1666961579.871416][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961579.871427][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961579.871439][218195:218195] CHIP:DMG: }, + [1666961579.871448][218195:218195] CHIP:DMG: }, + [1666961579.871461][218195:218195] CHIP:DMG: + [1666961579.871468][218195:218195] CHIP:DMG: }, + [1666961579.871487][218195:218195] CHIP:DMG: + [1666961579.871494][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961579.871508][218195:218195] CHIP:DMG: { + [1666961579.871516][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961579.871525][218195:218195] CHIP:DMG: { + [1666961579.871535][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666961579.871543][218195:218195] CHIP:DMG: AttributePathIB = + [1666961579.871554][218195:218195] CHIP:DMG: { + [1666961579.871563][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666961579.871574][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961579.871586][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961579.871597][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961579.871608][218195:218195] CHIP:DMG: } + [1666961579.871620][218195:218195] CHIP:DMG: + [1666961579.871628][218195:218195] CHIP:DMG: Data = + [1666961579.871638][218195:218195] CHIP:DMG: { + [1666961579.871648][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961579.871659][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961579.871670][218195:218195] CHIP:DMG: }, + [1666961579.871679][218195:218195] CHIP:DMG: }, + [1666961579.871692][218195:218195] CHIP:DMG: + [1666961579.871700][218195:218195] CHIP:DMG: }, + [1666961579.871714][218195:218195] CHIP:DMG: + [1666961579.871721][218195:218195] CHIP:DMG: ], + [1666961579.871742][218195:218195] CHIP:DMG: + [1666961579.871750][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961579.871759][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961579.871767][218195:218195] CHIP:DMG: } ./chip-tool descriptor read device-type-list 1 12 - Verify the DeviceTypeList attribute response with endpoint 12 On TH(bridge-app) Log: - - [1666961637.024382][218195:218195] CHIP:EM: Handling via exchange: 24264r, Delegate: 0x559dd6ddf8c8 - [1666961637.024406][218195:218195] CHIP:IM: Received Read request - [1666961637.024459][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961637.024477][218195:218195] CHIP:DMG: { - [1666961637.024487][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961637.024501][218195:218195] CHIP:DMG: [ - [1666961637.024514][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.024528][218195:218195] CHIP:DMG: { - [1666961637.024542][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.024555][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.024569][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.024588][218195:218195] CHIP:DMG: } - [1666961637.024599][218195:218195] CHIP:DMG: - [1666961637.024608][218195:218195] CHIP:DMG: ], - [1666961637.024624][218195:218195] CHIP:DMG: - [1666961637.024641][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961637.024651][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961637.024665][218195:218195] CHIP:DMG: }, - [1666961637.024707][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961637.024758][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961637.024774][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961637.024785][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0000 (expanded=0) - [1666961637.024802][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v - [1666961637.024821][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961637.024865][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961637.025090][218195:218195] CHIP:EM: <<< [E:24264r M:129383321 (Ack:149091728)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961637.025123][218195:218195] CHIP:IN: (S) Sending msg 129383321 on secure session with LSID: 51710 - [1666961637.025575][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33508 | 129383321 | [Interaction Model (1) / Report Data (0x05) / Session = 47615 / Exchange = 24264] - [1666961637.025615][218195:218195] CHIP:DMG: Header Flags = - [1666961637.025630][218195:218195] CHIP:DMG: { - [1666961637.025654][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961637.025666][218195:218195] CHIP:DMG: { - [1666961637.025680][218195:218195] CHIP:DMG: AckMsg = 149091728 - [1666961637.025692][218195:218195] CHIP:DMG: NeedsAck = true - [1666961637.025703][218195:218195] CHIP:DMG: } - [1666961637.025722][218195:218195] CHIP:DMG: } - [1666961637.025733][218195:218195] CHIP:DMG: - [1666961637.025754][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961637.025766][218195:218195] CHIP:DMG: { - [1666961637.025779][218195:218195] CHIP:DMG: data = 00ffb900993bb607eb7a6237df23556ef55553d6bdb002eca4dec5b0286b803f131401a010db1aacec9934e01a4728a9e89e4d2474216e665d12fb28265cdb5e9f09d88aa8a7806960884a21b7f21a52c57cac7dd797cdb01ff66e27a1c177ddea3bf84a046a5d4245c3afec579722a901f988a639716e0d4b295494ec005278cca871ae42cb62e25adecf - [1666961637.025796][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 - [1666961637.025807][218195:218195] CHIP:DMG: } - [1666961637.025822][218195:218195] CHIP:DMG: - [1666961637.025845][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961637.025858][218195:218195] CHIP:DMG: { - [1666961637.025871][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d240400183602181818153501260083c07f68370124020c24031d240400340518350225000001240101181818153501260083c07f68370124020c24031d240400340518350224001324010118181818290424ff0118 - [1666961637.025885][218195:218195] CHIP:DMG: } - [1666961637.025899][218195:218195] CHIP:DMG: - [1666961637.025985][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961637.026005][218195:218195] CHIP:DMG: { - [1666961637.026020][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961637.026041][218195:218195] CHIP:DMG: [ - [1666961637.026055][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961637.026076][218195:218195] CHIP:DMG: { - [1666961637.026089][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961637.026106][218195:218195] CHIP:DMG: { - [1666961637.026122][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666961637.026138][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.026155][218195:218195] CHIP:DMG: { - [1666961637.026171][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.026187][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.026205][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.026219][218195:218195] CHIP:DMG: } - [1666961637.026238][218195:218195] CHIP:DMG: - [1666961637.026254][218195:218195] CHIP:DMG: Data = [ - [1666961637.026270][218195:218195] CHIP:DMG: - [1666961637.026288][218195:218195] CHIP:DMG: ], - [1666961637.026303][218195:218195] CHIP:DMG: }, - [1666961637.026323][218195:218195] CHIP:DMG: - [1666961637.026338][218195:218195] CHIP:DMG: }, - [1666961637.026366][218195:218195] CHIP:DMG: - [1666961637.026382][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961637.026405][218195:218195] CHIP:DMG: { - [1666961637.026419][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961637.026435][218195:218195] CHIP:DMG: { - [1666961637.026452][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666961637.026467][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.026483][218195:218195] CHIP:DMG: { - [1666961637.026500][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.026518][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.026536][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.026553][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961637.026568][218195:218195] CHIP:DMG: } - [1666961637.026588][218195:218195] CHIP:DMG: - [1666961637.026605][218195:218195] CHIP:DMG: Data = - [1666961637.026622][218195:218195] CHIP:DMG: { - [1666961637.026640][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961637.026658][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961637.026675][218195:218195] CHIP:DMG: }, - [1666961637.026690][218195:218195] CHIP:DMG: }, - [1666961637.026711][218195:218195] CHIP:DMG: - [1666961637.026726][218195:218195] CHIP:DMG: }, - [1666961637.026754][218195:218195] CHIP:DMG: - [1666961637.026766][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961637.026784][218195:218195] CHIP:DMG: { - [1666961637.026797][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961637.026812][218195:218195] CHIP:DMG: { - [1666961637.026824][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666961637.026835][218195:218195] CHIP:DMG: AttributePathIB = - [1666961637.026847][218195:218195] CHIP:DMG: { - [1666961637.026859][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666961637.026873][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961637.026951][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961637.027020][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961637.027109][218195:218195] CHIP:DMG: } - [1666961637.027177][218195:218195] CHIP:DMG: - [1666961637.027238][218195:218195] CHIP:DMG: Data = - [1666961637.027299][218195:218195] CHIP:DMG: { - [1666961637.027360][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961637.027423][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961637.027435][218195:218195] CHIP:DMG: }, - [1666961637.027444][218195:218195] CHIP:DMG: }, - [1666961637.027459][218195:218195] CHIP:DMG: - [1666961637.027469][218195:218195] CHIP:DMG: }, - [1666961637.027483][218195:218195] CHIP:DMG: - [1666961637.027492][218195:218195] CHIP:DMG: ], - [1666961637.027515][218195:218195] CHIP:DMG: - [1666961637.027526][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961637.027535][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961637.027543][218195:218195] CHIP:DMG: } - - ./chip-tool descriptor read device-type-list 1 13 - - Verify the DeviceTypeList attribute response with endpoint 13 On TH(bridge-app) Log: - - [1666961681.323410][218195:218195] CHIP:IM: Received Read request - [1666961681.323440][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666961681.323447][218195:218195] CHIP:DMG: { - [1666961681.323453][218195:218195] CHIP:DMG: AttributePathIBs = - [1666961681.323460][218195:218195] CHIP:DMG: [ - [1666961681.323466][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.323474][218195:218195] CHIP:DMG: { - [1666961681.323482][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.323489][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.323496][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.323503][218195:218195] CHIP:DMG: } - [1666961681.323511][218195:218195] CHIP:DMG: - [1666961681.323518][218195:218195] CHIP:DMG: ], - [1666961681.323526][218195:218195] CHIP:DMG: - [1666961681.323533][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666961681.323540][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961681.323546][218195:218195] CHIP:DMG: }, - [1666961681.323576][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666961681.323599][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666961681.323607][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty - [1666961681.323613][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=d AttributeId=0x0000_0000 (expanded=0) - [1666961681.323623][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=13 p=v - [1666961681.323633][218195:218195] CHIP:DMG: AccessControl: allowed - [1666961681.323657][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... - [1666961681.323781][218195:218195] CHIP:EM: <<< [E:64820r M:54597067 (Ack:45924515)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666961681.323794][218195:218195] CHIP:IN: (S) Sending msg 54597067 on secure session with LSID: 51711 - [1666961681.323950][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:40757 | 54597067 | [Interaction Model (1) / Report Data (0x05) / Session = 25741 / Exchange = 64820] - [1666961681.323965][218195:218195] CHIP:DMG: Header Flags = - [1666961681.323971][218195:218195] CHIP:DMG: { - [1666961681.323985][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666961681.323991][218195:218195] CHIP:DMG: { - [1666961681.323998][218195:218195] CHIP:DMG: AckMsg = 45924515 - [1666961681.324005][218195:218195] CHIP:DMG: NeedsAck = true - [1666961681.324011][218195:218195] CHIP:DMG: } - [1666961681.324021][218195:218195] CHIP:DMG: } - [1666961681.324027][218195:218195] CHIP:DMG: - [1666961681.324036][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = - [1666961681.324042][218195:218195] CHIP:DMG: { - [1666961681.324048][218195:218195] CHIP:DMG: data = 008d6400cb154103eb5e2942845edd83b2def815b819a0ad2f2b6f9408c957fe6d6c9b1789eb95a45262bd1acb37dea24b7ec796642f45e24d40e669ec4c98b73dc4d33397be07a15a88117b54c53c87edddec3ad826753cb3232c41b3b9d456a47a33072a87fbda229a89c2d8b2dfb44bda3fb906e24bb2b701e1976e3a2ee601fa0a97ebba57eb4b789a - [1666961681.324056][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 - [1666961681.324062][218195:218195] CHIP:DMG: } - [1666961681.324068][218195:218195] CHIP:DMG: - [1666961681.324079][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = - [1666961681.324085][218195:218195] CHIP:DMG: { - [1666961681.324091][218195:218195] CHIP:DMG: data = 15360115350126008fecadea370124020d24031d24040018360218181815350126008fecadea370124020d24031d24040034051835022500000124010118181815350126008fecadea370124020d24031d240400340518350224001324010118181818290424ff0118 - [1666961681.324098][218195:218195] CHIP:DMG: } - [1666961681.324104][218195:218195] CHIP:DMG: - [1666961681.324151][218195:218195] CHIP:DMG: ReportDataMessage = - [1666961681.324158][218195:218195] CHIP:DMG: { - [1666961681.324164][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666961681.324175][218195:218195] CHIP:DMG: [ - [1666961681.324181][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961681.324191][218195:218195] CHIP:DMG: { - [1666961681.324198][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961681.324206][218195:218195] CHIP:DMG: { - [1666961681.324213][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666961681.324221][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.324228][218195:218195] CHIP:DMG: { - [1666961681.324236][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.324244][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.324252][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.324260][218195:218195] CHIP:DMG: } - [1666961681.324268][218195:218195] CHIP:DMG: - [1666961681.324276][218195:218195] CHIP:DMG: Data = [ - [1666961681.324284][218195:218195] CHIP:DMG: - [1666961681.324292][218195:218195] CHIP:DMG: ], - [1666961681.324298][218195:218195] CHIP:DMG: }, - [1666961681.324308][218195:218195] CHIP:DMG: - [1666961681.324314][218195:218195] CHIP:DMG: }, - [1666961681.324328][218195:218195] CHIP:DMG: - [1666961681.324335][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961681.324346][218195:218195] CHIP:DMG: { - [1666961681.324352][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961681.324360][218195:218195] CHIP:DMG: { - [1666961681.324367][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666961681.324374][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.324382][218195:218195] CHIP:DMG: { - [1666961681.324390][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.324397][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.324406][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.324413][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961681.324420][218195:218195] CHIP:DMG: } - [1666961681.324429][218195:218195] CHIP:DMG: - [1666961681.324437][218195:218195] CHIP:DMG: Data = - [1666961681.324444][218195:218195] CHIP:DMG: { - [1666961681.324452][218195:218195] CHIP:DMG: 0x0 = 256, - [1666961681.324461][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961681.324468][218195:218195] CHIP:DMG: }, - [1666961681.324475][218195:218195] CHIP:DMG: }, - [1666961681.324485][218195:218195] CHIP:DMG: - [1666961681.324492][218195:218195] CHIP:DMG: }, - [1666961681.324507][218195:218195] CHIP:DMG: - [1666961681.324513][218195:218195] CHIP:DMG: AttributeReportIB = - [1666961681.324524][218195:218195] CHIP:DMG: { - [1666961681.324531][218195:218195] CHIP:DMG: AttributeDataIB = - [1666961681.324538][218195:218195] CHIP:DMG: { - [1666961681.324545][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666961681.324552][218195:218195] CHIP:DMG: AttributePathIB = - [1666961681.324560][218195:218195] CHIP:DMG: { - [1666961681.324568][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666961681.324575][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666961681.324584][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666961681.324591][218195:218195] CHIP:DMG: ListIndex = Null, - [1666961681.324598][218195:218195] CHIP:DMG: } - [1666961681.324607][218195:218195] CHIP:DMG: - [1666961681.324614][218195:218195] CHIP:DMG: Data = - [1666961681.324622][218195:218195] CHIP:DMG: { - [1666961681.324630][218195:218195] CHIP:DMG: 0x0 = 19, - [1666961681.324638][218195:218195] CHIP:DMG: 0x1 = 1, - [1666961681.324646][218195:218195] CHIP:DMG: }, - [1666961681.324653][218195:218195] CHIP:DMG: }, - [1666961681.324663][218195:218195] CHIP:DMG: - [1666961681.324669][218195:218195] CHIP:DMG: }, - [1666961681.324680][218195:218195] CHIP:DMG: - [1666961681.324686][218195:218195] CHIP:DMG: ], - [1666961681.324704][218195:218195] CHIP:DMG: - [1666961681.324711][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666961681.324718][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666961681.324724][218195:218195] CHIP:DMG: } + Verify the DeviceTypeList attribute response with endpoint 12 On TH(bridge-app) Log: + + [1666961637.024382][218195:218195] CHIP:EM: Handling via exchange: 24264r, Delegate: 0x559dd6ddf8c8 + [1666961637.024406][218195:218195] CHIP:IM: Received Read request + [1666961637.024459][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666961637.024477][218195:218195] CHIP:DMG: { + [1666961637.024487][218195:218195] CHIP:DMG: AttributePathIBs = + [1666961637.024501][218195:218195] CHIP:DMG: [ + [1666961637.024514][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.024528][218195:218195] CHIP:DMG: { + [1666961637.024542][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.024555][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.024569][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.024588][218195:218195] CHIP:DMG: } + [1666961637.024599][218195:218195] CHIP:DMG: + [1666961637.024608][218195:218195] CHIP:DMG: ], + [1666961637.024624][218195:218195] CHIP:DMG: + [1666961637.024641][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666961637.024651][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961637.024665][218195:218195] CHIP:DMG: }, + [1666961637.024707][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666961637.024758][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666961637.024774][218195:218195] CHIP:DMG: Cluster 1d, Attribute 0 is dirty + [1666961637.024785][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0000 (expanded=0) + [1666961637.024802][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v + [1666961637.024821][218195:218195] CHIP:DMG: AccessControl: allowed + [1666961637.024865][218195:218195] CHIP:DMG: Sending report (payload has 105 bytes)... + [1666961637.025090][218195:218195] CHIP:EM: <<< [E:24264r M:129383321 (Ack:149091728)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666961637.025123][218195:218195] CHIP:IN: (S) Sending msg 129383321 on secure session with LSID: 51710 + [1666961637.025575][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33508 | 129383321 | [Interaction Model (1) / Report Data (0x05) / Session = 47615 / Exchange = 24264] + [1666961637.025615][218195:218195] CHIP:DMG: Header Flags = + [1666961637.025630][218195:218195] CHIP:DMG: { + [1666961637.025654][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666961637.025666][218195:218195] CHIP:DMG: { + [1666961637.025680][218195:218195] CHIP:DMG: AckMsg = 149091728 + [1666961637.025692][218195:218195] CHIP:DMG: NeedsAck = true + [1666961637.025703][218195:218195] CHIP:DMG: } + [1666961637.025722][218195:218195] CHIP:DMG: } + [1666961637.025733][218195:218195] CHIP:DMG: + [1666961637.025754][218195:218195] CHIP:DMG: Encrypted Payload (139 bytes) = + [1666961637.025766][218195:218195] CHIP:DMG: { + [1666961637.025779][218195:218195] CHIP:DMG: data = 00ffb900993bb607eb7a6237df23556ef55553d6bdb002eca4dec5b0286b803f131401a010db1aacec9934e01a4728a9e89e4d2474216e665d12fb28265cdb5e9f09d88aa8a7806960884a21b7f21a52c57cac7dd797cdb01ff66e27a1c177ddea3bf84a046a5d4245c3afec579722a901f988a639716e0d4b295494ec005278cca871ae42cb62e25adecf + [1666961637.025796][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 + [1666961637.025807][218195:218195] CHIP:DMG: } + [1666961637.025822][218195:218195] CHIP:DMG: + [1666961637.025845][218195:218195] CHIP:DMG: Decrypted Payload (105 bytes) = + [1666961637.025858][218195:218195] CHIP:DMG: { + [1666961637.025871][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d240400183602181818153501260083c07f68370124020c24031d240400340518350225000001240101181818153501260083c07f68370124020c24031d240400340518350224001324010118181818290424ff0118 + [1666961637.025885][218195:218195] CHIP:DMG: } + [1666961637.025899][218195:218195] CHIP:DMG: + [1666961637.025985][218195:218195] CHIP:DMG: ReportDataMessage = + [1666961637.026005][218195:218195] CHIP:DMG: { + [1666961637.026020][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666961637.026041][218195:218195] CHIP:DMG: [ + [1666961637.026055][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961637.026076][218195:218195] CHIP:DMG: { + [1666961637.026089][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961637.026106][218195:218195] CHIP:DMG: { + [1666961637.026122][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666961637.026138][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.026155][218195:218195] CHIP:DMG: { + [1666961637.026171][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.026187][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.026205][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.026219][218195:218195] CHIP:DMG: } + [1666961637.026238][218195:218195] CHIP:DMG: + [1666961637.026254][218195:218195] CHIP:DMG: Data = [ + [1666961637.026270][218195:218195] CHIP:DMG: + [1666961637.026288][218195:218195] CHIP:DMG: ], + [1666961637.026303][218195:218195] CHIP:DMG: }, + [1666961637.026323][218195:218195] CHIP:DMG: + [1666961637.026338][218195:218195] CHIP:DMG: }, + [1666961637.026366][218195:218195] CHIP:DMG: + [1666961637.026382][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961637.026405][218195:218195] CHIP:DMG: { + [1666961637.026419][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961637.026435][218195:218195] CHIP:DMG: { + [1666961637.026452][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666961637.026467][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.026483][218195:218195] CHIP:DMG: { + [1666961637.026500][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.026518][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.026536][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.026553][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961637.026568][218195:218195] CHIP:DMG: } + [1666961637.026588][218195:218195] CHIP:DMG: + [1666961637.026605][218195:218195] CHIP:DMG: Data = + [1666961637.026622][218195:218195] CHIP:DMG: { + [1666961637.026640][218195:218195] CHIP:DMG: 0x0 = 256, + [1666961637.026658][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961637.026675][218195:218195] CHIP:DMG: }, + [1666961637.026690][218195:218195] CHIP:DMG: }, + [1666961637.026711][218195:218195] CHIP:DMG: + [1666961637.026726][218195:218195] CHIP:DMG: }, + [1666961637.026754][218195:218195] CHIP:DMG: + [1666961637.026766][218195:218195] CHIP:DMG: AttributeReportIB = + [1666961637.026784][218195:218195] CHIP:DMG: { + [1666961637.026797][218195:218195] CHIP:DMG: AttributeDataIB = + [1666961637.026812][218195:218195] CHIP:DMG: { + [1666961637.026824][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666961637.026835][218195:218195] CHIP:DMG: AttributePathIB = + [1666961637.026847][218195:218195] CHIP:DMG: { + [1666961637.026859][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666961637.026873][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666961637.026951][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666961637.027020][218195:218195] CHIP:DMG: ListIndex = Null, + [1666961637.027109][218195:218195] CHIP:DMG: } + [1666961637.027177][218195:218195] CHIP:DMG: + [1666961637.027238][218195:218195] CHIP:DMG: Data = + [1666961637.027299][218195:218195] CHIP:DMG: { + [1666961637.027360][218195:218195] CHIP:DMG: 0x0 = 19, + [1666961637.027423][218195:218195] CHIP:DMG: 0x1 = 1, + [1666961637.027435][218195:218195] CHIP:DMG: }, + [1666961637.027444][218195:218195] CHIP:DMG: }, + [1666961637.027459][218195:218195] CHIP:DMG: + [1666961637.027469][218195:218195] CHIP:DMG: }, + [1666961637.027483][218195:218195] CHIP:DMG: + [1666961637.027492][218195:218195] CHIP:DMG: ], + [1666961637.027515][218195:218195] CHIP:DMG: + [1666961637.027526][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666961637.027535][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666961637.027543][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 0 - Verify the PartList attribute response with endpoint 0 On TH(bridge-app) Log: - - 1666962087.594430][218195:218195] CHIP:IM: Received Read request - [1666962087.594452][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962087.594457][218195:218195] CHIP:DMG: { - [1666962087.594461][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962087.594466][218195:218195] CHIP:DMG: [ - [1666962087.594473][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.594483][218195:218195] CHIP:DMG: { - [1666962087.594489][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.594494][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.594499][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.594504][218195:218195] CHIP:DMG: } - [1666962087.594509][218195:218195] CHIP:DMG: - [1666962087.594513][218195:218195] CHIP:DMG: ], - [1666962087.594519][218195:218195] CHIP:DMG: - [1666962087.594524][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962087.594529][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962087.594533][218195:218195] CHIP:DMG: }, - [1666962087.594551][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962087.594567][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962087.594574][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962087.594578][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=0 AttributeId=0x0000_0003 (expanded=0) - [1666962087.594597][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=0 p=v - [1666962087.594611][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962087.594645][218195:218195] CHIP:DMG: Sending report (payload has 372 bytes)... - [1666962087.594772][218195:218195] CHIP:EM: <<< [E:39531r M:264814163 (Ack:140364006)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962087.594785][218195:218195] CHIP:IN: (S) Sending msg 264814163 on secure session with LSID: 51714 - [1666962087.594949][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:37487 | 264814163 | [Interaction Model (1) / Report Data (0x05) / Session = 56435 / Exchange = 39531] - [1666962087.594963][218195:218195] CHIP:DMG: Header Flags = - [1666962087.594970][218195:218195] CHIP:DMG: { - [1666962087.594986][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962087.594994][218195:218195] CHIP:DMG: { - [1666962087.595001][218195:218195] CHIP:DMG: AckMsg = 140364006 - [1666962087.595009][218195:218195] CHIP:DMG: NeedsAck = true - [1666962087.595015][218195:218195] CHIP:DMG: } - [1666962087.595026][218195:218195] CHIP:DMG: } - [1666962087.595032][218195:218195] CHIP:DMG: - [1666962087.595041][218195:218195] CHIP:DMG: Encrypted Payload (406 bytes) = - [1666962087.595048][218195:218195] CHIP:DMG: { - [1666962087.595054][218195:218195] CHIP:DMG: data = 0073dc0053bec80fd1f815ed86ead2d3269574276202e8fda951cd767949615968f0abd7254462609c370c3b39ffc94143e532800a998cfed825b833f865684d2b576f864e8a6309d1e1d28d9b818a9ac840b7893ac6f6d1e6e07e4925f98deec5ea7eb10139d1ea7a88d648fd4525446f2954707affa5fa2db1b4844befff709b488421a37533120e455faf2ee2d1109ac04155c51de43ddc324853d09c02e125979fbf4ecf6134d22e2a522ac6cf33155a61a7f5029c5aa83adb97cfd2453236ae11ef77c390a3fff4acd31c43579e251064b6d96b4d3f45561fa8d0b9089af0045eeeb788b8473d8070eb7a6e70dd2daf7c03696edffbb71b5b299306b8409f6ef27ce1eeb5aa065ba299fc886b18548e9ecc1b114841b2b9b1971ed0a199663ee6f3e417cf166ce7235e21e285f31290c0bfabdfcbe0c596ea85d94c9f75db9e1dd06a1d6060ebfd93ca1b2b70056f2c90b82088ec59eec5e55ec07a9ae6a2d4338ea7c58f501dd03fe03045e5abed6ace2ceb4372dcb81a833219f40eac3d90b3b0e5413bbcc22191762d9187b3d58bb8694db8 - [1666962087.595064][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 - [1666962087.595070][218195:218195] CHIP:DMG: } - [1666962087.595076][218195:218195] CHIP:DMG: - [1666962087.595096][218195:218195] CHIP:DMG: Decrypted Payload (372 bytes) = - [1666962087.595104][218195:218195] CHIP:DMG: { - [1666962087.595109][218195:218195] CHIP:DMG: data = 1536011535012600ced288a5370124020024031d2404031836021818181535012600ced288a5370124020024031d24040334051824020118181535012600ced288a5370124020024031d24040334051824020318181535012600ced288a5370124020024031d24040334051824020418181535012600ced288a5370124020024031d24040334051824020518181535012600ced288a5370124020024031d24040334051824020618181535012600ced288a5370124020024031d24040334051824020718181535012600ced288a5370124020024031d24040334051824020818181535012600ced288a5370124020024031d24040334051824020918181535012600ced288a5370124020024031d24040334051824020a18181535012600ced288a5370124020024031d24040334051824020b18181535012600ced288a5370124020024031d24040334051824020c18181535012600ced288a5370124020024031d24040334051824020d181818290424ff0118 - [1666962087.595120][218195:218195] CHIP:DMG: } - [1666962087.595126][218195:218195] CHIP:DMG: - [1666962087.595245][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962087.595252][218195:218195] CHIP:DMG: { - [1666962087.595259][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962087.595270][218195:218195] CHIP:DMG: [ - [1666962087.595276][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595287][218195:218195] CHIP:DMG: { - [1666962087.595294][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595302][218195:218195] CHIP:DMG: { - [1666962087.595310][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595319][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595327][218195:218195] CHIP:DMG: { - [1666962087.595336][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595344][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595353][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595362][218195:218195] CHIP:DMG: } - [1666962087.595373][218195:218195] CHIP:DMG: - [1666962087.595381][218195:218195] CHIP:DMG: Data = [ - [1666962087.595389][218195:218195] CHIP:DMG: - [1666962087.595399][218195:218195] CHIP:DMG: ], - [1666962087.595407][218195:218195] CHIP:DMG: }, - [1666962087.595417][218195:218195] CHIP:DMG: - [1666962087.595423][218195:218195] CHIP:DMG: }, - [1666962087.595436][218195:218195] CHIP:DMG: - [1666962087.595442][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595453][218195:218195] CHIP:DMG: { - [1666962087.595460][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595468][218195:218195] CHIP:DMG: { - [1666962087.595476][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595483][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595491][218195:218195] CHIP:DMG: { - [1666962087.595500][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595510][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595519][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595528][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.595535][218195:218195] CHIP:DMG: } - [1666962087.595545][218195:218195] CHIP:DMG: - [1666962087.595554][218195:218195] CHIP:DMG: Data = 1, - [1666962087.595563][218195:218195] CHIP:DMG: }, - [1666962087.595573][218195:218195] CHIP:DMG: - [1666962087.595580][218195:218195] CHIP:DMG: }, - [1666962087.595595][218195:218195] CHIP:DMG: - [1666962087.595602][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595613][218195:218195] CHIP:DMG: { - [1666962087.595621][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595629][218195:218195] CHIP:DMG: { - [1666962087.595637][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595644][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595652][218195:218195] CHIP:DMG: { - [1666962087.595660][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595670][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595678][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595690][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.595698][218195:218195] CHIP:DMG: } - [1666962087.595708][218195:218195] CHIP:DMG: - [1666962087.595716][218195:218195] CHIP:DMG: Data = 3, - [1666962087.595724][218195:218195] CHIP:DMG: }, - [1666962087.595736][218195:218195] CHIP:DMG: - [1666962087.595743][218195:218195] CHIP:DMG: }, - [1666962087.595756][218195:218195] CHIP:DMG: - [1666962087.595762][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595772][218195:218195] CHIP:DMG: { - [1666962087.595779][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595787][218195:218195] CHIP:DMG: { - [1666962087.595795][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595802][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595810][218195:218195] CHIP:DMG: { - [1666962087.595819][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595828][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595838][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.595847][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.595854][218195:218195] CHIP:DMG: } - [1666962087.595864][218195:218195] CHIP:DMG: - [1666962087.595874][218195:218195] CHIP:DMG: Data = 4, - [1666962087.595882][218195:218195] CHIP:DMG: }, - [1666962087.595892][218195:218195] CHIP:DMG: - [1666962087.595899][218195:218195] CHIP:DMG: }, - [1666962087.595912][218195:218195] CHIP:DMG: - [1666962087.595918][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.595929][218195:218195] CHIP:DMG: { - [1666962087.595935][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.595943][218195:218195] CHIP:DMG: { - [1666962087.595950][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.595958][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.595966][218195:218195] CHIP:DMG: { - [1666962087.595975][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.595985][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.595994][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596002][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596009][218195:218195] CHIP:DMG: } - [1666962087.596019][218195:218195] CHIP:DMG: - [1666962087.596027][218195:218195] CHIP:DMG: Data = 5, - [1666962087.596034][218195:218195] CHIP:DMG: }, - [1666962087.596044][218195:218195] CHIP:DMG: - [1666962087.596050][218195:218195] CHIP:DMG: }, - [1666962087.596064][218195:218195] CHIP:DMG: - [1666962087.596070][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596080][218195:218195] CHIP:DMG: { - [1666962087.596086][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596095][218195:218195] CHIP:DMG: { - [1666962087.596102][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596110][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596118][218195:218195] CHIP:DMG: { - [1666962087.596126][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596134][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596143][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596150][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596159][218195:218195] CHIP:DMG: } - [1666962087.596168][218195:218195] CHIP:DMG: - [1666962087.596176][218195:218195] CHIP:DMG: Data = 6, - [1666962087.596183][218195:218195] CHIP:DMG: }, - [1666962087.596193][218195:218195] CHIP:DMG: - [1666962087.596200][218195:218195] CHIP:DMG: }, - [1666962087.596213][218195:218195] CHIP:DMG: - [1666962087.596219][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596230][218195:218195] CHIP:DMG: { - [1666962087.596236][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596244][218195:218195] CHIP:DMG: { - [1666962087.596252][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596259][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596268][218195:218195] CHIP:DMG: { - [1666962087.596276][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596284][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596292][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596300][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596307][218195:218195] CHIP:DMG: } - [1666962087.596318][218195:218195] CHIP:DMG: - [1666962087.596326][218195:218195] CHIP:DMG: Data = 7, - [1666962087.596332][218195:218195] CHIP:DMG: }, - [1666962087.596343][218195:218195] CHIP:DMG: - [1666962087.596349][218195:218195] CHIP:DMG: }, - [1666962087.596362][218195:218195] CHIP:DMG: - [1666962087.596368][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596378][218195:218195] CHIP:DMG: { - [1666962087.596384][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596392][218195:218195] CHIP:DMG: { - [1666962087.596400][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596407][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596416][218195:218195] CHIP:DMG: { - [1666962087.596423][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596432][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596440][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596448][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596455][218195:218195] CHIP:DMG: } - [1666962087.596465][218195:218195] CHIP:DMG: - [1666962087.596474][218195:218195] CHIP:DMG: Data = 8, - [1666962087.596480][218195:218195] CHIP:DMG: }, - [1666962087.596490][218195:218195] CHIP:DMG: - [1666962087.596497][218195:218195] CHIP:DMG: }, - [1666962087.596510][218195:218195] CHIP:DMG: - [1666962087.596516][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596527][218195:218195] CHIP:DMG: { - [1666962087.596533][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596541][218195:218195] CHIP:DMG: { - [1666962087.596549][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596556][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596564][218195:218195] CHIP:DMG: { - [1666962087.596572][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596581][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596590][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596598][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596607][218195:218195] CHIP:DMG: } - [1666962087.596616][218195:218195] CHIP:DMG: - [1666962087.596626][218195:218195] CHIP:DMG: Data = 9, - [1666962087.596633][218195:218195] CHIP:DMG: }, - [1666962087.596643][218195:218195] CHIP:DMG: - [1666962087.596649][218195:218195] CHIP:DMG: }, - [1666962087.596662][218195:218195] CHIP:DMG: - [1666962087.596669][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596679][218195:218195] CHIP:DMG: { - [1666962087.596686][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596694][218195:218195] CHIP:DMG: { - [1666962087.596701][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596709][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596717][218195:218195] CHIP:DMG: { - [1666962087.596725][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596734][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596742][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596750][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596758][218195:218195] CHIP:DMG: } - [1666962087.596768][218195:218195] CHIP:DMG: - [1666962087.596776][218195:218195] CHIP:DMG: Data = 10, - [1666962087.596783][218195:218195] CHIP:DMG: }, - [1666962087.596793][218195:218195] CHIP:DMG: - [1666962087.596799][218195:218195] CHIP:DMG: }, - [1666962087.596812][218195:218195] CHIP:DMG: - [1666962087.596818][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596829][218195:218195] CHIP:DMG: { - [1666962087.596835][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596843][218195:218195] CHIP:DMG: { - [1666962087.596851][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.596858][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.596867][218195:218195] CHIP:DMG: { - [1666962087.596875][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.596883][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.596894][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.596902][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.596909][218195:218195] CHIP:DMG: } - [1666962087.596919][218195:218195] CHIP:DMG: - [1666962087.596927][218195:218195] CHIP:DMG: Data = 11, - [1666962087.596934][218195:218195] CHIP:DMG: }, - [1666962087.596944][218195:218195] CHIP:DMG: - [1666962087.596950][218195:218195] CHIP:DMG: }, - [1666962087.596963][218195:218195] CHIP:DMG: - [1666962087.596973][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.596984][218195:218195] CHIP:DMG: { - [1666962087.596990][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.596996][218195:218195] CHIP:DMG: { - [1666962087.597002][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.597008][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.597014][218195:218195] CHIP:DMG: { - [1666962087.597021][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.597027][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.597033][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.597039][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.597045][218195:218195] CHIP:DMG: } - [1666962087.597052][218195:218195] CHIP:DMG: - [1666962087.597059][218195:218195] CHIP:DMG: Data = 12, - [1666962087.597064][218195:218195] CHIP:DMG: }, - [1666962087.597072][218195:218195] CHIP:DMG: - [1666962087.597077][218195:218195] CHIP:DMG: }, - [1666962087.597089][218195:218195] CHIP:DMG: - [1666962087.597096][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962087.597107][218195:218195] CHIP:DMG: { - [1666962087.597113][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962087.597121][218195:218195] CHIP:DMG: { - [1666962087.597130][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, - [1666962087.597137][218195:218195] CHIP:DMG: AttributePathIB = - [1666962087.597143][218195:218195] CHIP:DMG: { - [1666962087.597150][218195:218195] CHIP:DMG: Endpoint = 0x0, - [1666962087.597159][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962087.597166][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962087.597172][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962087.597178][218195:218195] CHIP:DMG: } - [1666962087.597184][218195:218195] CHIP:DMG: - [1666962087.597190][218195:218195] CHIP:DMG: Data = 13, - [1666962087.597196][218195:218195] CHIP:DMG: }, - [1666962087.597204][218195:218195] CHIP:DMG: - [1666962087.597209][218195:218195] CHIP:DMG: }, - [1666962087.597216][218195:218195] CHIP:DMG: - [1666962087.597220][218195:218195] CHIP:DMG: ], - [1666962087.597256][218195:218195] CHIP:DMG: - [1666962087.597265][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962087.597273][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962087.597279][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 0 On TH(bridge-app) Log: + + 1666962087.594430][218195:218195] CHIP:IM: Received Read request + [1666962087.594452][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962087.594457][218195:218195] CHIP:DMG: { + [1666962087.594461][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962087.594466][218195:218195] CHIP:DMG: [ + [1666962087.594473][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.594483][218195:218195] CHIP:DMG: { + [1666962087.594489][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.594494][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.594499][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.594504][218195:218195] CHIP:DMG: } + [1666962087.594509][218195:218195] CHIP:DMG: + [1666962087.594513][218195:218195] CHIP:DMG: ], + [1666962087.594519][218195:218195] CHIP:DMG: + [1666962087.594524][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962087.594529][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962087.594533][218195:218195] CHIP:DMG: }, + [1666962087.594551][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962087.594567][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962087.594574][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962087.594578][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=0 AttributeId=0x0000_0003 (expanded=0) + [1666962087.594597][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=0 p=v + [1666962087.594611][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962087.594645][218195:218195] CHIP:DMG: Sending report (payload has 372 bytes)... + [1666962087.594772][218195:218195] CHIP:EM: <<< [E:39531r M:264814163 (Ack:140364006)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962087.594785][218195:218195] CHIP:IN: (S) Sending msg 264814163 on secure session with LSID: 51714 + [1666962087.594949][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:37487 | 264814163 | [Interaction Model (1) / Report Data (0x05) / Session = 56435 / Exchange = 39531] + [1666962087.594963][218195:218195] CHIP:DMG: Header Flags = + [1666962087.594970][218195:218195] CHIP:DMG: { + [1666962087.594986][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962087.594994][218195:218195] CHIP:DMG: { + [1666962087.595001][218195:218195] CHIP:DMG: AckMsg = 140364006 + [1666962087.595009][218195:218195] CHIP:DMG: NeedsAck = true + [1666962087.595015][218195:218195] CHIP:DMG: } + [1666962087.595026][218195:218195] CHIP:DMG: } + [1666962087.595032][218195:218195] CHIP:DMG: + [1666962087.595041][218195:218195] CHIP:DMG: Encrypted Payload (406 bytes) = + [1666962087.595048][218195:218195] CHIP:DMG: { + [1666962087.595054][218195:218195] CHIP:DMG: data = 0073dc0053bec80fd1f815ed86ead2d3269574276202e8fda951cd767949615968f0abd7254462609c370c3b39ffc94143e532800a998cfed825b833f865684d2b576f864e8a6309d1e1d28d9b818a9ac840b7893ac6f6d1e6e07e4925f98deec5ea7eb10139d1ea7a88d648fd4525446f2954707affa5fa2db1b4844befff709b488421a37533120e455faf2ee2d1109ac04155c51de43ddc324853d09c02e125979fbf4ecf6134d22e2a522ac6cf33155a61a7f5029c5aa83adb97cfd2453236ae11ef77c390a3fff4acd31c43579e251064b6d96b4d3f45561fa8d0b9089af0045eeeb788b8473d8070eb7a6e70dd2daf7c03696edffbb71b5b299306b8409f6ef27ce1eeb5aa065ba299fc886b18548e9ecc1b114841b2b9b1971ed0a199663ee6f3e417cf166ce7235e21e285f31290c0bfabdfcbe0c596ea85d94c9f75db9e1dd06a1d6060ebfd93ca1b2b70056f2c90b82088ec59eec5e55ec07a9ae6a2d4338ea7c58f501dd03fe03045e5abed6ace2ceb4372dcb81a833219f40eac3d90b3b0e5413bbcc22191762d9187b3d58bb8694db8 + [1666962087.595064][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 + [1666962087.595070][218195:218195] CHIP:DMG: } + [1666962087.595076][218195:218195] CHIP:DMG: + [1666962087.595096][218195:218195] CHIP:DMG: Decrypted Payload (372 bytes) = + [1666962087.595104][218195:218195] CHIP:DMG: { + [1666962087.595109][218195:218195] CHIP:DMG: data = 1536011535012600ced288a5370124020024031d2404031836021818181535012600ced288a5370124020024031d24040334051824020118181535012600ced288a5370124020024031d24040334051824020318181535012600ced288a5370124020024031d24040334051824020418181535012600ced288a5370124020024031d24040334051824020518181535012600ced288a5370124020024031d24040334051824020618181535012600ced288a5370124020024031d24040334051824020718181535012600ced288a5370124020024031d24040334051824020818181535012600ced288a5370124020024031d24040334051824020918181535012600ced288a5370124020024031d24040334051824020a18181535012600ced288a5370124020024031d24040334051824020b18181535012600ced288a5370124020024031d24040334051824020c18181535012600ced288a5370124020024031d24040334051824020d181818290424ff0118 + [1666962087.595120][218195:218195] CHIP:DMG: } + [1666962087.595126][218195:218195] CHIP:DMG: + [1666962087.595245][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962087.595252][218195:218195] CHIP:DMG: { + [1666962087.595259][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962087.595270][218195:218195] CHIP:DMG: [ + [1666962087.595276][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595287][218195:218195] CHIP:DMG: { + [1666962087.595294][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595302][218195:218195] CHIP:DMG: { + [1666962087.595310][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595319][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595327][218195:218195] CHIP:DMG: { + [1666962087.595336][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595344][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595353][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595362][218195:218195] CHIP:DMG: } + [1666962087.595373][218195:218195] CHIP:DMG: + [1666962087.595381][218195:218195] CHIP:DMG: Data = [ + [1666962087.595389][218195:218195] CHIP:DMG: + [1666962087.595399][218195:218195] CHIP:DMG: ], + [1666962087.595407][218195:218195] CHIP:DMG: }, + [1666962087.595417][218195:218195] CHIP:DMG: + [1666962087.595423][218195:218195] CHIP:DMG: }, + [1666962087.595436][218195:218195] CHIP:DMG: + [1666962087.595442][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595453][218195:218195] CHIP:DMG: { + [1666962087.595460][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595468][218195:218195] CHIP:DMG: { + [1666962087.595476][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595483][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595491][218195:218195] CHIP:DMG: { + [1666962087.595500][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595510][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595519][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595528][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.595535][218195:218195] CHIP:DMG: } + [1666962087.595545][218195:218195] CHIP:DMG: + [1666962087.595554][218195:218195] CHIP:DMG: Data = 1, + [1666962087.595563][218195:218195] CHIP:DMG: }, + [1666962087.595573][218195:218195] CHIP:DMG: + [1666962087.595580][218195:218195] CHIP:DMG: }, + [1666962087.595595][218195:218195] CHIP:DMG: + [1666962087.595602][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595613][218195:218195] CHIP:DMG: { + [1666962087.595621][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595629][218195:218195] CHIP:DMG: { + [1666962087.595637][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595644][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595652][218195:218195] CHIP:DMG: { + [1666962087.595660][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595670][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595678][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595690][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.595698][218195:218195] CHIP:DMG: } + [1666962087.595708][218195:218195] CHIP:DMG: + [1666962087.595716][218195:218195] CHIP:DMG: Data = 3, + [1666962087.595724][218195:218195] CHIP:DMG: }, + [1666962087.595736][218195:218195] CHIP:DMG: + [1666962087.595743][218195:218195] CHIP:DMG: }, + [1666962087.595756][218195:218195] CHIP:DMG: + [1666962087.595762][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595772][218195:218195] CHIP:DMG: { + [1666962087.595779][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595787][218195:218195] CHIP:DMG: { + [1666962087.595795][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595802][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595810][218195:218195] CHIP:DMG: { + [1666962087.595819][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595828][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595838][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.595847][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.595854][218195:218195] CHIP:DMG: } + [1666962087.595864][218195:218195] CHIP:DMG: + [1666962087.595874][218195:218195] CHIP:DMG: Data = 4, + [1666962087.595882][218195:218195] CHIP:DMG: }, + [1666962087.595892][218195:218195] CHIP:DMG: + [1666962087.595899][218195:218195] CHIP:DMG: }, + [1666962087.595912][218195:218195] CHIP:DMG: + [1666962087.595918][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.595929][218195:218195] CHIP:DMG: { + [1666962087.595935][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.595943][218195:218195] CHIP:DMG: { + [1666962087.595950][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.595958][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.595966][218195:218195] CHIP:DMG: { + [1666962087.595975][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.595985][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.595994][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596002][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596009][218195:218195] CHIP:DMG: } + [1666962087.596019][218195:218195] CHIP:DMG: + [1666962087.596027][218195:218195] CHIP:DMG: Data = 5, + [1666962087.596034][218195:218195] CHIP:DMG: }, + [1666962087.596044][218195:218195] CHIP:DMG: + [1666962087.596050][218195:218195] CHIP:DMG: }, + [1666962087.596064][218195:218195] CHIP:DMG: + [1666962087.596070][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596080][218195:218195] CHIP:DMG: { + [1666962087.596086][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596095][218195:218195] CHIP:DMG: { + [1666962087.596102][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596110][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596118][218195:218195] CHIP:DMG: { + [1666962087.596126][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596134][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596143][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596150][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596159][218195:218195] CHIP:DMG: } + [1666962087.596168][218195:218195] CHIP:DMG: + [1666962087.596176][218195:218195] CHIP:DMG: Data = 6, + [1666962087.596183][218195:218195] CHIP:DMG: }, + [1666962087.596193][218195:218195] CHIP:DMG: + [1666962087.596200][218195:218195] CHIP:DMG: }, + [1666962087.596213][218195:218195] CHIP:DMG: + [1666962087.596219][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596230][218195:218195] CHIP:DMG: { + [1666962087.596236][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596244][218195:218195] CHIP:DMG: { + [1666962087.596252][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596259][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596268][218195:218195] CHIP:DMG: { + [1666962087.596276][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596284][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596292][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596300][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596307][218195:218195] CHIP:DMG: } + [1666962087.596318][218195:218195] CHIP:DMG: + [1666962087.596326][218195:218195] CHIP:DMG: Data = 7, + [1666962087.596332][218195:218195] CHIP:DMG: }, + [1666962087.596343][218195:218195] CHIP:DMG: + [1666962087.596349][218195:218195] CHIP:DMG: }, + [1666962087.596362][218195:218195] CHIP:DMG: + [1666962087.596368][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596378][218195:218195] CHIP:DMG: { + [1666962087.596384][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596392][218195:218195] CHIP:DMG: { + [1666962087.596400][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596407][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596416][218195:218195] CHIP:DMG: { + [1666962087.596423][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596432][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596440][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596448][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596455][218195:218195] CHIP:DMG: } + [1666962087.596465][218195:218195] CHIP:DMG: + [1666962087.596474][218195:218195] CHIP:DMG: Data = 8, + [1666962087.596480][218195:218195] CHIP:DMG: }, + [1666962087.596490][218195:218195] CHIP:DMG: + [1666962087.596497][218195:218195] CHIP:DMG: }, + [1666962087.596510][218195:218195] CHIP:DMG: + [1666962087.596516][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596527][218195:218195] CHIP:DMG: { + [1666962087.596533][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596541][218195:218195] CHIP:DMG: { + [1666962087.596549][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596556][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596564][218195:218195] CHIP:DMG: { + [1666962087.596572][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596581][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596590][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596598][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596607][218195:218195] CHIP:DMG: } + [1666962087.596616][218195:218195] CHIP:DMG: + [1666962087.596626][218195:218195] CHIP:DMG: Data = 9, + [1666962087.596633][218195:218195] CHIP:DMG: }, + [1666962087.596643][218195:218195] CHIP:DMG: + [1666962087.596649][218195:218195] CHIP:DMG: }, + [1666962087.596662][218195:218195] CHIP:DMG: + [1666962087.596669][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596679][218195:218195] CHIP:DMG: { + [1666962087.596686][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596694][218195:218195] CHIP:DMG: { + [1666962087.596701][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596709][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596717][218195:218195] CHIP:DMG: { + [1666962087.596725][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596734][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596742][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596750][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596758][218195:218195] CHIP:DMG: } + [1666962087.596768][218195:218195] CHIP:DMG: + [1666962087.596776][218195:218195] CHIP:DMG: Data = 10, + [1666962087.596783][218195:218195] CHIP:DMG: }, + [1666962087.596793][218195:218195] CHIP:DMG: + [1666962087.596799][218195:218195] CHIP:DMG: }, + [1666962087.596812][218195:218195] CHIP:DMG: + [1666962087.596818][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596829][218195:218195] CHIP:DMG: { + [1666962087.596835][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596843][218195:218195] CHIP:DMG: { + [1666962087.596851][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.596858][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.596867][218195:218195] CHIP:DMG: { + [1666962087.596875][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.596883][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.596894][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.596902][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.596909][218195:218195] CHIP:DMG: } + [1666962087.596919][218195:218195] CHIP:DMG: + [1666962087.596927][218195:218195] CHIP:DMG: Data = 11, + [1666962087.596934][218195:218195] CHIP:DMG: }, + [1666962087.596944][218195:218195] CHIP:DMG: + [1666962087.596950][218195:218195] CHIP:DMG: }, + [1666962087.596963][218195:218195] CHIP:DMG: + [1666962087.596973][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.596984][218195:218195] CHIP:DMG: { + [1666962087.596990][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.596996][218195:218195] CHIP:DMG: { + [1666962087.597002][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.597008][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.597014][218195:218195] CHIP:DMG: { + [1666962087.597021][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.597027][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.597033][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.597039][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.597045][218195:218195] CHIP:DMG: } + [1666962087.597052][218195:218195] CHIP:DMG: + [1666962087.597059][218195:218195] CHIP:DMG: Data = 12, + [1666962087.597064][218195:218195] CHIP:DMG: }, + [1666962087.597072][218195:218195] CHIP:DMG: + [1666962087.597077][218195:218195] CHIP:DMG: }, + [1666962087.597089][218195:218195] CHIP:DMG: + [1666962087.597096][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962087.597107][218195:218195] CHIP:DMG: { + [1666962087.597113][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962087.597121][218195:218195] CHIP:DMG: { + [1666962087.597130][218195:218195] CHIP:DMG: DataVersion = 0xa588d2ce, + [1666962087.597137][218195:218195] CHIP:DMG: AttributePathIB = + [1666962087.597143][218195:218195] CHIP:DMG: { + [1666962087.597150][218195:218195] CHIP:DMG: Endpoint = 0x0, + [1666962087.597159][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962087.597166][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962087.597172][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962087.597178][218195:218195] CHIP:DMG: } + [1666962087.597184][218195:218195] CHIP:DMG: + [1666962087.597190][218195:218195] CHIP:DMG: Data = 13, + [1666962087.597196][218195:218195] CHIP:DMG: }, + [1666962087.597204][218195:218195] CHIP:DMG: + [1666962087.597209][218195:218195] CHIP:DMG: }, + [1666962087.597216][218195:218195] CHIP:DMG: + [1666962087.597220][218195:218195] CHIP:DMG: ], + [1666962087.597256][218195:218195] CHIP:DMG: + [1666962087.597265][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962087.597273][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962087.597279][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 1 - Verify the PartList attribute response with endpoint 1 On TH(bridge-app) Log: - - [1666962024.475117][218195:218195] CHIP:IM: Received Read request - [1666962024.475146][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962024.475155][218195:218195] CHIP:DMG: { - [1666962024.475161][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962024.475169][218195:218195] CHIP:DMG: [ - [1666962024.475175][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.475184][218195:218195] CHIP:DMG: { - [1666962024.475191][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.475199][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.475207][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.475215][218195:218195] CHIP:DMG: } - [1666962024.475225][218195:218195] CHIP:DMG: - [1666962024.475231][218195:218195] CHIP:DMG: ], - [1666962024.475240][218195:218195] CHIP:DMG: - [1666962024.475248][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962024.475257][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962024.475264][218195:218195] CHIP:DMG: }, - [1666962024.475297][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962024.475327][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962024.475336][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962024.475343][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0003 (expanded=0) - [1666962024.475353][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v - [1666962024.475372][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962024.475414][218195:218195] CHIP:DMG: Sending report (payload has 344 bytes)... - [1666962024.475546][218195:218195] CHIP:EM: <<< [E:54322r M:16539831 (Ack:16060294)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962024.475559][218195:218195] CHIP:IN: (S) Sending msg 16539831 on secure session with LSID: 51713 - [1666962024.475723][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:59192 | 16539831 | [Interaction Model (1) / Report Data (0x05) / Session = 37960 / Exchange = 54322] - [1666962024.475736][218195:218195] CHIP:DMG: Header Flags = - [1666962024.475743][218195:218195] CHIP:DMG: { - [1666962024.475758][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962024.475765][218195:218195] CHIP:DMG: { - [1666962024.475774][218195:218195] CHIP:DMG: AckMsg = 16060294 - [1666962024.475781][218195:218195] CHIP:DMG: NeedsAck = true - [1666962024.475787][218195:218195] CHIP:DMG: } - [1666962024.475799][218195:218195] CHIP:DMG: } - [1666962024.475806][218195:218195] CHIP:DMG: - [1666962024.475817][218195:218195] CHIP:DMG: Encrypted Payload (378 bytes) = - [1666962024.475824][218195:218195] CHIP:DMG: { - [1666962024.475831][218195:218195] CHIP:DMG: data = 00489400b760fc002339da2bb9f859e2c97c0037b5f78ac421947832bdf3d79f6ca2837ffc6ee714ed0a500314e6bb34e8d152d86e23ebfa7aeae2a6c9b66393e25411025eb6e39d6cb98ba50bc51e3eb2d08090404a02bf2d4fcd4bee51ca49731fb58cfe6b222f208e22afe971d36c9f67d6660d107fa90c537f9084e7fb5592aaf0ecfc3521f33f11e56e3132b0d80d51f7653d2f764f3e22cc0680d91c03e370170d6be3d13542b2e61b3996f45327bf467f3d87869bed5109bfbcd38b815ce0e2ec2518f0051327c611c7e1db47981db17fbbd0ff476658336a51ebddde8032d965507be3f043b9b99b18dd8d9468e70b19b6816a7a7a830f868b9e89035dae40c0534215a6031fcb4f937cba32a0c92ba878adeb4d10b708040715763324ce418f351f17de693e6e9c851cf99a1a516418769555619ca1f9b6937f7308814538debb770154646c10c88eaf8a0433cffa841b30f33e43916cf94aca3ea7a9f91d9226acb49c1e549d7c748c026045457ac1527fd2315a80 - [1666962024.475844][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 - [1666962024.475851][218195:218195] CHIP:DMG: } - [1666962024.475858][218195:218195] CHIP:DMG: - [1666962024.475872][218195:218195] CHIP:DMG: Decrypted Payload (344 bytes) = - [1666962024.475879][218195:218195] CHIP:DMG: { - [1666962024.475886][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404031836021818181535012600189f3e59370124020124031d24040334051824020318181535012600189f3e59370124020124031d24040334051824020418181535012600189f3e59370124020124031d24040334051824020518181535012600189f3e59370124020124031d24040334051824020618181535012600189f3e59370124020124031d24040334051824020718181535012600189f3e59370124020124031d24040334051824020818181535012600189f3e59370124020124031d24040334051824020918181535012600189f3e59370124020124031d24040334051824020a18181535012600189f3e59370124020124031d24040334051824020b18181535012600189f3e59370124020124031d24040334051824020c18181535012600189f3e59370124020124031d24040334051824020d181818290424ff0118 - [1666962024.475898][218195:218195] CHIP:DMG: } - [1666962024.475905][218195:218195] CHIP:DMG: - [1666962024.476017][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962024.476024][218195:218195] CHIP:DMG: { - [1666962024.476030][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962024.476043][218195:218195] CHIP:DMG: [ - [1666962024.476050][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476062][218195:218195] CHIP:DMG: { - [1666962024.476071][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476080][218195:218195] CHIP:DMG: { - [1666962024.476089][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476102][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476111][218195:218195] CHIP:DMG: { - [1666962024.476120][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476134][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476144][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476151][218195:218195] CHIP:DMG: } - [1666962024.476160][218195:218195] CHIP:DMG: - [1666962024.476167][218195:218195] CHIP:DMG: Data = [ - [1666962024.476174][218195:218195] CHIP:DMG: - [1666962024.476184][218195:218195] CHIP:DMG: ], - [1666962024.476192][218195:218195] CHIP:DMG: }, - [1666962024.476203][218195:218195] CHIP:DMG: - [1666962024.476208][218195:218195] CHIP:DMG: }, - [1666962024.476219][218195:218195] CHIP:DMG: - [1666962024.476223][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476232][218195:218195] CHIP:DMG: { - [1666962024.476238][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476245][218195:218195] CHIP:DMG: { - [1666962024.476251][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476258][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476265][218195:218195] CHIP:DMG: { - [1666962024.476272][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476279][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476288][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476295][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476301][218195:218195] CHIP:DMG: } - [1666962024.476309][218195:218195] CHIP:DMG: - [1666962024.476316][218195:218195] CHIP:DMG: Data = 3, - [1666962024.476323][218195:218195] CHIP:DMG: }, - [1666962024.476332][218195:218195] CHIP:DMG: - [1666962024.476337][218195:218195] CHIP:DMG: }, - [1666962024.476349][218195:218195] CHIP:DMG: - [1666962024.476354][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476363][218195:218195] CHIP:DMG: { - [1666962024.476369][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476376][218195:218195] CHIP:DMG: { - [1666962024.476383][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476389][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476396][218195:218195] CHIP:DMG: { - [1666962024.476403][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476410][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476418][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476425][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476432][218195:218195] CHIP:DMG: } - [1666962024.476440][218195:218195] CHIP:DMG: - [1666962024.476447][218195:218195] CHIP:DMG: Data = 4, - [1666962024.476453][218195:218195] CHIP:DMG: }, - [1666962024.476462][218195:218195] CHIP:DMG: - [1666962024.476468][218195:218195] CHIP:DMG: }, - [1666962024.476480][218195:218195] CHIP:DMG: - [1666962024.476485][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476494][218195:218195] CHIP:DMG: { - [1666962024.476500][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476507][218195:218195] CHIP:DMG: { - [1666962024.476513][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476520][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476527][218195:218195] CHIP:DMG: { - [1666962024.476534][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476543][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476552][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476560][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476569][218195:218195] CHIP:DMG: } - [1666962024.476577][218195:218195] CHIP:DMG: - [1666962024.476584][218195:218195] CHIP:DMG: Data = 5, - [1666962024.476590][218195:218195] CHIP:DMG: }, - [1666962024.476599][218195:218195] CHIP:DMG: - [1666962024.476605][218195:218195] CHIP:DMG: }, - [1666962024.476616][218195:218195] CHIP:DMG: - [1666962024.476622][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476631][218195:218195] CHIP:DMG: { - [1666962024.476637][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476643][218195:218195] CHIP:DMG: { - [1666962024.476650][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476657][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476664][218195:218195] CHIP:DMG: { - [1666962024.476671][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476678][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476687][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476694][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476703][218195:218195] CHIP:DMG: } - [1666962024.476711][218195:218195] CHIP:DMG: - [1666962024.476718][218195:218195] CHIP:DMG: Data = 6, - [1666962024.476724][218195:218195] CHIP:DMG: }, - [1666962024.476733][218195:218195] CHIP:DMG: - [1666962024.476739][218195:218195] CHIP:DMG: }, - [1666962024.476750][218195:218195] CHIP:DMG: - [1666962024.476756][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476765][218195:218195] CHIP:DMG: { - [1666962024.476771][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476777][218195:218195] CHIP:DMG: { - [1666962024.476784][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476790][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476797][218195:218195] CHIP:DMG: { - [1666962024.476804][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476812][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476820][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476827][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476835][218195:218195] CHIP:DMG: } - [1666962024.476844][218195:218195] CHIP:DMG: - [1666962024.476851][218195:218195] CHIP:DMG: Data = 7, - [1666962024.476858][218195:218195] CHIP:DMG: }, - [1666962024.476867][218195:218195] CHIP:DMG: - [1666962024.476872][218195:218195] CHIP:DMG: }, - [1666962024.476884][218195:218195] CHIP:DMG: - [1666962024.476890][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.476898][218195:218195] CHIP:DMG: { - [1666962024.476904][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.476911][218195:218195] CHIP:DMG: { - [1666962024.476918][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.476926][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.476933][218195:218195] CHIP:DMG: { - [1666962024.476940][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.476948][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.476959][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.476968][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.476975][218195:218195] CHIP:DMG: } - [1666962024.476983][218195:218195] CHIP:DMG: - [1666962024.476990][218195:218195] CHIP:DMG: Data = 8, - [1666962024.476997][218195:218195] CHIP:DMG: }, - [1666962024.477005][218195:218195] CHIP:DMG: - [1666962024.477011][218195:218195] CHIP:DMG: }, - [1666962024.477022][218195:218195] CHIP:DMG: - [1666962024.477028][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477037][218195:218195] CHIP:DMG: { - [1666962024.477043][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477050][218195:218195] CHIP:DMG: { - [1666962024.477057][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477064][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477071][218195:218195] CHIP:DMG: { - [1666962024.477078][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477087][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477096][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477103][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477111][218195:218195] CHIP:DMG: } - [1666962024.477119][218195:218195] CHIP:DMG: - [1666962024.477127][218195:218195] CHIP:DMG: Data = 9, - [1666962024.477133][218195:218195] CHIP:DMG: }, - [1666962024.477142][218195:218195] CHIP:DMG: - [1666962024.477148][218195:218195] CHIP:DMG: }, - [1666962024.477159][218195:218195] CHIP:DMG: - [1666962024.477165][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477174][218195:218195] CHIP:DMG: { - [1666962024.477180][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477187][218195:218195] CHIP:DMG: { - [1666962024.477193][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477200][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477207][218195:218195] CHIP:DMG: { - [1666962024.477214][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477223][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477232][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477239][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477247][218195:218195] CHIP:DMG: } - [1666962024.477255][218195:218195] CHIP:DMG: - [1666962024.477262][218195:218195] CHIP:DMG: Data = 10, - [1666962024.477269][218195:218195] CHIP:DMG: }, - [1666962024.477278][218195:218195] CHIP:DMG: - [1666962024.477283][218195:218195] CHIP:DMG: }, - [1666962024.477294][218195:218195] CHIP:DMG: - [1666962024.477299][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477308][218195:218195] CHIP:DMG: { - [1666962024.477314][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477321][218195:218195] CHIP:DMG: { - [1666962024.477328][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477335][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477342][218195:218195] CHIP:DMG: { - [1666962024.477350][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477359][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477368][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477376][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477384][218195:218195] CHIP:DMG: } - [1666962024.477393][218195:218195] CHIP:DMG: - [1666962024.477400][218195:218195] CHIP:DMG: Data = 11, - [1666962024.477407][218195:218195] CHIP:DMG: }, - [1666962024.477415][218195:218195] CHIP:DMG: - [1666962024.477421][218195:218195] CHIP:DMG: }, - [1666962024.477433][218195:218195] CHIP:DMG: - [1666962024.477440][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477450][218195:218195] CHIP:DMG: { - [1666962024.477457][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477465][218195:218195] CHIP:DMG: { - [1666962024.477472][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477480][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477488][218195:218195] CHIP:DMG: { - [1666962024.477495][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477504][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477512][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477520][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477527][218195:218195] CHIP:DMG: } - [1666962024.477536][218195:218195] CHIP:DMG: - [1666962024.477545][218195:218195] CHIP:DMG: Data = 12, - [1666962024.477552][218195:218195] CHIP:DMG: }, - [1666962024.477560][218195:218195] CHIP:DMG: - [1666962024.477567][218195:218195] CHIP:DMG: }, - [1666962024.477579][218195:218195] CHIP:DMG: - [1666962024.477586][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962024.477595][218195:218195] CHIP:DMG: { - [1666962024.477601][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962024.477608][218195:218195] CHIP:DMG: { - [1666962024.477614][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, - [1666962024.477621][218195:218195] CHIP:DMG: AttributePathIB = - [1666962024.477629][218195:218195] CHIP:DMG: { - [1666962024.477636][218195:218195] CHIP:DMG: Endpoint = 0x1, - [1666962024.477644][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962024.477651][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962024.477659][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962024.477667][218195:218195] CHIP:DMG: } - [1666962024.477678][218195:218195] CHIP:DMG: - [1666962024.477686][218195:218195] CHIP:DMG: Data = 13, - [1666962024.477694][218195:218195] CHIP:DMG: }, - [1666962024.477703][218195:218195] CHIP:DMG: - [1666962024.477709][218195:218195] CHIP:DMG: }, - [1666962024.477717][218195:218195] CHIP:DMG: - [1666962024.477723][218195:218195] CHIP:DMG: ], - [1666962024.477761][218195:218195] CHIP:DMG: - [1666962024.477768][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962024.477774][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962024.477781][218195:218195] CHIP:DMG: } - [1666962024.477789][218195:218195] CHIP:DMG: - - ./chip-tool descriptor read parts-list 1 2 - - Verify the PartList attribute response with endpoint 2 On TH(bridge-app) Log: - - [1666962122.075925][218195:218195] CHIP:IM: Received Read request - [1666962122.075953][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962122.075960][218195:218195] CHIP:DMG: { - [1666962122.075965][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962122.075972][218195:218195] CHIP:DMG: [ - [1666962122.075978][218195:218195] CHIP:DMG: AttributePathIB = - [1666962122.075985][218195:218195] CHIP:DMG: { - [1666962122.075991][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666962122.075998][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962122.076005][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962122.076011][218195:218195] CHIP:DMG: } - [1666962122.076018][218195:218195] CHIP:DMG: - [1666962122.076025][218195:218195] CHIP:DMG: ], - [1666962122.076032][218195:218195] CHIP:DMG: - [1666962122.076039][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962122.076045][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962122.076050][218195:218195] CHIP:DMG: }, - [1666962122.076076][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962122.076096][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962122.076104][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962122.076109][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=2 AttributeId=0x0000_0003 (expanded=0) - [1666962122.076124][218195:218195] CHIP:DMG: Sending report (payload has 33 bytes)... - [1666962122.076230][218195:218195] CHIP:EM: <<< [E:12842r M:6348185 (Ack:232430163)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962122.076242][218195:218195] CHIP:IN: (S) Sending msg 6348185 on secure session with LSID: 51715 - [1666962122.076377][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:46280 | 6348185 | [Interaction Model (1) / Report Data (0x05) / Session = 23464 / Exchange = 12842] - [1666962122.076393][218195:218195] CHIP:DMG: Header Flags = - [1666962122.076400][218195:218195] CHIP:DMG: { - [1666962122.076416][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962122.076422][218195:218195] CHIP:DMG: { - [1666962122.076431][218195:218195] CHIP:DMG: AckMsg = 232430163 - [1666962122.076438][218195:218195] CHIP:DMG: NeedsAck = true - [1666962122.076445][218195:218195] CHIP:DMG: } - [1666962122.076457][218195:218195] CHIP:DMG: } - [1666962122.076463][218195:218195] CHIP:DMG: - [1666962122.076473][218195:218195] CHIP:DMG: Encrypted Payload (67 bytes) = - [1666962122.076479][218195:218195] CHIP:DMG: { - [1666962122.076485][218195:218195] CHIP:DMG: data = 00a85b0099dd60001e26b5c1cfa1da4d303aea77d3171c34b8d4c5f53620b3db5a353b9220df87512e58952b5ea5b56dffc79121a74544db29f4bb907e23a33d82a0ca - [1666962122.076491][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 - [1666962122.076497][218195:218195] CHIP:DMG: } - [1666962122.076503][218195:218195] CHIP:DMG: - [1666962122.076515][218195:218195] CHIP:DMG: Decrypted Payload (33 bytes) = - [1666962122.076521][218195:218195] CHIP:DMG: { - [1666962122.076529][218195:218195] CHIP:DMG: data = 153601153500370024020224031d24040318350124007f18181818290424ff0118 - [1666962122.076536][218195:218195] CHIP:DMG: } - [1666962122.076542][218195:218195] CHIP:DMG: - [1666962122.076566][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962122.076572][218195:218195] CHIP:DMG: { - [1666962122.076578][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962122.076587][218195:218195] CHIP:DMG: [ - [1666962122.076593][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962122.076602][218195:218195] CHIP:DMG: { - [1666962122.076608][218195:218195] CHIP:DMG: AttributeStatusIB = - [1666962122.076615][218195:218195] CHIP:DMG: { - [1666962122.076621][218195:218195] CHIP:DMG: AttributePathIB = - [1666962122.076628][218195:218195] CHIP:DMG: { - [1666962122.076636][218195:218195] CHIP:DMG: Endpoint = 0x2, - [1666962122.076644][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962122.076653][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962122.076660][218195:218195] CHIP:DMG: } - [1666962122.076671][218195:218195] CHIP:DMG: - [1666962122.076678][218195:218195] CHIP:DMG: StatusIB = - [1666962122.076686][218195:218195] CHIP:DMG: { - [1666962122.076694][218195:218195] CHIP:DMG: status = 0x7f (UNSUPPORTED_ENDPOINT), - [1666962122.076702][218195:218195] CHIP:DMG: }, - [1666962122.076708][218195:218195] CHIP:DMG: - [1666962122.076713][218195:218195] CHIP:DMG: }, - [1666962122.076720][218195:218195] CHIP:DMG: - [1666962122.076725][218195:218195] CHIP:DMG: }, - [1666962122.076732][218195:218195] CHIP:DMG: - [1666962122.076736][218195:218195] CHIP:DMG: ], - [1666962122.076744][218195:218195] CHIP:DMG: - [1666962122.076753][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962122.076761][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962122.076769][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 1 On TH(bridge-app) Log: + + [1666962024.475117][218195:218195] CHIP:IM: Received Read request + [1666962024.475146][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962024.475155][218195:218195] CHIP:DMG: { + [1666962024.475161][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962024.475169][218195:218195] CHIP:DMG: [ + [1666962024.475175][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.475184][218195:218195] CHIP:DMG: { + [1666962024.475191][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.475199][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.475207][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.475215][218195:218195] CHIP:DMG: } + [1666962024.475225][218195:218195] CHIP:DMG: + [1666962024.475231][218195:218195] CHIP:DMG: ], + [1666962024.475240][218195:218195] CHIP:DMG: + [1666962024.475248][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962024.475257][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962024.475264][218195:218195] CHIP:DMG: }, + [1666962024.475297][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962024.475327][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962024.475336][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962024.475343][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=1 AttributeId=0x0000_0003 (expanded=0) + [1666962024.475353][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=1 p=v + [1666962024.475372][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962024.475414][218195:218195] CHIP:DMG: Sending report (payload has 344 bytes)... + [1666962024.475546][218195:218195] CHIP:EM: <<< [E:54322r M:16539831 (Ack:16060294)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962024.475559][218195:218195] CHIP:IN: (S) Sending msg 16539831 on secure session with LSID: 51713 + [1666962024.475723][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:59192 | 16539831 | [Interaction Model (1) / Report Data (0x05) / Session = 37960 / Exchange = 54322] + [1666962024.475736][218195:218195] CHIP:DMG: Header Flags = + [1666962024.475743][218195:218195] CHIP:DMG: { + [1666962024.475758][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962024.475765][218195:218195] CHIP:DMG: { + [1666962024.475774][218195:218195] CHIP:DMG: AckMsg = 16060294 + [1666962024.475781][218195:218195] CHIP:DMG: NeedsAck = true + [1666962024.475787][218195:218195] CHIP:DMG: } + [1666962024.475799][218195:218195] CHIP:DMG: } + [1666962024.475806][218195:218195] CHIP:DMG: + [1666962024.475817][218195:218195] CHIP:DMG: Encrypted Payload (378 bytes) = + [1666962024.475824][218195:218195] CHIP:DMG: { + [1666962024.475831][218195:218195] CHIP:DMG: data = 00489400b760fc002339da2bb9f859e2c97c0037b5f78ac421947832bdf3d79f6ca2837ffc6ee714ed0a500314e6bb34e8d152d86e23ebfa7aeae2a6c9b66393e25411025eb6e39d6cb98ba50bc51e3eb2d08090404a02bf2d4fcd4bee51ca49731fb58cfe6b222f208e22afe971d36c9f67d6660d107fa90c537f9084e7fb5592aaf0ecfc3521f33f11e56e3132b0d80d51f7653d2f764f3e22cc0680d91c03e370170d6be3d13542b2e61b3996f45327bf467f3d87869bed5109bfbcd38b815ce0e2ec2518f0051327c611c7e1db47981db17fbbd0ff476658336a51ebddde8032d965507be3f043b9b99b18dd8d9468e70b19b6816a7a7a830f868b9e89035dae40c0534215a6031fcb4f937cba32a0c92ba878adeb4d10b708040715763324ce418f351f17de693e6e9c851cf99a1a516418769555619ca1f9b6937f7308814538debb770154646c10c88eaf8a0433cffa841b30f33e43916cf94aca3ea7a9f91d9226acb49c1e549d7c748c026045457ac1527fd2315a80 + [1666962024.475844][218195:218195] CHIP:DMG: buffer_ptr = 94136416760928 + [1666962024.475851][218195:218195] CHIP:DMG: } + [1666962024.475858][218195:218195] CHIP:DMG: + [1666962024.475872][218195:218195] CHIP:DMG: Decrypted Payload (344 bytes) = + [1666962024.475879][218195:218195] CHIP:DMG: { + [1666962024.475886][218195:218195] CHIP:DMG: data = 1536011535012600189f3e59370124020124031d2404031836021818181535012600189f3e59370124020124031d24040334051824020318181535012600189f3e59370124020124031d24040334051824020418181535012600189f3e59370124020124031d24040334051824020518181535012600189f3e59370124020124031d24040334051824020618181535012600189f3e59370124020124031d24040334051824020718181535012600189f3e59370124020124031d24040334051824020818181535012600189f3e59370124020124031d24040334051824020918181535012600189f3e59370124020124031d24040334051824020a18181535012600189f3e59370124020124031d24040334051824020b18181535012600189f3e59370124020124031d24040334051824020c18181535012600189f3e59370124020124031d24040334051824020d181818290424ff0118 + [1666962024.475898][218195:218195] CHIP:DMG: } + [1666962024.475905][218195:218195] CHIP:DMG: + [1666962024.476017][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962024.476024][218195:218195] CHIP:DMG: { + [1666962024.476030][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962024.476043][218195:218195] CHIP:DMG: [ + [1666962024.476050][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476062][218195:218195] CHIP:DMG: { + [1666962024.476071][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476080][218195:218195] CHIP:DMG: { + [1666962024.476089][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476102][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476111][218195:218195] CHIP:DMG: { + [1666962024.476120][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476134][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476144][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476151][218195:218195] CHIP:DMG: } + [1666962024.476160][218195:218195] CHIP:DMG: + [1666962024.476167][218195:218195] CHIP:DMG: Data = [ + [1666962024.476174][218195:218195] CHIP:DMG: + [1666962024.476184][218195:218195] CHIP:DMG: ], + [1666962024.476192][218195:218195] CHIP:DMG: }, + [1666962024.476203][218195:218195] CHIP:DMG: + [1666962024.476208][218195:218195] CHIP:DMG: }, + [1666962024.476219][218195:218195] CHIP:DMG: + [1666962024.476223][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476232][218195:218195] CHIP:DMG: { + [1666962024.476238][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476245][218195:218195] CHIP:DMG: { + [1666962024.476251][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476258][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476265][218195:218195] CHIP:DMG: { + [1666962024.476272][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476279][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476288][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476295][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476301][218195:218195] CHIP:DMG: } + [1666962024.476309][218195:218195] CHIP:DMG: + [1666962024.476316][218195:218195] CHIP:DMG: Data = 3, + [1666962024.476323][218195:218195] CHIP:DMG: }, + [1666962024.476332][218195:218195] CHIP:DMG: + [1666962024.476337][218195:218195] CHIP:DMG: }, + [1666962024.476349][218195:218195] CHIP:DMG: + [1666962024.476354][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476363][218195:218195] CHIP:DMG: { + [1666962024.476369][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476376][218195:218195] CHIP:DMG: { + [1666962024.476383][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476389][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476396][218195:218195] CHIP:DMG: { + [1666962024.476403][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476410][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476418][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476425][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476432][218195:218195] CHIP:DMG: } + [1666962024.476440][218195:218195] CHIP:DMG: + [1666962024.476447][218195:218195] CHIP:DMG: Data = 4, + [1666962024.476453][218195:218195] CHIP:DMG: }, + [1666962024.476462][218195:218195] CHIP:DMG: + [1666962024.476468][218195:218195] CHIP:DMG: }, + [1666962024.476480][218195:218195] CHIP:DMG: + [1666962024.476485][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476494][218195:218195] CHIP:DMG: { + [1666962024.476500][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476507][218195:218195] CHIP:DMG: { + [1666962024.476513][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476520][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476527][218195:218195] CHIP:DMG: { + [1666962024.476534][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476543][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476552][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476560][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476569][218195:218195] CHIP:DMG: } + [1666962024.476577][218195:218195] CHIP:DMG: + [1666962024.476584][218195:218195] CHIP:DMG: Data = 5, + [1666962024.476590][218195:218195] CHIP:DMG: }, + [1666962024.476599][218195:218195] CHIP:DMG: + [1666962024.476605][218195:218195] CHIP:DMG: }, + [1666962024.476616][218195:218195] CHIP:DMG: + [1666962024.476622][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476631][218195:218195] CHIP:DMG: { + [1666962024.476637][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476643][218195:218195] CHIP:DMG: { + [1666962024.476650][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476657][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476664][218195:218195] CHIP:DMG: { + [1666962024.476671][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476678][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476687][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476694][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476703][218195:218195] CHIP:DMG: } + [1666962024.476711][218195:218195] CHIP:DMG: + [1666962024.476718][218195:218195] CHIP:DMG: Data = 6, + [1666962024.476724][218195:218195] CHIP:DMG: }, + [1666962024.476733][218195:218195] CHIP:DMG: + [1666962024.476739][218195:218195] CHIP:DMG: }, + [1666962024.476750][218195:218195] CHIP:DMG: + [1666962024.476756][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476765][218195:218195] CHIP:DMG: { + [1666962024.476771][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476777][218195:218195] CHIP:DMG: { + [1666962024.476784][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476790][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476797][218195:218195] CHIP:DMG: { + [1666962024.476804][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476812][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476820][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476827][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476835][218195:218195] CHIP:DMG: } + [1666962024.476844][218195:218195] CHIP:DMG: + [1666962024.476851][218195:218195] CHIP:DMG: Data = 7, + [1666962024.476858][218195:218195] CHIP:DMG: }, + [1666962024.476867][218195:218195] CHIP:DMG: + [1666962024.476872][218195:218195] CHIP:DMG: }, + [1666962024.476884][218195:218195] CHIP:DMG: + [1666962024.476890][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.476898][218195:218195] CHIP:DMG: { + [1666962024.476904][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.476911][218195:218195] CHIP:DMG: { + [1666962024.476918][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.476926][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.476933][218195:218195] CHIP:DMG: { + [1666962024.476940][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.476948][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.476959][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.476968][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.476975][218195:218195] CHIP:DMG: } + [1666962024.476983][218195:218195] CHIP:DMG: + [1666962024.476990][218195:218195] CHIP:DMG: Data = 8, + [1666962024.476997][218195:218195] CHIP:DMG: }, + [1666962024.477005][218195:218195] CHIP:DMG: + [1666962024.477011][218195:218195] CHIP:DMG: }, + [1666962024.477022][218195:218195] CHIP:DMG: + [1666962024.477028][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477037][218195:218195] CHIP:DMG: { + [1666962024.477043][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477050][218195:218195] CHIP:DMG: { + [1666962024.477057][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477064][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477071][218195:218195] CHIP:DMG: { + [1666962024.477078][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477087][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477096][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477103][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477111][218195:218195] CHIP:DMG: } + [1666962024.477119][218195:218195] CHIP:DMG: + [1666962024.477127][218195:218195] CHIP:DMG: Data = 9, + [1666962024.477133][218195:218195] CHIP:DMG: }, + [1666962024.477142][218195:218195] CHIP:DMG: + [1666962024.477148][218195:218195] CHIP:DMG: }, + [1666962024.477159][218195:218195] CHIP:DMG: + [1666962024.477165][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477174][218195:218195] CHIP:DMG: { + [1666962024.477180][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477187][218195:218195] CHIP:DMG: { + [1666962024.477193][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477200][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477207][218195:218195] CHIP:DMG: { + [1666962024.477214][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477223][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477232][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477239][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477247][218195:218195] CHIP:DMG: } + [1666962024.477255][218195:218195] CHIP:DMG: + [1666962024.477262][218195:218195] CHIP:DMG: Data = 10, + [1666962024.477269][218195:218195] CHIP:DMG: }, + [1666962024.477278][218195:218195] CHIP:DMG: + [1666962024.477283][218195:218195] CHIP:DMG: }, + [1666962024.477294][218195:218195] CHIP:DMG: + [1666962024.477299][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477308][218195:218195] CHIP:DMG: { + [1666962024.477314][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477321][218195:218195] CHIP:DMG: { + [1666962024.477328][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477335][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477342][218195:218195] CHIP:DMG: { + [1666962024.477350][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477359][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477368][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477376][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477384][218195:218195] CHIP:DMG: } + [1666962024.477393][218195:218195] CHIP:DMG: + [1666962024.477400][218195:218195] CHIP:DMG: Data = 11, + [1666962024.477407][218195:218195] CHIP:DMG: }, + [1666962024.477415][218195:218195] CHIP:DMG: + [1666962024.477421][218195:218195] CHIP:DMG: }, + [1666962024.477433][218195:218195] CHIP:DMG: + [1666962024.477440][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477450][218195:218195] CHIP:DMG: { + [1666962024.477457][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477465][218195:218195] CHIP:DMG: { + [1666962024.477472][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477480][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477488][218195:218195] CHIP:DMG: { + [1666962024.477495][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477504][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477512][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477520][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477527][218195:218195] CHIP:DMG: } + [1666962024.477536][218195:218195] CHIP:DMG: + [1666962024.477545][218195:218195] CHIP:DMG: Data = 12, + [1666962024.477552][218195:218195] CHIP:DMG: }, + [1666962024.477560][218195:218195] CHIP:DMG: + [1666962024.477567][218195:218195] CHIP:DMG: }, + [1666962024.477579][218195:218195] CHIP:DMG: + [1666962024.477586][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962024.477595][218195:218195] CHIP:DMG: { + [1666962024.477601][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962024.477608][218195:218195] CHIP:DMG: { + [1666962024.477614][218195:218195] CHIP:DMG: DataVersion = 0x593e9f18, + [1666962024.477621][218195:218195] CHIP:DMG: AttributePathIB = + [1666962024.477629][218195:218195] CHIP:DMG: { + [1666962024.477636][218195:218195] CHIP:DMG: Endpoint = 0x1, + [1666962024.477644][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962024.477651][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962024.477659][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962024.477667][218195:218195] CHIP:DMG: } + [1666962024.477678][218195:218195] CHIP:DMG: + [1666962024.477686][218195:218195] CHIP:DMG: Data = 13, + [1666962024.477694][218195:218195] CHIP:DMG: }, + [1666962024.477703][218195:218195] CHIP:DMG: + [1666962024.477709][218195:218195] CHIP:DMG: }, + [1666962024.477717][218195:218195] CHIP:DMG: + [1666962024.477723][218195:218195] CHIP:DMG: ], + [1666962024.477761][218195:218195] CHIP:DMG: + [1666962024.477768][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962024.477774][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962024.477781][218195:218195] CHIP:DMG: } + [1666962024.477789][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 3 - Verify the PartList attribute response with endpoint 3 On TH(bridge-app) Log: - - [1666962181.272370][218195:218195] CHIP:IM: Received Read request - [1666962181.272431][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962181.272451][218195:218195] CHIP:DMG: { - [1666962181.272466][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962181.272482][218195:218195] CHIP:DMG: [ - [1666962181.272497][218195:218195] CHIP:DMG: AttributePathIB = - [1666962181.272515][218195:218195] CHIP:DMG: { - [1666962181.272532][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666962181.272548][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962181.272565][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962181.272581][218195:218195] CHIP:DMG: } - [1666962181.272599][218195:218195] CHIP:DMG: - [1666962181.272614][218195:218195] CHIP:DMG: ], - [1666962181.272633][218195:218195] CHIP:DMG: - [1666962181.272649][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962181.272665][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962181.272679][218195:218195] CHIP:DMG: }, - [1666962181.272736][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962181.272791][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962181.272810][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962181.272825][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0003 (expanded=0) - [1666962181.272846][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v - [1666962181.272869][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962181.272906][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962181.273115][218195:218195] CHIP:EM: <<< [E:46913r M:111572064 (Ack:187764321)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962181.273146][218195:218195] CHIP:IN: (S) Sending msg 111572064 on secure session with LSID: 51716 - [1666962181.273415][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36413 | 111572064 | [Interaction Model (1) / Report Data (0x05) / Session = 7119 / Exchange = 46913] - [1666962181.273447][218195:218195] CHIP:DMG: Header Flags = - [1666962181.273465][218195:218195] CHIP:DMG: { - [1666962181.273492][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962181.273507][218195:218195] CHIP:DMG: { - [1666962181.273523][218195:218195] CHIP:DMG: AckMsg = 187764321 - [1666962181.273536][218195:218195] CHIP:DMG: NeedsAck = true - [1666962181.273550][218195:218195] CHIP:DMG: } - [1666962181.273572][218195:218195] CHIP:DMG: } - [1666962181.273585][218195:218195] CHIP:DMG: - [1666962181.273605][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962181.273619][218195:218195] CHIP:DMG: { - [1666962181.273633][218195:218195] CHIP:DMG: data = 00cf1b006074a606d86a9f1f8d1116587d199c334287a090de625e1267cae0122cf9bb9514247ab1b27ca9ec853fc523ff013060a7845eaf1b9fc336790bc3d8e2e7bf06a5fc - [1666962181.273649][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 - [1666962181.273663][218195:218195] CHIP:DMG: } - [1666962181.273676][218195:218195] CHIP:DMG: - [1666962181.273697][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962181.273717][218195:218195] CHIP:DMG: { - [1666962181.273738][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d24040318360218181818290424ff0118 - [1666962181.273753][218195:218195] CHIP:DMG: } - [1666962181.273766][218195:218195] CHIP:DMG: - [1666962181.273823][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962181.273840][218195:218195] CHIP:DMG: { - [1666962181.273851][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962181.273876][218195:218195] CHIP:DMG: [ - [1666962181.273891][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962181.273916][218195:218195] CHIP:DMG: { - [1666962181.273933][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962181.273954][218195:218195] CHIP:DMG: { - [1666962181.273972][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, - [1666962181.273988][218195:218195] CHIP:DMG: AttributePathIB = - [1666962181.274005][218195:218195] CHIP:DMG: { - [1666962181.274022][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666962181.274041][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962181.274062][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962181.274082][218195:218195] CHIP:DMG: } - [1666962181.274102][218195:218195] CHIP:DMG: - [1666962181.274124][218195:218195] CHIP:DMG: Data = [ - [1666962181.274145][218195:218195] CHIP:DMG: - [1666962181.274165][218195:218195] CHIP:DMG: ], - [1666962181.274182][218195:218195] CHIP:DMG: }, - [1666962181.274206][218195:218195] CHIP:DMG: - [1666962181.274224][218195:218195] CHIP:DMG: }, - [1666962181.274248][218195:218195] CHIP:DMG: - [1666962181.274266][218195:218195] CHIP:DMG: ], - [1666962181.274288][218195:218195] CHIP:DMG: - [1666962181.274303][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962181.274318][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962181.274337][218195:218195] CHIP:DMG: } - [1666962181.274354][218195:218195] CHIP:DMG: - - ./chip-tool descriptor read parts-list 1 4 - - Verify the PartList attribute response with endpoint 4 On TH(bridge-app) Log: - - [1666962226.211067][218195:218195] CHIP:IM: Received Read request - [1666962226.211160][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962226.211169][218195:218195] CHIP:DMG: { - [1666962226.211175][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962226.211183][218195:218195] CHIP:DMG: [ - [1666962226.211190][218195:218195] CHIP:DMG: AttributePathIB = - [1666962226.211200][218195:218195] CHIP:DMG: { - [1666962226.211209][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666962226.211218][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962226.211227][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962226.211235][218195:218195] CHIP:DMG: } - [1666962226.211245][218195:218195] CHIP:DMG: - [1666962226.211253][218195:218195] CHIP:DMG: ], - [1666962226.211263][218195:218195] CHIP:DMG: - [1666962226.211272][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962226.211280][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962226.211288][218195:218195] CHIP:DMG: }, - [1666962226.211319][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962226.211353][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962226.211363][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962226.211370][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0003 (expanded=0) - [1666962226.211382][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v - [1666962226.211396][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962226.211419][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962226.211532][218195:218195] CHIP:EM: <<< [E:32390r M:201985649 (Ack:262416764)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962226.211551][218195:218195] CHIP:IN: (S) Sending msg 201985649 on secure session with LSID: 51717 - [1666962226.211699][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:55096 | 201985649 | [Interaction Model (1) / Report Data (0x05) / Session = 41621 / Exchange = 32390] - [1666962226.211711][218195:218195] CHIP:DMG: Header Flags = - [1666962226.211715][218195:218195] CHIP:DMG: { - [1666962226.211726][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962226.211731][218195:218195] CHIP:DMG: { - [1666962226.211736][218195:218195] CHIP:DMG: AckMsg = 262416764 - [1666962226.211741][218195:218195] CHIP:DMG: NeedsAck = true - [1666962226.211745][218195:218195] CHIP:DMG: } - [1666962226.211753][218195:218195] CHIP:DMG: } - [1666962226.211758][218195:218195] CHIP:DMG: - [1666962226.211764][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962226.211769][218195:218195] CHIP:DMG: { - [1666962226.211773][218195:218195] CHIP:DMG: data = 0095a200710e0a0c886c3b3bdc1e7f2be7778df8c8dda3541891bd0743b7a912e9ccfd60902082784e8e2247f9d2628f782007da5ae8eab65680617b41888803918f2bcd05b6 - [1666962226.211778][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962226.211783][218195:218195] CHIP:DMG: } - [1666962226.211787][218195:218195] CHIP:DMG: - [1666962226.211795][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962226.211799][218195:218195] CHIP:DMG: { - [1666962226.211804][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d24040318360218181818290424ff0118 - [1666962226.211809][218195:218195] CHIP:DMG: } - [1666962226.211813][218195:218195] CHIP:DMG: - [1666962226.211835][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962226.211840][218195:218195] CHIP:DMG: { - [1666962226.211844][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962226.211852][218195:218195] CHIP:DMG: [ - [1666962226.211857][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962226.211865][218195:218195] CHIP:DMG: { - [1666962226.211870][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962226.211875][218195:218195] CHIP:DMG: { - [1666962226.211881][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, - [1666962226.211887][218195:218195] CHIP:DMG: AttributePathIB = - [1666962226.211892][218195:218195] CHIP:DMG: { - [1666962226.211898][218195:218195] CHIP:DMG: Endpoint = 0x4, - [1666962226.211904][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962226.211911][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962226.211916][218195:218195] CHIP:DMG: } - [1666962226.211923][218195:218195] CHIP:DMG: - [1666962226.211928][218195:218195] CHIP:DMG: Data = [ - [1666962226.211934][218195:218195] CHIP:DMG: - [1666962226.211940][218195:218195] CHIP:DMG: ], - [1666962226.211945][218195:218195] CHIP:DMG: }, - [1666962226.211952][218195:218195] CHIP:DMG: - [1666962226.211957][218195:218195] CHIP:DMG: }, - [1666962226.211965][218195:218195] CHIP:DMG: - [1666962226.211969][218195:218195] CHIP:DMG: ], - [1666962226.211977][218195:218195] CHIP:DMG: - [1666962226.211982][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962226.211987][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962226.211991][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 3 On TH(bridge-app) Log: + + [1666962181.272370][218195:218195] CHIP:IM: Received Read request + [1666962181.272431][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962181.272451][218195:218195] CHIP:DMG: { + [1666962181.272466][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962181.272482][218195:218195] CHIP:DMG: [ + [1666962181.272497][218195:218195] CHIP:DMG: AttributePathIB = + [1666962181.272515][218195:218195] CHIP:DMG: { + [1666962181.272532][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666962181.272548][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962181.272565][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962181.272581][218195:218195] CHIP:DMG: } + [1666962181.272599][218195:218195] CHIP:DMG: + [1666962181.272614][218195:218195] CHIP:DMG: ], + [1666962181.272633][218195:218195] CHIP:DMG: + [1666962181.272649][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962181.272665][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962181.272679][218195:218195] CHIP:DMG: }, + [1666962181.272736][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962181.272791][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962181.272810][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962181.272825][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=3 AttributeId=0x0000_0003 (expanded=0) + [1666962181.272846][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=3 p=v + [1666962181.272869][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962181.272906][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962181.273115][218195:218195] CHIP:EM: <<< [E:46913r M:111572064 (Ack:187764321)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962181.273146][218195:218195] CHIP:IN: (S) Sending msg 111572064 on secure session with LSID: 51716 + [1666962181.273415][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36413 | 111572064 | [Interaction Model (1) / Report Data (0x05) / Session = 7119 / Exchange = 46913] + [1666962181.273447][218195:218195] CHIP:DMG: Header Flags = + [1666962181.273465][218195:218195] CHIP:DMG: { + [1666962181.273492][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962181.273507][218195:218195] CHIP:DMG: { + [1666962181.273523][218195:218195] CHIP:DMG: AckMsg = 187764321 + [1666962181.273536][218195:218195] CHIP:DMG: NeedsAck = true + [1666962181.273550][218195:218195] CHIP:DMG: } + [1666962181.273572][218195:218195] CHIP:DMG: } + [1666962181.273585][218195:218195] CHIP:DMG: + [1666962181.273605][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962181.273619][218195:218195] CHIP:DMG: { + [1666962181.273633][218195:218195] CHIP:DMG: data = 00cf1b006074a606d86a9f1f8d1116587d199c334287a090de625e1267cae0122cf9bb9514247ab1b27ca9ec853fc523ff013060a7845eaf1b9fc336790bc3d8e2e7bf06a5fc + [1666962181.273649][218195:218195] CHIP:DMG: buffer_ptr = 94136416764416 + [1666962181.273663][218195:218195] CHIP:DMG: } + [1666962181.273676][218195:218195] CHIP:DMG: + [1666962181.273697][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962181.273717][218195:218195] CHIP:DMG: { + [1666962181.273738][218195:218195] CHIP:DMG: data = 1536011535012600378216b4370124020324031d24040318360218181818290424ff0118 + [1666962181.273753][218195:218195] CHIP:DMG: } + [1666962181.273766][218195:218195] CHIP:DMG: + [1666962181.273823][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962181.273840][218195:218195] CHIP:DMG: { + [1666962181.273851][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962181.273876][218195:218195] CHIP:DMG: [ + [1666962181.273891][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962181.273916][218195:218195] CHIP:DMG: { + [1666962181.273933][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962181.273954][218195:218195] CHIP:DMG: { + [1666962181.273972][218195:218195] CHIP:DMG: DataVersion = 0xb4168237, + [1666962181.273988][218195:218195] CHIP:DMG: AttributePathIB = + [1666962181.274005][218195:218195] CHIP:DMG: { + [1666962181.274022][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666962181.274041][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962181.274062][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962181.274082][218195:218195] CHIP:DMG: } + [1666962181.274102][218195:218195] CHIP:DMG: + [1666962181.274124][218195:218195] CHIP:DMG: Data = [ + [1666962181.274145][218195:218195] CHIP:DMG: + [1666962181.274165][218195:218195] CHIP:DMG: ], + [1666962181.274182][218195:218195] CHIP:DMG: }, + [1666962181.274206][218195:218195] CHIP:DMG: + [1666962181.274224][218195:218195] CHIP:DMG: }, + [1666962181.274248][218195:218195] CHIP:DMG: + [1666962181.274266][218195:218195] CHIP:DMG: ], + [1666962181.274288][218195:218195] CHIP:DMG: + [1666962181.274303][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962181.274318][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962181.274337][218195:218195] CHIP:DMG: } + [1666962181.274354][218195:218195] CHIP:DMG: + + ./chip-tool descriptor read parts-list 1 4 + + Verify the PartList attribute response with endpoint 4 On TH(bridge-app) Log: + + [1666962226.211067][218195:218195] CHIP:IM: Received Read request + [1666962226.211160][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962226.211169][218195:218195] CHIP:DMG: { + [1666962226.211175][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962226.211183][218195:218195] CHIP:DMG: [ + [1666962226.211190][218195:218195] CHIP:DMG: AttributePathIB = + [1666962226.211200][218195:218195] CHIP:DMG: { + [1666962226.211209][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666962226.211218][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962226.211227][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962226.211235][218195:218195] CHIP:DMG: } + [1666962226.211245][218195:218195] CHIP:DMG: + [1666962226.211253][218195:218195] CHIP:DMG: ], + [1666962226.211263][218195:218195] CHIP:DMG: + [1666962226.211272][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962226.211280][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962226.211288][218195:218195] CHIP:DMG: }, + [1666962226.211319][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962226.211353][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962226.211363][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962226.211370][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=4 AttributeId=0x0000_0003 (expanded=0) + [1666962226.211382][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=4 p=v + [1666962226.211396][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962226.211419][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962226.211532][218195:218195] CHIP:EM: <<< [E:32390r M:201985649 (Ack:262416764)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962226.211551][218195:218195] CHIP:IN: (S) Sending msg 201985649 on secure session with LSID: 51717 + [1666962226.211699][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:55096 | 201985649 | [Interaction Model (1) / Report Data (0x05) / Session = 41621 / Exchange = 32390] + [1666962226.211711][218195:218195] CHIP:DMG: Header Flags = + [1666962226.211715][218195:218195] CHIP:DMG: { + [1666962226.211726][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962226.211731][218195:218195] CHIP:DMG: { + [1666962226.211736][218195:218195] CHIP:DMG: AckMsg = 262416764 + [1666962226.211741][218195:218195] CHIP:DMG: NeedsAck = true + [1666962226.211745][218195:218195] CHIP:DMG: } + [1666962226.211753][218195:218195] CHIP:DMG: } + [1666962226.211758][218195:218195] CHIP:DMG: + [1666962226.211764][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962226.211769][218195:218195] CHIP:DMG: { + [1666962226.211773][218195:218195] CHIP:DMG: data = 0095a200710e0a0c886c3b3bdc1e7f2be7778df8c8dda3541891bd0743b7a912e9ccfd60902082784e8e2247f9d2628f782007da5ae8eab65680617b41888803918f2bcd05b6 + [1666962226.211778][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962226.211783][218195:218195] CHIP:DMG: } + [1666962226.211787][218195:218195] CHIP:DMG: + [1666962226.211795][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962226.211799][218195:218195] CHIP:DMG: { + [1666962226.211804][218195:218195] CHIP:DMG: data = 1536011535012600c90e9a3a370124020424031d24040318360218181818290424ff0118 + [1666962226.211809][218195:218195] CHIP:DMG: } + [1666962226.211813][218195:218195] CHIP:DMG: + [1666962226.211835][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962226.211840][218195:218195] CHIP:DMG: { + [1666962226.211844][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962226.211852][218195:218195] CHIP:DMG: [ + [1666962226.211857][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962226.211865][218195:218195] CHIP:DMG: { + [1666962226.211870][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962226.211875][218195:218195] CHIP:DMG: { + [1666962226.211881][218195:218195] CHIP:DMG: DataVersion = 0x3a9a0ec9, + [1666962226.211887][218195:218195] CHIP:DMG: AttributePathIB = + [1666962226.211892][218195:218195] CHIP:DMG: { + [1666962226.211898][218195:218195] CHIP:DMG: Endpoint = 0x4, + [1666962226.211904][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962226.211911][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962226.211916][218195:218195] CHIP:DMG: } + [1666962226.211923][218195:218195] CHIP:DMG: + [1666962226.211928][218195:218195] CHIP:DMG: Data = [ + [1666962226.211934][218195:218195] CHIP:DMG: + [1666962226.211940][218195:218195] CHIP:DMG: ], + [1666962226.211945][218195:218195] CHIP:DMG: }, + [1666962226.211952][218195:218195] CHIP:DMG: + [1666962226.211957][218195:218195] CHIP:DMG: }, + [1666962226.211965][218195:218195] CHIP:DMG: + [1666962226.211969][218195:218195] CHIP:DMG: ], + [1666962226.211977][218195:218195] CHIP:DMG: + [1666962226.211982][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962226.211987][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962226.211991][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 5 - Verify the PartList attribute response with endpoint 5 On TH(bridge-app) Log: - - [1666962275.528464][218195:218195] CHIP:IM: Received Read request - [1666962275.528514][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962275.528527][218195:218195] CHIP:DMG: { - [1666962275.528536][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962275.528547][218195:218195] CHIP:DMG: [ - [1666962275.528557][218195:218195] CHIP:DMG: AttributePathIB = - [1666962275.528568][218195:218195] CHIP:DMG: { - [1666962275.528580][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666962275.528591][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962275.528604][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962275.528614][218195:218195] CHIP:DMG: } - [1666962275.528625][218195:218195] CHIP:DMG: - [1666962275.528637][218195:218195] CHIP:DMG: ], - [1666962275.528652][218195:218195] CHIP:DMG: - [1666962275.528665][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962275.528675][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962275.528683][218195:218195] CHIP:DMG: }, - [1666962275.528730][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962275.528771][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962275.528783][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962275.528791][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0003 (expanded=0) - [1666962275.528805][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v - [1666962275.528820][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962275.528846][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962275.529045][218195:218195] CHIP:EM: <<< [E:33089r M:54656360 (Ack:218406525)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962275.529066][218195:218195] CHIP:IN: (S) Sending msg 54656360 on secure session with LSID: 51718 - [1666962275.529319][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:34329 | 54656360 | [Interaction Model (1) / Report Data (0x05) / Session = 205 / Exchange = 33089] - [1666962275.529340][218195:218195] CHIP:DMG: Header Flags = - [1666962275.529349][218195:218195] CHIP:DMG: { - [1666962275.529370][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962275.529379][218195:218195] CHIP:DMG: { - [1666962275.532995][218195:218195] CHIP:DMG: AckMsg = 218406525 - [1666962275.533014][218195:218195] CHIP:DMG: NeedsAck = true - [1666962275.533023][218195:218195] CHIP:DMG: } - [1666962275.533047][218195:218195] CHIP:DMG: } - [1666962275.533056][218195:218195] CHIP:DMG: - [1666962275.533073][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962275.533082][218195:218195] CHIP:DMG: { - [1666962275.533090][218195:218195] CHIP:DMG: data = 00cd000068fd410349555f503cf1e95a3d4dafa36db2330c402e42095fba00ed65fc64eb115fac620bf21eba932216766b550ab7bef78b62415b002c885297c361daf085daa7 - [1666962275.533100][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962275.533108][218195:218195] CHIP:DMG: } - [1666962275.533116][218195:218195] CHIP:DMG: - [1666962275.533132][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962275.533141][218195:218195] CHIP:DMG: { - [1666962275.533149][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d24040318360218181818290424ff0118 - [1666962275.533158][218195:218195] CHIP:DMG: } - [1666962275.533167][218195:218195] CHIP:DMG: - [1666962275.533215][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962275.533228][218195:218195] CHIP:DMG: { - [1666962275.533236][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962275.533252][218195:218195] CHIP:DMG: [ - [1666962275.533262][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962275.533277][218195:218195] CHIP:DMG: { - [1666962275.533288][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962275.533299][218195:218195] CHIP:DMG: { - [1666962275.533312][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, - [1666962275.533323][218195:218195] CHIP:DMG: AttributePathIB = - [1666962275.533335][218195:218195] CHIP:DMG: { - [1666962275.533348][218195:218195] CHIP:DMG: Endpoint = 0x5, - [1666962275.533361][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962275.533375][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962275.533387][218195:218195] CHIP:DMG: } - [1666962275.533400][218195:218195] CHIP:DMG: - [1666962275.533412][218195:218195] CHIP:DMG: Data = [ - [1666962275.533424][218195:218195] CHIP:DMG: - [1666962275.533436][218195:218195] CHIP:DMG: ], - [1666962275.533447][218195:218195] CHIP:DMG: }, - [1666962275.533462][218195:218195] CHIP:DMG: - [1666962275.533472][218195:218195] CHIP:DMG: }, - [1666962275.533487][218195:218195] CHIP:DMG: - [1666962275.533496][218195:218195] CHIP:DMG: ], - [1666962275.533512][218195:218195] CHIP:DMG: - [1666962275.533523][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962275.533534][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962275.533543][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 5 On TH(bridge-app) Log: + + [1666962275.528464][218195:218195] CHIP:IM: Received Read request + [1666962275.528514][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962275.528527][218195:218195] CHIP:DMG: { + [1666962275.528536][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962275.528547][218195:218195] CHIP:DMG: [ + [1666962275.528557][218195:218195] CHIP:DMG: AttributePathIB = + [1666962275.528568][218195:218195] CHIP:DMG: { + [1666962275.528580][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666962275.528591][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962275.528604][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962275.528614][218195:218195] CHIP:DMG: } + [1666962275.528625][218195:218195] CHIP:DMG: + [1666962275.528637][218195:218195] CHIP:DMG: ], + [1666962275.528652][218195:218195] CHIP:DMG: + [1666962275.528665][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962275.528675][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962275.528683][218195:218195] CHIP:DMG: }, + [1666962275.528730][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962275.528771][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962275.528783][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962275.528791][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=5 AttributeId=0x0000_0003 (expanded=0) + [1666962275.528805][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=5 p=v + [1666962275.528820][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962275.528846][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962275.529045][218195:218195] CHIP:EM: <<< [E:33089r M:54656360 (Ack:218406525)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962275.529066][218195:218195] CHIP:IN: (S) Sending msg 54656360 on secure session with LSID: 51718 + [1666962275.529319][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:34329 | 54656360 | [Interaction Model (1) / Report Data (0x05) / Session = 205 / Exchange = 33089] + [1666962275.529340][218195:218195] CHIP:DMG: Header Flags = + [1666962275.529349][218195:218195] CHIP:DMG: { + [1666962275.529370][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962275.529379][218195:218195] CHIP:DMG: { + [1666962275.532995][218195:218195] CHIP:DMG: AckMsg = 218406525 + [1666962275.533014][218195:218195] CHIP:DMG: NeedsAck = true + [1666962275.533023][218195:218195] CHIP:DMG: } + [1666962275.533047][218195:218195] CHIP:DMG: } + [1666962275.533056][218195:218195] CHIP:DMG: + [1666962275.533073][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962275.533082][218195:218195] CHIP:DMG: { + [1666962275.533090][218195:218195] CHIP:DMG: data = 00cd000068fd410349555f503cf1e95a3d4dafa36db2330c402e42095fba00ed65fc64eb115fac620bf21eba932216766b550ab7bef78b62415b002c885297c361daf085daa7 + [1666962275.533100][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962275.533108][218195:218195] CHIP:DMG: } + [1666962275.533116][218195:218195] CHIP:DMG: + [1666962275.533132][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962275.533141][218195:218195] CHIP:DMG: { + [1666962275.533149][218195:218195] CHIP:DMG: data = 1536011535012600dc5a8687370124020524031d24040318360218181818290424ff0118 + [1666962275.533158][218195:218195] CHIP:DMG: } + [1666962275.533167][218195:218195] CHIP:DMG: + [1666962275.533215][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962275.533228][218195:218195] CHIP:DMG: { + [1666962275.533236][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962275.533252][218195:218195] CHIP:DMG: [ + [1666962275.533262][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962275.533277][218195:218195] CHIP:DMG: { + [1666962275.533288][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962275.533299][218195:218195] CHIP:DMG: { + [1666962275.533312][218195:218195] CHIP:DMG: DataVersion = 0x87865adc, + [1666962275.533323][218195:218195] CHIP:DMG: AttributePathIB = + [1666962275.533335][218195:218195] CHIP:DMG: { + [1666962275.533348][218195:218195] CHIP:DMG: Endpoint = 0x5, + [1666962275.533361][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962275.533375][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962275.533387][218195:218195] CHIP:DMG: } + [1666962275.533400][218195:218195] CHIP:DMG: + [1666962275.533412][218195:218195] CHIP:DMG: Data = [ + [1666962275.533424][218195:218195] CHIP:DMG: + [1666962275.533436][218195:218195] CHIP:DMG: ], + [1666962275.533447][218195:218195] CHIP:DMG: }, + [1666962275.533462][218195:218195] CHIP:DMG: + [1666962275.533472][218195:218195] CHIP:DMG: }, + [1666962275.533487][218195:218195] CHIP:DMG: + [1666962275.533496][218195:218195] CHIP:DMG: ], + [1666962275.533512][218195:218195] CHIP:DMG: + [1666962275.533523][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962275.533534][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962275.533543][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 6 - Verify the PartList attribute response with endpoint 6 On TH(bridge-app) Log: - - [1666962322.069585][218195:218195] CHIP:IM: Received Read request - [1666962322.069620][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962322.069628][218195:218195] CHIP:DMG: { - [1666962322.069635][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962322.069643][218195:218195] CHIP:DMG: [ - [1666962322.069651][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.069660][218195:218195] CHIP:DMG: { - [1666962322.069669][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.069678][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.069688][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.069698][218195:218195] CHIP:DMG: } - [1666962322.069707][218195:218195] CHIP:DMG: - [1666962322.069717][218195:218195] CHIP:DMG: ], - [1666962322.069727][218195:218195] CHIP:DMG: - [1666962322.069735][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962322.069744][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962322.069751][218195:218195] CHIP:DMG: }, - [1666962322.069784][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962322.069810][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962322.069820][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962322.069828][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0003 (expanded=0) - [1666962322.069839][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v - [1666962322.069852][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962322.069881][218195:218195] CHIP:DMG: Sending report (payload has 120 bytes)... - [1666962322.069997][218195:218195] CHIP:EM: <<< [E:61474r M:198673228 (Ack:1527385)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962322.070010][218195:218195] CHIP:IN: (S) Sending msg 198673228 on secure session with LSID: 51719 - [1666962322.070186][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:47795 | 198673228 | [Interaction Model (1) / Report Data (0x05) / Session = 26100 / Exchange = 61474] - [1666962322.070201][218195:218195] CHIP:DMG: Header Flags = - [1666962322.070208][218195:218195] CHIP:DMG: { - [1666962322.070223][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962322.070231][218195:218195] CHIP:DMG: { - [1666962322.070240][218195:218195] CHIP:DMG: AckMsg = 1527385 - [1666962322.070247][218195:218195] CHIP:DMG: NeedsAck = true - [1666962322.070254][218195:218195] CHIP:DMG: } - [1666962322.070267][218195:218195] CHIP:DMG: } - [1666962322.070274][218195:218195] CHIP:DMG: - [1666962322.070285][218195:218195] CHIP:DMG: Encrypted Payload (154 bytes) = - [1666962322.070293][218195:218195] CHIP:DMG: { - [1666962322.070300][218195:218195] CHIP:DMG: data = 00f465004c83d70b8dd5f204c35c1301ed6422583364d49a1257668127b3f4c329e30af47ff9d53cb04aee346c538e1422ce52597d607bc680895af69b21d8fb926cb371afed3907237b74939d013e10d528c7297b933b31b6ab2bb341b32e38a0abe30861d527ac5296ac0a0abd024b6490b3ff32cdaa311158c3f0289fa40db5d8cdea27a5da94e3258328151acdfcbc97f8a2a90d5b1d71b5 - [1666962322.070311][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962322.070319][218195:218195] CHIP:DMG: } - [1666962322.070326][218195:218195] CHIP:DMG: - [1666962322.070340][218195:218195] CHIP:DMG: Decrypted Payload (120 bytes) = - [1666962322.070347][218195:218195] CHIP:DMG: { - [1666962322.070355][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040318360218181815350126004d2fac6c370124020624031d240403340518240207181815350126004d2fac6c370124020624031d240403340518240208181815350126004d2fac6c370124020624031d240403340518240209181818290424ff0118 - [1666962322.070364][218195:218195] CHIP:DMG: } - [1666962322.070371][218195:218195] CHIP:DMG: - [1666962322.070419][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962322.070425][218195:218195] CHIP:DMG: { - [1666962322.070433][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962322.070444][218195:218195] CHIP:DMG: [ - [1666962322.070451][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.070465][218195:218195] CHIP:DMG: { - [1666962322.070473][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.070484][218195:218195] CHIP:DMG: { - [1666962322.070493][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.070504][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.070514][218195:218195] CHIP:DMG: { - [1666962322.070525][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.070536][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.070547][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.070557][218195:218195] CHIP:DMG: } - [1666962322.070569][218195:218195] CHIP:DMG: - [1666962322.070579][218195:218195] CHIP:DMG: Data = [ - [1666962322.070590][218195:218195] CHIP:DMG: - [1666962322.070602][218195:218195] CHIP:DMG: ], - [1666962322.070612][218195:218195] CHIP:DMG: }, - [1666962322.070624][218195:218195] CHIP:DMG: - [1666962322.070632][218195:218195] CHIP:DMG: }, - [1666962322.070649][218195:218195] CHIP:DMG: - [1666962322.070656][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.070668][218195:218195] CHIP:DMG: { - [1666962322.070676][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.070686][218195:218195] CHIP:DMG: { - [1666962322.070696][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.070707][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.070717][218195:218195] CHIP:DMG: { - [1666962322.070726][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.070737][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.070749][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.070759][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962322.070769][218195:218195] CHIP:DMG: } - [1666962322.070781][218195:218195] CHIP:DMG: - [1666962322.070792][218195:218195] CHIP:DMG: Data = 7, - [1666962322.070803][218195:218195] CHIP:DMG: }, - [1666962322.070815][218195:218195] CHIP:DMG: - [1666962322.070823][218195:218195] CHIP:DMG: }, - [1666962322.070839][218195:218195] CHIP:DMG: - [1666962322.070847][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.070860][218195:218195] CHIP:DMG: { - [1666962322.070869][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.070878][218195:218195] CHIP:DMG: { - [1666962322.070887][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.070898][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.070908][218195:218195] CHIP:DMG: { - [1666962322.070919][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.070929][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.070942][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.070952][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962322.070962][218195:218195] CHIP:DMG: } - [1666962322.070974][218195:218195] CHIP:DMG: - [1666962322.070985][218195:218195] CHIP:DMG: Data = 8, - [1666962322.070996][218195:218195] CHIP:DMG: }, - [1666962322.071008][218195:218195] CHIP:DMG: - [1666962322.071016][218195:218195] CHIP:DMG: }, - [1666962322.071032][218195:218195] CHIP:DMG: - [1666962322.071040][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962322.071053][218195:218195] CHIP:DMG: { - [1666962322.071059][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962322.071067][218195:218195] CHIP:DMG: { - [1666962322.071073][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, - [1666962322.071081][218195:218195] CHIP:DMG: AttributePathIB = - [1666962322.071104][218195:218195] CHIP:DMG: { - [1666962322.071123][218195:218195] CHIP:DMG: Endpoint = 0x6, - [1666962322.071131][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962322.071139][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962322.071150][218195:218195] CHIP:DMG: ListIndex = Null, - [1666962322.071158][218195:218195] CHIP:DMG: } - [1666962322.071167][218195:218195] CHIP:DMG: - [1666962322.071175][218195:218195] CHIP:DMG: Data = 9, - [1666962322.071182][218195:218195] CHIP:DMG: }, - [1666962322.071191][218195:218195] CHIP:DMG: - [1666962322.071197][218195:218195] CHIP:DMG: }, - [1666962322.071206][218195:218195] CHIP:DMG: - [1666962322.071212][218195:218195] CHIP:DMG: ], - [1666962322.071229][218195:218195] CHIP:DMG: - [1666962322.071236][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962322.071242][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962322.071248][218195:218195] CHIP:DMG: } - [1666962322.071254][218195:218195] CHIP:DMG: + Verify the PartList attribute response with endpoint 6 On TH(bridge-app) Log: + + [1666962322.069585][218195:218195] CHIP:IM: Received Read request + [1666962322.069620][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962322.069628][218195:218195] CHIP:DMG: { + [1666962322.069635][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962322.069643][218195:218195] CHIP:DMG: [ + [1666962322.069651][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.069660][218195:218195] CHIP:DMG: { + [1666962322.069669][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.069678][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.069688][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.069698][218195:218195] CHIP:DMG: } + [1666962322.069707][218195:218195] CHIP:DMG: + [1666962322.069717][218195:218195] CHIP:DMG: ], + [1666962322.069727][218195:218195] CHIP:DMG: + [1666962322.069735][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962322.069744][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962322.069751][218195:218195] CHIP:DMG: }, + [1666962322.069784][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962322.069810][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962322.069820][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962322.069828][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=6 AttributeId=0x0000_0003 (expanded=0) + [1666962322.069839][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=6 p=v + [1666962322.069852][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962322.069881][218195:218195] CHIP:DMG: Sending report (payload has 120 bytes)... + [1666962322.069997][218195:218195] CHIP:EM: <<< [E:61474r M:198673228 (Ack:1527385)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962322.070010][218195:218195] CHIP:IN: (S) Sending msg 198673228 on secure session with LSID: 51719 + [1666962322.070186][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:47795 | 198673228 | [Interaction Model (1) / Report Data (0x05) / Session = 26100 / Exchange = 61474] + [1666962322.070201][218195:218195] CHIP:DMG: Header Flags = + [1666962322.070208][218195:218195] CHIP:DMG: { + [1666962322.070223][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962322.070231][218195:218195] CHIP:DMG: { + [1666962322.070240][218195:218195] CHIP:DMG: AckMsg = 1527385 + [1666962322.070247][218195:218195] CHIP:DMG: NeedsAck = true + [1666962322.070254][218195:218195] CHIP:DMG: } + [1666962322.070267][218195:218195] CHIP:DMG: } + [1666962322.070274][218195:218195] CHIP:DMG: + [1666962322.070285][218195:218195] CHIP:DMG: Encrypted Payload (154 bytes) = + [1666962322.070293][218195:218195] CHIP:DMG: { + [1666962322.070300][218195:218195] CHIP:DMG: data = 00f465004c83d70b8dd5f204c35c1301ed6422583364d49a1257668127b3f4c329e30af47ff9d53cb04aee346c538e1422ce52597d607bc680895af69b21d8fb926cb371afed3907237b74939d013e10d528c7297b933b31b6ab2bb341b32e38a0abe30861d527ac5296ac0a0abd024b6490b3ff32cdaa311158c3f0289fa40db5d8cdea27a5da94e3258328151acdfcbc97f8a2a90d5b1d71b5 + [1666962322.070311][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962322.070319][218195:218195] CHIP:DMG: } + [1666962322.070326][218195:218195] CHIP:DMG: + [1666962322.070340][218195:218195] CHIP:DMG: Decrypted Payload (120 bytes) = + [1666962322.070347][218195:218195] CHIP:DMG: { + [1666962322.070355][218195:218195] CHIP:DMG: data = 15360115350126004d2fac6c370124020624031d24040318360218181815350126004d2fac6c370124020624031d240403340518240207181815350126004d2fac6c370124020624031d240403340518240208181815350126004d2fac6c370124020624031d240403340518240209181818290424ff0118 + [1666962322.070364][218195:218195] CHIP:DMG: } + [1666962322.070371][218195:218195] CHIP:DMG: + [1666962322.070419][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962322.070425][218195:218195] CHIP:DMG: { + [1666962322.070433][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962322.070444][218195:218195] CHIP:DMG: [ + [1666962322.070451][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962322.070465][218195:218195] CHIP:DMG: { + [1666962322.070473][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962322.070484][218195:218195] CHIP:DMG: { + [1666962322.070493][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666962322.070504][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.070514][218195:218195] CHIP:DMG: { + [1666962322.070525][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.070536][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.070547][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.070557][218195:218195] CHIP:DMG: } + [1666962322.070569][218195:218195] CHIP:DMG: + [1666962322.070579][218195:218195] CHIP:DMG: Data = [ + [1666962322.070590][218195:218195] CHIP:DMG: + [1666962322.070602][218195:218195] CHIP:DMG: ], + [1666962322.070612][218195:218195] CHIP:DMG: }, + [1666962322.070624][218195:218195] CHIP:DMG: + [1666962322.070632][218195:218195] CHIP:DMG: }, + [1666962322.070649][218195:218195] CHIP:DMG: + [1666962322.070656][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962322.070668][218195:218195] CHIP:DMG: { + [1666962322.070676][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962322.070686][218195:218195] CHIP:DMG: { + [1666962322.070696][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666962322.070707][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.070717][218195:218195] CHIP:DMG: { + [1666962322.070726][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.070737][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.070749][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.070759][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962322.070769][218195:218195] CHIP:DMG: } + [1666962322.070781][218195:218195] CHIP:DMG: + [1666962322.070792][218195:218195] CHIP:DMG: Data = 7, + [1666962322.070803][218195:218195] CHIP:DMG: }, + [1666962322.070815][218195:218195] CHIP:DMG: + [1666962322.070823][218195:218195] CHIP:DMG: }, + [1666962322.070839][218195:218195] CHIP:DMG: + [1666962322.070847][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962322.070860][218195:218195] CHIP:DMG: { + [1666962322.070869][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962322.070878][218195:218195] CHIP:DMG: { + [1666962322.070887][218195:218195] CHIP:DMG: DataVersion = 0x6cac2f4d, + [1666962322.070898][218195:218195] CHIP:DMG: AttributePathIB = + [1666962322.070908][218195:218195] CHIP:DMG: { + [1666962322.070919][218195:218195] CHIP:DMG: Endpoint = 0x6, + [1666962322.070929][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962322.070942][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962322.070952][218195:218195] CHIP:DMG: ListIndex = Null, + [1666962322.070962][218195:218195] CHIP:DMG: } + [1666962322.070974][218195:218195] CHIP:DMG: + [1666962322.070985][218195:218195] CHIP:DMG: Data = 8, + [1666962322.071182][218195:218195] CHIP:DMG: }, + [1666962322.071191][218195:218195] CHIP:DMG: + [1666962322.071197][218195:218195] CHIP:DMG: }, + [1666962322.071206][218195:218195] CHIP:DMG: + [1666962322.071212][218195:218195] CHIP:DMG: ], + [1666962322.071229][218195:218195] CHIP:DMG: + [1666962322.071236][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962322.071242][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962322.071248][218195:218195] CHIP:DMG: } + [1666962322.071254][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 7 - Verify the PartList attribute response with endpoint 7 On TH(bridge-app) Log: - - [1666962362.557106][218195:218195] CHIP:IM: Received Read request - [1666962362.557147][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962362.557158][218195:218195] CHIP:DMG: { - [1666962362.557166][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962362.557177][218195:218195] CHIP:DMG: [ - [1666962362.557186][218195:218195] CHIP:DMG: AttributePathIB = - [1666962362.557196][218195:218195] CHIP:DMG: { - [1666962362.557206][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666962362.557217][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962362.557228][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962362.557237][218195:218195] CHIP:DMG: } - [1666962362.557249][218195:218195] CHIP:DMG: - [1666962362.557258][218195:218195] CHIP:DMG: ], - [1666962362.557269][218195:218195] CHIP:DMG: - [1666962362.557279][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962362.557289][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962362.557297][218195:218195] CHIP:DMG: }, - [1666962362.557335][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962362.557372][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962362.557385][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962362.557394][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0003 (expanded=0) - [1666962362.557407][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v - [1666962362.557421][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962362.557446][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962362.557583][218195:218195] CHIP:EM: <<< [E:12102r M:186746901 (Ack:224939109)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962362.557603][218195:218195] CHIP:IN: (S) Sending msg 186746901 on secure session with LSID: 51720 - [1666962362.557774][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45695 | 186746901 | [Interaction Model (1) / Report Data (0x05) / Session = 44401 / Exchange = 12102] - [1666962362.557794][218195:218195] CHIP:DMG: Header Flags = - [1666962362.557804][218195:218195] CHIP:DMG: { - [1666962362.557821][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962362.557830][218195:218195] CHIP:DMG: { - [1666962362.557840][218195:218195] CHIP:DMG: AckMsg = 224939109 - [1666962362.557849][218195:218195] CHIP:DMG: NeedsAck = true - [1666962362.557858][218195:218195] CHIP:DMG: } - [1666962362.557871][218195:218195] CHIP:DMG: } - [1666962362.557879][218195:218195] CHIP:DMG: - [1666962362.557892][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962362.557900][218195:218195] CHIP:DMG: { - [1666962362.557909][218195:218195] CHIP:DMG: data = 0071ad001588210b02370802970509c2ed65336ec135d9e4705a5485be6d348078f88c0b68cc9b52190f938ddae1ebe842531c0f341e7ed9ebb36297cf2f4e55365f639b4428 - [1666962362.557918][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962362.557927][218195:218195] CHIP:DMG: } - [1666962362.557935][218195:218195] CHIP:DMG: - [1666962362.557949][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962362.557957][218195:218195] CHIP:DMG: { - [1666962362.557966][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d24040318360218181818290424ff0118 - [1666962362.557975][218195:218195] CHIP:DMG: } - [1666962362.557983][218195:218195] CHIP:DMG: - [1666962362.558017][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962362.558029][218195:218195] CHIP:DMG: { - [1666962362.558038][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962362.558051][218195:218195] CHIP:DMG: [ - [1666962362.558061][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962362.558075][218195:218195] CHIP:DMG: { - [1666962362.558085][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962362.558095][218195:218195] CHIP:DMG: { - [1666962362.558106][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, - [1666962362.558116][218195:218195] CHIP:DMG: AttributePathIB = - [1666962362.558127][218195:218195] CHIP:DMG: { - [1666962362.558138][218195:218195] CHIP:DMG: Endpoint = 0x7, - [1666962362.558153][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962362.558167][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962362.558180][218195:218195] CHIP:DMG: } - [1666962362.558192][218195:218195] CHIP:DMG: - [1666962362.558203][218195:218195] CHIP:DMG: Data = [ - [1666962362.558214][218195:218195] CHIP:DMG: - [1666962362.558226][218195:218195] CHIP:DMG: ], - [1666962362.558235][218195:218195] CHIP:DMG: }, - [1666962362.558248][218195:218195] CHIP:DMG: - [1666962362.558257][218195:218195] CHIP:DMG: }, - [1666962362.558271][218195:218195] CHIP:DMG: - [1666962362.558279][218195:218195] CHIP:DMG: ], - [1666962362.558293][218195:218195] CHIP:DMG: - [1666962362.558303][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962362.558313][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962362.558321][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 7 On TH(bridge-app) Log: + + [1666962362.557106][218195:218195] CHIP:IM: Received Read request + [1666962362.557147][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962362.557158][218195:218195] CHIP:DMG: { + [1666962362.557166][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962362.557177][218195:218195] CHIP:DMG: [ + [1666962362.557186][218195:218195] CHIP:DMG: AttributePathIB = + [1666962362.557196][218195:218195] CHIP:DMG: { + [1666962362.557206][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666962362.557217][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962362.557228][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962362.557237][218195:218195] CHIP:DMG: } + [1666962362.557249][218195:218195] CHIP:DMG: + [1666962362.557258][218195:218195] CHIP:DMG: ], + [1666962362.557269][218195:218195] CHIP:DMG: + [1666962362.557279][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962362.557289][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962362.557297][218195:218195] CHIP:DMG: }, + [1666962362.557335][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962362.557372][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962362.557385][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962362.557394][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=7 AttributeId=0x0000_0003 (expanded=0) + [1666962362.557407][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=7 p=v + [1666962362.557421][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962362.557446][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962362.557583][218195:218195] CHIP:EM: <<< [E:12102r M:186746901 (Ack:224939109)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962362.557603][218195:218195] CHIP:IN: (S) Sending msg 186746901 on secure session with LSID: 51720 + [1666962362.557774][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45695 | 186746901 | [Interaction Model (1) / Report Data (0x05) / Session = 44401 / Exchange = 12102] + [1666962362.557794][218195:218195] CHIP:DMG: Header Flags = + [1666962362.557804][218195:218195] CHIP:DMG: { + [1666962362.557821][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962362.557830][218195:218195] CHIP:DMG: { + [1666962362.557840][218195:218195] CHIP:DMG: AckMsg = 224939109 + [1666962362.557849][218195:218195] CHIP:DMG: NeedsAck = true + [1666962362.557858][218195:218195] CHIP:DMG: } + [1666962362.557871][218195:218195] CHIP:DMG: } + [1666962362.557879][218195:218195] CHIP:DMG: + [1666962362.557892][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962362.557900][218195:218195] CHIP:DMG: { + [1666962362.557909][218195:218195] CHIP:DMG: data = 0071ad001588210b02370802970509c2ed65336ec135d9e4705a5485be6d348078f88c0b68cc9b52190f938ddae1ebe842531c0f341e7ed9ebb36297cf2f4e55365f639b4428 + [1666962362.557918][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962362.557927][218195:218195] CHIP:DMG: } + [1666962362.557935][218195:218195] CHIP:DMG: + [1666962362.557949][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962362.557957][218195:218195] CHIP:DMG: { + [1666962362.557966][218195:218195] CHIP:DMG: data = 1536011535012600740734f6370124020724031d24040318360218181818290424ff0118 + [1666962362.557975][218195:218195] CHIP:DMG: } + [1666962362.557983][218195:218195] CHIP:DMG: + [1666962362.558017][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962362.558029][218195:218195] CHIP:DMG: { + [1666962362.558038][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962362.558051][218195:218195] CHIP:DMG: [ + [1666962362.558061][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962362.558075][218195:218195] CHIP:DMG: { + [1666962362.558085][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962362.558095][218195:218195] CHIP:DMG: { + [1666962362.558106][218195:218195] CHIP:DMG: DataVersion = 0xf6340774, + [1666962362.558116][218195:218195] CHIP:DMG: AttributePathIB = + [1666962362.558127][218195:218195] CHIP:DMG: { + [1666962362.558138][218195:218195] CHIP:DMG: Endpoint = 0x7, + [1666962362.558153][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962362.558167][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962362.558180][218195:218195] CHIP:DMG: } + [1666962362.558192][218195:218195] CHIP:DMG: + [1666962362.558203][218195:218195] CHIP:DMG: Data = [ + [1666962362.558214][218195:218195] CHIP:DMG: + [1666962362.558226][218195:218195] CHIP:DMG: ], + [1666962362.558235][218195:218195] CHIP:DMG: }, + [1666962362.558248][218195:218195] CHIP:DMG: + [1666962362.558257][218195:218195] CHIP:DMG: }, + [1666962362.558271][218195:218195] CHIP:DMG: + [1666962362.558279][218195:218195] CHIP:DMG: ], + [1666962362.558293][218195:218195] CHIP:DMG: + [1666962362.558303][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962362.558313][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962362.558321][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 8 - Verify the PartList attribute response with endpoint 8 On TH(bridge-app) Log: - - [1666962423.861269][218195:218195] CHIP:IM: Received Read request - [1666962423.861296][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962423.861303][218195:218195] CHIP:DMG: { - [1666962423.861310][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962423.861318][218195:218195] CHIP:DMG: [ - [1666962423.861324][218195:218195] CHIP:DMG: AttributePathIB = - [1666962423.861331][218195:218195] CHIP:DMG: { - [1666962423.861338][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666962423.861346][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962423.861352][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962423.861358][218195:218195] CHIP:DMG: } - [1666962423.861365][218195:218195] CHIP:DMG: - [1666962423.861370][218195:218195] CHIP:DMG: ], - [1666962423.861378][218195:218195] CHIP:DMG: - [1666962423.861383][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962423.861389][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962423.861394][218195:218195] CHIP:DMG: }, - [1666962423.861419][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962423.861438][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962423.861445][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962423.861450][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0003 (expanded=0) - [1666962423.861460][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v - [1666962423.861471][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962423.861487][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962423.861589][218195:218195] CHIP:EM: <<< [E:44387r M:147068856 (Ack:205489082)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962423.861600][218195:218195] CHIP:IN: (S) Sending msg 147068856 on secure session with LSID: 51722 - [1666962423.861726][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:52860 | 147068856 | [Interaction Model (1) / Report Data (0x05) / Session = 56538 / Exchange = 44387] - [1666962423.861738][218195:218195] CHIP:DMG: Header Flags = - [1666962423.861743][218195:218195] CHIP:DMG: { - [1666962423.861755][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962423.861760][218195:218195] CHIP:DMG: { - [1666962423.861767][218195:218195] CHIP:DMG: AckMsg = 205489082 - [1666962423.861774][218195:218195] CHIP:DMG: NeedsAck = true - [1666962423.861781][218195:218195] CHIP:DMG: } - [1666962423.861791][218195:218195] CHIP:DMG: } - [1666962423.861797][218195:218195] CHIP:DMG: - [1666962423.861806][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962423.861811][218195:218195] CHIP:DMG: { - [1666962423.861816][218195:218195] CHIP:DMG: data = 00dadc00b817c4087f92461275319767af0cdd53b8d38e6560ac0d02db733ab6de1c8963cd37b2c093d3ad8da69006a9974bba741e9a5184dfe57f62f30d78a055a5ea64afc3 - [1666962423.861822][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962423.861827][218195:218195] CHIP:DMG: } - [1666962423.861832][218195:218195] CHIP:DMG: - [1666962423.861841][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962423.861846][218195:218195] CHIP:DMG: { - [1666962423.861851][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d24040318360218181818290424ff0118 - [1666962423.861857][218195:218195] CHIP:DMG: } - [1666962423.861862][218195:218195] CHIP:DMG: - [1666962423.861883][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962423.861889][218195:218195] CHIP:DMG: { - [1666962423.861893][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962423.861902][218195:218195] CHIP:DMG: [ - [1666962423.861907][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962423.861916][218195:218195] CHIP:DMG: { - [1666962423.861922][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962423.861928][218195:218195] CHIP:DMG: { - [1666962423.861935][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, - [1666962423.861941][218195:218195] CHIP:DMG: AttributePathIB = - [1666962423.861947][218195:218195] CHIP:DMG: { - [1666962423.861954][218195:218195] CHIP:DMG: Endpoint = 0x8, - [1666962423.861960][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962423.861967][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962423.861973][218195:218195] CHIP:DMG: } - [1666962423.861981][218195:218195] CHIP:DMG: - [1666962423.861987][218195:218195] CHIP:DMG: Data = [ - [1666962423.861994][218195:218195] CHIP:DMG: - [1666962423.862000][218195:218195] CHIP:DMG: ], - [1666962423.862006][218195:218195] CHIP:DMG: }, - [1666962423.862014][218195:218195] CHIP:DMG: - [1666962423.862020][218195:218195] CHIP:DMG: }, - [1666962423.862028][218195:218195] CHIP:DMG: - [1666962423.862033][218195:218195] CHIP:DMG: ], - [1666962423.862042][218195:218195] CHIP:DMG: - [1666962423.862047][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962423.862053][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962423.862058][218195:218195] CHIP:DMG: } - [1666962423.862063][218195:218195] CHIP:DMG: + Verify the PartList attribute response with endpoint 8 On TH(bridge-app) Log: + + [1666962423.861269][218195:218195] CHIP:IM: Received Read request + [1666962423.861296][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962423.861303][218195:218195] CHIP:DMG: { + [1666962423.861310][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962423.861318][218195:218195] CHIP:DMG: [ + [1666962423.861324][218195:218195] CHIP:DMG: AttributePathIB = + [1666962423.861331][218195:218195] CHIP:DMG: { + [1666962423.861338][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666962423.861346][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962423.861352][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962423.861358][218195:218195] CHIP:DMG: } + [1666962423.861365][218195:218195] CHIP:DMG: + [1666962423.861370][218195:218195] CHIP:DMG: ], + [1666962423.861378][218195:218195] CHIP:DMG: + [1666962423.861383][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962423.861389][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962423.861394][218195:218195] CHIP:DMG: }, + [1666962423.861419][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962423.861438][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962423.861445][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962423.861450][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=8 AttributeId=0x0000_0003 (expanded=0) + [1666962423.861460][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=8 p=v + [1666962423.861471][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962423.861487][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962423.861589][218195:218195] CHIP:EM: <<< [E:44387r M:147068856 (Ack:205489082)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962423.861600][218195:218195] CHIP:IN: (S) Sending msg 147068856 on secure session with LSID: 51722 + [1666962423.861726][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:52860 | 147068856 | [Interaction Model (1) / Report Data (0x05) / Session = 56538 / Exchange = 44387] + [1666962423.861738][218195:218195] CHIP:DMG: Header Flags = + [1666962423.861743][218195:218195] CHIP:DMG: { + [1666962423.861755][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962423.861760][218195:218195] CHIP:DMG: { + [1666962423.861767][218195:218195] CHIP:DMG: AckMsg = 205489082 + [1666962423.861774][218195:218195] CHIP:DMG: NeedsAck = true + [1666962423.861781][218195:218195] CHIP:DMG: } + [1666962423.861791][218195:218195] CHIP:DMG: } + [1666962423.861797][218195:218195] CHIP:DMG: + [1666962423.861806][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962423.861811][218195:218195] CHIP:DMG: { + [1666962423.861816][218195:218195] CHIP:DMG: data = 00dadc00b817c4087f92461275319767af0cdd53b8d38e6560ac0d02db733ab6de1c8963cd37b2c093d3ad8da69006a9974bba741e9a5184dfe57f62f30d78a055a5ea64afc3 + [1666962423.861822][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962423.861827][218195:218195] CHIP:DMG: } + [1666962423.861832][218195:218195] CHIP:DMG: + [1666962423.861841][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962423.861846][218195:218195] CHIP:DMG: { + [1666962423.861851][218195:218195] CHIP:DMG: data = 1536011535012600de39a0f6370124020824031d24040318360218181818290424ff0118 + [1666962423.861857][218195:218195] CHIP:DMG: } + [1666962423.861862][218195:218195] CHIP:DMG: + [1666962423.861883][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962423.861889][218195:218195] CHIP:DMG: { + [1666962423.861893][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962423.861902][218195:218195] CHIP:DMG: [ + [1666962423.861907][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962423.861916][218195:218195] CHIP:DMG: { + [1666962423.861922][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962423.861928][218195:218195] CHIP:DMG: { + [1666962423.861935][218195:218195] CHIP:DMG: DataVersion = 0xf6a039de, + [1666962423.861941][218195:218195] CHIP:DMG: AttributePathIB = + [1666962423.861947][218195:218195] CHIP:DMG: { + [1666962423.861954][218195:218195] CHIP:DMG: Endpoint = 0x8, + [1666962423.861960][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962423.861967][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962423.861973][218195:218195] CHIP:DMG: } + [1666962423.861981][218195:218195] CHIP:DMG: + [1666962423.861987][218195:218195] CHIP:DMG: Data = [ + [1666962423.861994][218195:218195] CHIP:DMG: + [1666962423.862000][218195:218195] CHIP:DMG: ], + [1666962423.862006][218195:218195] CHIP:DMG: }, + [1666962423.862014][218195:218195] CHIP:DMG: + [1666962423.862020][218195:218195] CHIP:DMG: }, + [1666962423.862028][218195:218195] CHIP:DMG: + [1666962423.862033][218195:218195] CHIP:DMG: ], + [1666962423.862042][218195:218195] CHIP:DMG: + [1666962423.862047][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962423.862053][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962423.862058][218195:218195] CHIP:DMG: } + [1666962423.862063][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 9 - Verify the PartList attribute response with endpoint 9 On TH(bridge-app) Log: - - [1666962496.027253][218195:218195] CHIP:IM: Received Read request - [1666962496.027291][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962496.027300][218195:218195] CHIP:DMG: { - [1666962496.027307][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962496.027315][218195:218195] CHIP:DMG: [ - [1666962496.027321][218195:218195] CHIP:DMG: AttributePathIB = - [1666962496.027330][218195:218195] CHIP:DMG: { - [1666962496.027338][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666962496.027347][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962496.027356][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962496.027364][218195:218195] CHIP:DMG: } - [1666962496.027373][218195:218195] CHIP:DMG: - [1666962496.027380][218195:218195] CHIP:DMG: ], - [1666962496.027390][218195:218195] CHIP:DMG: - [1666962496.027399][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962496.027406][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962496.027413][218195:218195] CHIP:DMG: }, - [1666962496.027449][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962496.027484][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962496.027494][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962496.027501][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0003 (expanded=0) - [1666962496.027514][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v - [1666962496.027527][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962496.027550][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962496.027706][218195:218195] CHIP:EM: <<< [E:8905r M:160325129 (Ack:28368292)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962496.027724][218195:218195] CHIP:IN: (S) Sending msg 160325129 on secure session with LSID: 51723 - [1666962496.027908][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33003 | 160325129 | [Interaction Model (1) / Report Data (0x05) / Session = 48426 / Exchange = 8905] - [1666962496.027927][218195:218195] CHIP:DMG: Header Flags = - [1666962496.027934][218195:218195] CHIP:DMG: { - [1666962496.027949][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962496.027956][218195:218195] CHIP:DMG: { - [1666962496.028073][218195:218195] CHIP:DMG: AckMsg = 28368292 - [1666962496.028082][218195:218195] CHIP:DMG: NeedsAck = true - [1666962496.028089][218195:218195] CHIP:DMG: } - [1666962496.028102][218195:218195] CHIP:DMG: } - [1666962496.028109][218195:218195] CHIP:DMG: - [1666962496.028120][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962496.028126][218195:218195] CHIP:DMG: { - [1666962496.028134][218195:218195] CHIP:DMG: data = 002abd00095e8e096c066e8e125a0d87cd379abecc3c6dcb3bd64285825f2bc01cdf3a255f4ba9a3ba34f70e8ec314f2df04872275a5807a4bf6ee1e8cdb94b31fe9f11ff31b - [1666962496.028142][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962496.028149][218195:218195] CHIP:DMG: } - [1666962496.028157][218195:218195] CHIP:DMG: - [1666962496.028171][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962496.028178][218195:218195] CHIP:DMG: { - [1666962496.028185][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040318360218181818290424ff0118 - [1666962496.028193][218195:218195] CHIP:DMG: } - [1666962496.028199][218195:218195] CHIP:DMG: - [1666962496.028235][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962496.028243][218195:218195] CHIP:DMG: { - [1666962496.028250][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962496.028262][218195:218195] CHIP:DMG: [ - [1666962496.028270][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962496.028285][218195:218195] CHIP:DMG: { - [1666962496.028293][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962496.028302][218195:218195] CHIP:DMG: { - [1666962496.028311][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, - [1666962496.028320][218195:218195] CHIP:DMG: AttributePathIB = - [1666962496.028331][218195:218195] CHIP:DMG: { - [1666962496.028344][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666962496.028354][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962496.028364][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962496.028373][218195:218195] CHIP:DMG: } - [1666962496.028384][218195:218195] CHIP:DMG: - [1666962496.028393][218195:218195] CHIP:DMG: Data = [ - [1666962496.028403][218195:218195] CHIP:DMG: - [1666962496.028412][218195:218195] CHIP:DMG: ], - [1666962496.028422][218195:218195] CHIP:DMG: }, - [1666962496.028434][218195:218195] CHIP:DMG: - [1666962496.028442][218195:218195] CHIP:DMG: }, - [1666962496.028454][218195:218195] CHIP:DMG: - [1666962496.028463][218195:218195] CHIP:DMG: ], - [1666962496.028475][218195:218195] CHIP:DMG: - [1666962496.028483][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962496.028491][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962496.028498][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 9 On TH(bridge-app) Log: + + [1666962496.027253][218195:218195] CHIP:IM: Received Read request + [1666962496.027291][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962496.027300][218195:218195] CHIP:DMG: { + [1666962496.027307][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962496.027315][218195:218195] CHIP:DMG: [ + [1666962496.027321][218195:218195] CHIP:DMG: AttributePathIB = + [1666962496.027330][218195:218195] CHIP:DMG: { + [1666962496.027338][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666962496.027347][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962496.027356][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962496.027364][218195:218195] CHIP:DMG: } + [1666962496.027373][218195:218195] CHIP:DMG: + [1666962496.027380][218195:218195] CHIP:DMG: ], + [1666962496.027390][218195:218195] CHIP:DMG: + [1666962496.027399][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962496.027406][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962496.027413][218195:218195] CHIP:DMG: }, + [1666962496.027449][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962496.027484][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962496.027494][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962496.027501][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=9 AttributeId=0x0000_0003 (expanded=0) + [1666962496.027514][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=9 p=v + [1666962496.027527][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962496.027550][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962496.027706][218195:218195] CHIP:EM: <<< [E:8905r M:160325129 (Ack:28368292)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962496.027724][218195:218195] CHIP:IN: (S) Sending msg 160325129 on secure session with LSID: 51723 + [1666962496.027908][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:33003 | 160325129 | [Interaction Model (1) / Report Data (0x05) / Session = 48426 / Exchange = 8905] + [1666962496.027927][218195:218195] CHIP:DMG: Header Flags = + [1666962496.027934][218195:218195] CHIP:DMG: { + [1666962496.027949][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962496.027956][218195:218195] CHIP:DMG: { + [1666962496.028073][218195:218195] CHIP:DMG: AckMsg = 28368292 + [1666962496.028082][218195:218195] CHIP:DMG: NeedsAck = true + [1666962496.028089][218195:218195] CHIP:DMG: } + [1666962496.028102][218195:218195] CHIP:DMG: } + [1666962496.028109][218195:218195] CHIP:DMG: + [1666962496.028120][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962496.028126][218195:218195] CHIP:DMG: { + [1666962496.028134][218195:218195] CHIP:DMG: data = 002abd00095e8e096c066e8e125a0d87cd379abecc3c6dcb3bd64285825f2bc01cdf3a255f4ba9a3ba34f70e8ec314f2df04872275a5807a4bf6ee1e8cdb94b31fe9f11ff31b + [1666962496.028142][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962496.028149][218195:218195] CHIP:DMG: } + [1666962496.028157][218195:218195] CHIP:DMG: + [1666962496.028171][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962496.028178][218195:218195] CHIP:DMG: { + [1666962496.028185][218195:218195] CHIP:DMG: data = 15360115350126005ebab630370124020924031d24040318360218181818290424ff0118 + [1666962496.028193][218195:218195] CHIP:DMG: } + [1666962496.028199][218195:218195] CHIP:DMG: + [1666962496.028235][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962496.028243][218195:218195] CHIP:DMG: { + [1666962496.028250][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962496.028262][218195:218195] CHIP:DMG: [ + [1666962496.028270][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962496.028285][218195:218195] CHIP:DMG: { + [1666962496.028293][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962496.028302][218195:218195] CHIP:DMG: { + [1666962496.028311][218195:218195] CHIP:DMG: DataVersion = 0x30b6ba5e, + [1666962496.028320][218195:218195] CHIP:DMG: AttributePathIB = + [1666962496.028331][218195:218195] CHIP:DMG: { + [1666962496.028344][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666962496.028354][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962496.028364][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962496.028373][218195:218195] CHIP:DMG: } + [1666962496.028384][218195:218195] CHIP:DMG: + [1666962496.028393][218195:218195] CHIP:DMG: Data = [ + [1666962496.028403][218195:218195] CHIP:DMG: + [1666962496.028412][218195:218195] CHIP:DMG: ], + [1666962496.028422][218195:218195] CHIP:DMG: }, + [1666962496.028434][218195:218195] CHIP:DMG: + [1666962496.028442][218195:218195] CHIP:DMG: }, + [1666962496.028454][218195:218195] CHIP:DMG: + [1666962496.028463][218195:218195] CHIP:DMG: ], + [1666962496.028475][218195:218195] CHIP:DMG: + [1666962496.028483][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962496.028491][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962496.028498][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 10 - Verify the PartList attribute response with endpoint 10 On TH(bridge-app) Log: - - [1666962545.266945][218195:218195] CHIP:IM: Received Read request - [1666962545.266979][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962545.266986][218195:218195] CHIP:DMG: { - [1666962545.266993][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962545.267002][218195:218195] CHIP:DMG: [ - [1666962545.267009][218195:218195] CHIP:DMG: AttributePathIB = - [1666962545.267018][218195:218195] CHIP:DMG: { - [1666962545.267027][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666962545.267037][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962545.267046][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962545.267054][218195:218195] CHIP:DMG: } - [1666962545.267063][218195:218195] CHIP:DMG: - [1666962545.267071][218195:218195] CHIP:DMG: ], - [1666962545.267082][218195:218195] CHIP:DMG: - [1666962545.267100][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962545.267108][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962545.267115][218195:218195] CHIP:DMG: }, - [1666962545.267147][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962545.267172][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962545.267181][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962545.267189][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0003 (expanded=0) - [1666962545.267200][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v - [1666962545.267213][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962545.267235][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962545.267342][218195:218195] CHIP:EM: <<< [E:24189r M:59534941 (Ack:136750873)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962545.267355][218195:218195] CHIP:IN: (S) Sending msg 59534941 on secure session with LSID: 51724 - [1666962545.267489][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:48547 | 59534941 | [Interaction Model (1) / Report Data (0x05) / Session = 30602 / Exchange = 24189] - [1666962545.267502][218195:218195] CHIP:DMG: Header Flags = - [1666962545.267510][218195:218195] CHIP:DMG: { - [1666962545.267524][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962545.267531][218195:218195] CHIP:DMG: { - [1666962545.267540][218195:218195] CHIP:DMG: AckMsg = 136750873 - [1666962545.267547][218195:218195] CHIP:DMG: NeedsAck = true - [1666962545.267554][218195:218195] CHIP:DMG: } - [1666962545.267567][218195:218195] CHIP:DMG: } - [1666962545.267574][218195:218195] CHIP:DMG: - [1666962545.267585][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962545.267592][218195:218195] CHIP:DMG: { - [1666962545.267599][218195:218195] CHIP:DMG: data = 008a77005d6e8c03f404045b94379c834b72702e0ba16795c503220436544b6b0b381b216a1e3b46cb5ebcc08f78bf5e83ff6e1b7beae8c3735bb8dfc85db4e28576c43a7565 - [1666962545.267608][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 - [1666962545.267615][218195:218195] CHIP:DMG: } - [1666962545.267622][218195:218195] CHIP:DMG: - [1666962545.267634][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962545.267641][218195:218195] CHIP:DMG: { - [1666962545.267649][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d24040318360218181818290424ff0118 - [1666962545.267657][218195:218195] CHIP:DMG: } - [1666962545.267663][218195:218195] CHIP:DMG: - [1666962545.267692][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962545.267698][218195:218195] CHIP:DMG: { - [1666962545.267705][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962545.267717][218195:218195] CHIP:DMG: [ - [1666962545.267724][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962545.267737][218195:218195] CHIP:DMG: { - [1666962545.267745][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962545.267755][218195:218195] CHIP:DMG: { - [1666962545.267764][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, - [1666962545.267775][218195:218195] CHIP:DMG: AttributePathIB = - [1666962545.267786][218195:218195] CHIP:DMG: { - [1666962545.267797][218195:218195] CHIP:DMG: Endpoint = 0xa, - [1666962545.267809][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962545.267822][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962545.267832][218195:218195] CHIP:DMG: } - [1666962545.267844][218195:218195] CHIP:DMG: - [1666962545.267854][218195:218195] CHIP:DMG: Data = [ - [1666962545.267865][218195:218195] CHIP:DMG: - [1666962545.267876][218195:218195] CHIP:DMG: ], - [1666962545.267884][218195:218195] CHIP:DMG: }, - [1666962545.267896][218195:218195] CHIP:DMG: - [1666962545.267905][218195:218195] CHIP:DMG: }, - [1666962545.267916][218195:218195] CHIP:DMG: - [1666962545.267924][218195:218195] CHIP:DMG: ], - [1666962545.267935][218195:218195] CHIP:DMG: - [1666962545.267943][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962545.267952][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962545.267959][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 10 On TH(bridge-app) Log: + + [1666962545.266945][218195:218195] CHIP:IM: Received Read request + [1666962545.266979][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962545.266986][218195:218195] CHIP:DMG: { + [1666962545.266993][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962545.267002][218195:218195] CHIP:DMG: [ + [1666962545.267009][218195:218195] CHIP:DMG: AttributePathIB = + [1666962545.267018][218195:218195] CHIP:DMG: { + [1666962545.267027][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666962545.267037][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962545.267046][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962545.267054][218195:218195] CHIP:DMG: } + [1666962545.267063][218195:218195] CHIP:DMG: + [1666962545.267071][218195:218195] CHIP:DMG: ], + [1666962545.267082][218195:218195] CHIP:DMG: + [1666962545.267100][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962545.267108][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962545.267115][218195:218195] CHIP:DMG: }, + [1666962545.267147][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962545.267172][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962545.267181][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962545.267189][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=a AttributeId=0x0000_0003 (expanded=0) + [1666962545.267200][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=10 p=v + [1666962545.267213][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962545.267235][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962545.267342][218195:218195] CHIP:EM: <<< [E:24189r M:59534941 (Ack:136750873)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962545.267355][218195:218195] CHIP:IN: (S) Sending msg 59534941 on secure session with LSID: 51724 + [1666962545.267489][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:48547 | 59534941 | [Interaction Model (1) / Report Data (0x05) / Session = 30602 / Exchange = 24189] + [1666962545.267502][218195:218195] CHIP:DMG: Header Flags = + [1666962545.267510][218195:218195] CHIP:DMG: { + [1666962545.267524][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962545.267531][218195:218195] CHIP:DMG: { + [1666962545.267540][218195:218195] CHIP:DMG: AckMsg = 136750873 + [1666962545.267547][218195:218195] CHIP:DMG: NeedsAck = true + [1666962545.267554][218195:218195] CHIP:DMG: } + [1666962545.267567][218195:218195] CHIP:DMG: } + [1666962545.267574][218195:218195] CHIP:DMG: + [1666962545.267585][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962545.267592][218195:218195] CHIP:DMG: { + [1666962545.267599][218195:218195] CHIP:DMG: data = 008a77005d6e8c03f404045b94379c834b72702e0ba16795c503220436544b6b0b381b216a1e3b46cb5ebcc08f78bf5e83ff6e1b7beae8c3735bb8dfc85db4e28576c43a7565 + [1666962545.267608][218195:218195] CHIP:DMG: buffer_ptr = 94136416766512 + [1666962545.267615][218195:218195] CHIP:DMG: } + [1666962545.267622][218195:218195] CHIP:DMG: + [1666962545.267634][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962545.267641][218195:218195] CHIP:DMG: { + [1666962545.267649][218195:218195] CHIP:DMG: data = 1536011535012600b298fda8370124020a24031d24040318360218181818290424ff0118 + [1666962545.267657][218195:218195] CHIP:DMG: } + [1666962545.267663][218195:218195] CHIP:DMG: + [1666962545.267692][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962545.267698][218195:218195] CHIP:DMG: { + [1666962545.267705][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962545.267717][218195:218195] CHIP:DMG: [ + [1666962545.267724][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962545.267737][218195:218195] CHIP:DMG: { + [1666962545.267745][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962545.267755][218195:218195] CHIP:DMG: { + [1666962545.267764][218195:218195] CHIP:DMG: DataVersion = 0xa8fd98b2, + [1666962545.267775][218195:218195] CHIP:DMG: AttributePathIB = + [1666962545.267786][218195:218195] CHIP:DMG: { + [1666962545.267797][218195:218195] CHIP:DMG: Endpoint = 0xa, + [1666962545.267809][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962545.267822][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962545.267832][218195:218195] CHIP:DMG: } + [1666962545.267844][218195:218195] CHIP:DMG: + [1666962545.267854][218195:218195] CHIP:DMG: Data = [ + [1666962545.267865][218195:218195] CHIP:DMG: + [1666962545.267876][218195:218195] CHIP:DMG: ], + [1666962545.267884][218195:218195] CHIP:DMG: }, + [1666962545.267896][218195:218195] CHIP:DMG: + [1666962545.267905][218195:218195] CHIP:DMG: }, + [1666962545.267916][218195:218195] CHIP:DMG: + [1666962545.267924][218195:218195] CHIP:DMG: ], + [1666962545.267935][218195:218195] CHIP:DMG: + [1666962545.267943][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962545.267952][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962545.267959][218195:218195] CHIP:DMG: } ./chip-tool descriptor read parts-list 1 11 - Verify the PartList attribute response with endpoint 11 On TH(bridge-app) Log: - - [1666962605.941370][218195:218195] CHIP:IM: Received Read request - [1666962605.941421][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962605.941433][218195:218195] CHIP:DMG: { - [1666962605.941444][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962605.941457][218195:218195] CHIP:DMG: [ - [1666962605.941468][218195:218195] CHIP:DMG: AttributePathIB = - [1666962605.941482][218195:218195] CHIP:DMG: { - [1666962605.941495][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666962605.941508][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962605.941522][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962605.941535][218195:218195] CHIP:DMG: } - [1666962605.941550][218195:218195] CHIP:DMG: - [1666962605.941561][218195:218195] CHIP:DMG: ], - [1666962605.941576][218195:218195] CHIP:DMG: - [1666962605.941589][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962605.941600][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962605.941611][218195:218195] CHIP:DMG: }, - [1666962605.941660][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962605.941704][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962605.941719][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962605.941730][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0003 (expanded=0) - [1666962605.941747][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v - [1666962605.941765][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962605.941796][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962605.941969][218195:218195] CHIP:EM: <<< [E:53228r M:194033500 (Ack:241544232)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962605.941995][218195:218195] CHIP:IN: (S) Sending msg 194033500 on secure session with LSID: 51725 - [1666962605.942217][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45700 | 194033500 | [Interaction Model (1) / Report Data (0x05) / Session = 60703 / Exchange = 53228] - [1666962605.942243][218195:218195] CHIP:DMG: Header Flags = - [1666962605.942254][218195:218195] CHIP:DMG: { - [1666962605.942277][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962605.942288][218195:218195] CHIP:DMG: { - [1666962605.946293][218195:218195] CHIP:DMG: AckMsg = 241544232 - [1666962605.946325][218195:218195] CHIP:DMG: NeedsAck = true - [1666962605.946339][218195:218195] CHIP:DMG: } - [1666962605.946376][218195:218195] CHIP:DMG: } - [1666962605.946393][218195:218195] CHIP:DMG: - [1666962605.946424][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962605.946439][218195:218195] CHIP:DMG: { - [1666962605.946455][218195:218195] CHIP:DMG: data = 001fed005cb7900b4a137fb3c5753516fcbff9678f1b2cbf9cd04d6df60e3a9bdebf9a6f9713b60c34567f235d2aa407a9e18ed6dfdb1eb2ef70245e7b8a7a5213192b956d81 - [1666962605.946470][218195:218195] CHIP:DMG: buffer_ptr = 94136416766624 - [1666962605.946484][218195:218195] CHIP:DMG: } - [1666962605.946498][218195:218195] CHIP:DMG: - [1666962605.946525][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962605.946541][218195:218195] CHIP:DMG: { - [1666962605.946556][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d24040318360218181818290424ff0118 - [1666962605.946572][218195:218195] CHIP:DMG: } - [1666962605.946586][218195:218195] CHIP:DMG: - [1666962605.946696][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962605.946715][218195:218195] CHIP:DMG: { - [1666962605.946729][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962605.946747][218195:218195] CHIP:DMG: [ - [1666962605.946761][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962605.946782][218195:218195] CHIP:DMG: { - [1666962605.946796][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962605.946810][218195:218195] CHIP:DMG: { - [1666962605.946826][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, - [1666962605.946840][218195:218195] CHIP:DMG: AttributePathIB = - [1666962605.946854][218195:218195] CHIP:DMG: { - [1666962605.946883][218195:218195] CHIP:DMG: Endpoint = 0xb, - [1666962605.946898][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962605.946914][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962605.946927][218195:218195] CHIP:DMG: } - [1666962605.946944][218195:218195] CHIP:DMG: - [1666962605.946958][218195:218195] CHIP:DMG: Data = [ - [1666962605.946972][218195:218195] CHIP:DMG: - [1666962605.946987][218195:218195] CHIP:DMG: ], - [1666962605.946999][218195:218195] CHIP:DMG: }, - [1666962605.947016][218195:218195] CHIP:DMG: - [1666962605.947028][218195:218195] CHIP:DMG: }, - [1666962605.947044][218195:218195] CHIP:DMG: - [1666962605.947056][218195:218195] CHIP:DMG: ], - [1666962605.947074][218195:218195] CHIP:DMG: - [1666962605.947103][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962605.947120][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962605.947132][218195:218195] CHIP:DMG: } - [1666962605.947147][218195:218195] CHIP:DMG: + Verify the PartList attribute response with endpoint 11 On TH(bridge-app) Log: + + [1666962605.941370][218195:218195] CHIP:IM: Received Read request + [1666962605.941421][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962605.941433][218195:218195] CHIP:DMG: { + [1666962605.941444][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962605.941457][218195:218195] CHIP:DMG: [ + [1666962605.941468][218195:218195] CHIP:DMG: AttributePathIB = + [1666962605.941482][218195:218195] CHIP:DMG: { + [1666962605.941495][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666962605.941508][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962605.941522][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962605.941535][218195:218195] CHIP:DMG: } + [1666962605.941550][218195:218195] CHIP:DMG: + [1666962605.941561][218195:218195] CHIP:DMG: ], + [1666962605.941576][218195:218195] CHIP:DMG: + [1666962605.941589][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962605.941600][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962605.941611][218195:218195] CHIP:DMG: }, + [1666962605.941660][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962605.941704][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962605.941719][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962605.941730][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=b AttributeId=0x0000_0003 (expanded=0) + [1666962605.941747][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=11 p=v + [1666962605.941765][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962605.941796][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962605.941969][218195:218195] CHIP:EM: <<< [E:53228r M:194033500 (Ack:241544232)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962605.941995][218195:218195] CHIP:IN: (S) Sending msg 194033500 on secure session with LSID: 51725 + [1666962605.942217][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:45700 | 194033500 | [Interaction Model (1) / Report Data (0x05) / Session = 60703 / Exchange = 53228] + [1666962605.942243][218195:218195] CHIP:DMG: Header Flags = + [1666962605.942254][218195:218195] CHIP:DMG: { + [1666962605.942277][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962605.942288][218195:218195] CHIP:DMG: { + [1666962605.946293][218195:218195] CHIP:DMG: AckMsg = 241544232 + [1666962605.946325][218195:218195] CHIP:DMG: NeedsAck = true + [1666962605.946339][218195:218195] CHIP:DMG: } + [1666962605.946376][218195:218195] CHIP:DMG: } + [1666962605.946393][218195:218195] CHIP:DMG: + [1666962605.946424][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962605.946439][218195:218195] CHIP:DMG: { + [1666962605.946455][218195:218195] CHIP:DMG: data = 001fed005cb7900b4a137fb3c5753516fcbff9678f1b2cbf9cd04d6df60e3a9bdebf9a6f9713b60c34567f235d2aa407a9e18ed6dfdb1eb2ef70245e7b8a7a5213192b956d81 + [1666962605.946470][218195:218195] CHIP:DMG: buffer_ptr = 94136416766624 + [1666962605.946484][218195:218195] CHIP:DMG: } + [1666962605.946498][218195:218195] CHIP:DMG: + [1666962605.946525][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962605.946541][218195:218195] CHIP:DMG: { + [1666962605.946556][218195:218195] CHIP:DMG: data = 1536011535012600768e2de0370124020b24031d24040318360218181818290424ff0118 + [1666962605.946572][218195:218195] CHIP:DMG: } + [1666962605.946586][218195:218195] CHIP:DMG: + [1666962605.946696][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962605.946715][218195:218195] CHIP:DMG: { + [1666962605.946729][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962605.946747][218195:218195] CHIP:DMG: [ + [1666962605.946761][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962605.946782][218195:218195] CHIP:DMG: { + [1666962605.946796][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962605.946810][218195:218195] CHIP:DMG: { + [1666962605.946826][218195:218195] CHIP:DMG: DataVersion = 0xe02d8e76, + [1666962605.946840][218195:218195] CHIP:DMG: AttributePathIB = + [1666962605.946854][218195:218195] CHIP:DMG: { + [1666962605.946883][218195:218195] CHIP:DMG: Endpoint = 0xb, + [1666962605.946898][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962605.946914][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962605.946927][218195:218195] CHIP:DMG: } + [1666962605.946944][218195:218195] CHIP:DMG: + [1666962605.946958][218195:218195] CHIP:DMG: Data = [ + [1666962605.946972][218195:218195] CHIP:DMG: + [1666962605.946987][218195:218195] CHIP:DMG: ], + [1666962605.946999][218195:218195] CHIP:DMG: }, + [1666962605.947016][218195:218195] CHIP:DMG: + [1666962605.947028][218195:218195] CHIP:DMG: }, + [1666962605.947044][218195:218195] CHIP:DMG: + [1666962605.947056][218195:218195] CHIP:DMG: ], + [1666962605.947074][218195:218195] CHIP:DMG: + [1666962605.947103][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962605.947120][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962605.947132][218195:218195] CHIP:DMG: } + [1666962605.947147][218195:218195] CHIP:DMG: ./chip-tool descriptor read parts-list 1 12 - Verify the PartList attribute response with endpoint 12 On TH(bridge-app) Log: - - [1666962633.918167][218195:218195] CHIP:IM: Received Read request - [1666962633.918280][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962633.918309][218195:218195] CHIP:DMG: { - [1666962633.918332][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962633.918356][218195:218195] CHIP:DMG: [ - [1666962633.918376][218195:218195] CHIP:DMG: AttributePathIB = - [1666962633.918404][218195:218195] CHIP:DMG: { - [1666962633.918435][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666962633.918466][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962633.918498][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962633.918527][218195:218195] CHIP:DMG: } - [1666962633.918562][218195:218195] CHIP:DMG: - [1666962633.918590][218195:218195] CHIP:DMG: ], - [1666962633.918626][218195:218195] CHIP:DMG: - [1666962633.918655][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962633.918683][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962633.918709][218195:218195] CHIP:DMG: }, - [1666962633.918817][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962633.918912][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962633.918947][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962633.918976][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0003 (expanded=0) - [1666962633.919018][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v - [1666962633.919060][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962633.919174][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962633.919525][218195:218195] CHIP:EM: <<< [E:35660r M:223187611 (Ack:233122113)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962633.919569][218195:218195] CHIP:IN: (S) Sending msg 223187611 on secure session with LSID: 51726 - [1666962633.920056][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36920 | 223187611 | [Interaction Model (1) / Report Data (0x05) / Session = 9443 / Exchange = 35660] - [1666962633.920109][218195:218195] CHIP:DMG: Header Flags = - [1666962633.920135][218195:218195] CHIP:DMG: { - [1666962633.920191][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962633.920217][218195:218195] CHIP:DMG: { - [1666962633.920247][218195:218195] CHIP:DMG: AckMsg = 233122113 - [1666962633.920274][218195:218195] CHIP:DMG: NeedsAck = true - [1666962633.920298][218195:218195] CHIP:DMG: } - [1666962633.920341][218195:218195] CHIP:DMG: } - [1666962633.920369][218195:218195] CHIP:DMG: - [1666962633.920402][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962633.920429][218195:218195] CHIP:DMG: { - [1666962633.920457][218195:218195] CHIP:DMG: data = 00e324009b924d0de62b84bd7b24624502b15e2ec8b599c529c8ac3a956f5e9a79da1da8c1aa91b82ba68ef69977ca852087f29101f04a5ac0a4d021c627302b9504b6d3223f - [1666962633.920482][218195:218195] CHIP:DMG: buffer_ptr = 94136416766688 - [1666962633.920507][218195:218195] CHIP:DMG: } - [1666962633.920528][218195:218195] CHIP:DMG: - [1666962633.920579][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962633.920607][218195:218195] CHIP:DMG: { - [1666962633.920632][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d24040318360218181818290424ff0118 - [1666962633.920659][218195:218195] CHIP:DMG: } - [1666962633.920684][218195:218195] CHIP:DMG: - [1666962633.920786][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962633.920814][218195:218195] CHIP:DMG: { - [1666962633.920837][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962633.920874][218195:218195] CHIP:DMG: [ - [1666962633.920901][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962633.920945][218195:218195] CHIP:DMG: { - [1666962633.920972][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962633.921004][218195:218195] CHIP:DMG: { - [1666962633.921039][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, - [1666962633.921085][218195:218195] CHIP:DMG: AttributePathIB = - [1666962633.921119][218195:218195] CHIP:DMG: { - [1666962633.921153][218195:218195] CHIP:DMG: Endpoint = 0xc, - [1666962633.921187][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962633.921229][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962633.921262][218195:218195] CHIP:DMG: } - [1666962633.921298][218195:218195] CHIP:DMG: - [1666962633.921331][218195:218195] CHIP:DMG: Data = [ - [1666962633.921366][218195:218195] CHIP:DMG: - [1666962633.921399][218195:218195] CHIP:DMG: ], - [1666962633.921430][218195:218195] CHIP:DMG: }, - [1666962633.921471][218195:218195] CHIP:DMG: - [1666962633.921501][218195:218195] CHIP:DMG: }, - [1666962633.921541][218195:218195] CHIP:DMG: - [1666962633.921570][218195:218195] CHIP:DMG: ], - [1666962633.921610][218195:218195] CHIP:DMG: - [1666962633.921641][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962633.921670][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962633.921695][218195:218195] CHIP:DMG: } - [1666962633.921723][218195:218195] CHIP:DMG: - - ./chip-tool descriptor read parts-list 1 13 - - Verify the PartList attribute response with endpoint 13 On TH(bridge-app) Log: - - [1666962673.106887][218195:218195] CHIP:IM: Received Read request - [1666962673.106920][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666962673.106927][218195:218195] CHIP:DMG: { - [1666962673.106934][218195:218195] CHIP:DMG: AttributePathIBs = - [1666962673.106943][218195:218195] CHIP:DMG: [ - [1666962673.106951][218195:218195] CHIP:DMG: AttributePathIB = - [1666962673.106960][218195:218195] CHIP:DMG: { - [1666962673.106969][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666962673.106978][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962673.106988][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962673.106997][218195:218195] CHIP:DMG: } - [1666962673.107007][218195:218195] CHIP:DMG: - [1666962673.107015][218195:218195] CHIP:DMG: ], - [1666962673.107026][218195:218195] CHIP:DMG: - [1666962673.107033][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666962673.107042][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962673.107049][218195:218195] CHIP:DMG: }, - [1666962673.107081][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666962673.107120][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666962673.107130][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - [1666962673.107138][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=d AttributeId=0x0000_0003 (expanded=0) - [1666962673.107149][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=13 p=v - [1666962673.107162][218195:218195] CHIP:DMG: AccessControl: allowed - [1666962673.107184][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... - [1666962673.107292][218195:218195] CHIP:EM: <<< [E:54576r M:192461937 (Ack:92650181)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666962673.107304][218195:218195] CHIP:IN: (S) Sending msg 192461937 on secure session with LSID: 51727 - [1666962673.107438][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:48254 | 192461937 | [Interaction Model (1) / Report Data (0x05) / Session = 26753 / Exchange = 54576] - [1666962673.107452][218195:218195] CHIP:DMG: Header Flags = - [1666962673.107459][218195:218195] CHIP:DMG: { - [1666962673.107474][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666962673.107481][218195:218195] CHIP:DMG: { - [1666962673.107490][218195:218195] CHIP:DMG: AckMsg = 92650181 - [1666962673.107497][218195:218195] CHIP:DMG: NeedsAck = true - [1666962673.107504][218195:218195] CHIP:DMG: } - [1666962673.107517][218195:218195] CHIP:DMG: } - [1666962673.107524][218195:218195] CHIP:DMG: - [1666962673.107536][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = - [1666962673.107543][218195:218195] CHIP:DMG: { - [1666962673.107550][218195:218195] CHIP:DMG: data = 0081680071bc780bf00a274e8929a9bc304a85e9477043931f3d4ac244eadb4ef8445cc8f478e90ccc88289152f3fe2c881bde5b4abd18c203cfeae79957eb3cb177cdfb23f9 - [1666962673.107558][218195:218195] CHIP:DMG: buffer_ptr = 94136416766832 - [1666962673.107565][218195:218195] CHIP:DMG: } - [1666962673.107573][218195:218195] CHIP:DMG: - [1666962673.107586][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = - [1666962673.107593][218195:218195] CHIP:DMG: { - [1666962673.107601][218195:218195] CHIP:DMG: data = 15360115350126008fecadea370124020d24031d24040318360218181818290424ff0118 - [1666962673.107608][218195:218195] CHIP:DMG: } - [1666962673.107615][218195:218195] CHIP:DMG: - [1666962673.107643][218195:218195] CHIP:DMG: ReportDataMessage = - [1666962673.107649][218195:218195] CHIP:DMG: { - [1666962673.107656][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666962673.107669][218195:218195] CHIP:DMG: [ - [1666962673.107677][218195:218195] CHIP:DMG: AttributeReportIB = - [1666962673.107690][218195:218195] CHIP:DMG: { - [1666962673.107698][218195:218195] CHIP:DMG: AttributeDataIB = - [1666962673.107707][218195:218195] CHIP:DMG: { - [1666962673.107717][218195:218195] CHIP:DMG: DataVersion = 0xeaadec8f, - [1666962673.107728][218195:218195] CHIP:DMG: AttributePathIB = - [1666962673.107738][218195:218195] CHIP:DMG: { - [1666962673.107750][218195:218195] CHIP:DMG: Endpoint = 0xd, - [1666962673.107760][218195:218195] CHIP:DMG: Cluster = 0x1d, - [1666962673.107772][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, - [1666962673.107782][218195:218195] CHIP:DMG: } - [1666962673.107795][218195:218195] CHIP:DMG: - [1666962673.107803][218195:218195] CHIP:DMG: Data = [ - [1666962673.107816][218195:218195] CHIP:DMG: - [1666962673.107826][218195:218195] CHIP:DMG: ], - [1666962673.107836][218195:218195] CHIP:DMG: }, - [1666962673.107848][218195:218195] CHIP:DMG: - [1666962673.107857][218195:218195] CHIP:DMG: }, - [1666962673.107869][218195:218195] CHIP:DMG: - [1666962673.107876][218195:218195] CHIP:DMG: ], - [1666962673.107888][218195:218195] CHIP:DMG: - [1666962673.107896][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666962673.107904][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666962673.107911][218195:218195] CHIP:DMG: } + Verify the PartList attribute response with endpoint 12 On TH(bridge-app) Log: + + [1666962633.918167][218195:218195] CHIP:IM: Received Read request + [1666962633.918280][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666962633.918309][218195:218195] CHIP:DMG: { + [1666962633.918332][218195:218195] CHIP:DMG: AttributePathIBs = + [1666962633.918356][218195:218195] CHIP:DMG: [ + [1666962633.918376][218195:218195] CHIP:DMG: AttributePathIB = + [1666962633.918404][218195:218195] CHIP:DMG: { + [1666962633.918435][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666962633.918466][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962633.918498][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962633.918527][218195:218195] CHIP:DMG: } + [1666962633.918562][218195:218195] CHIP:DMG: + [1666962633.918590][218195:218195] CHIP:DMG: ], + [1666962633.918626][218195:218195] CHIP:DMG: + [1666962633.918655][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666962633.918683][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962633.918709][218195:218195] CHIP:DMG: }, + [1666962633.918817][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666962633.918912][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666962633.918947][218195:218195] CHIP:DMG: Cluster 1d, Attribute 3 is dirty + [1666962633.918976][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_001D Endpoint=c AttributeId=0x0000_0003 (expanded=0) + [1666962633.919018][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001D e=12 p=v + [1666962633.919060][218195:218195] CHIP:DMG: AccessControl: allowed + [1666962633.919174][218195:218195] CHIP:DMG: Sending report (payload has 36 bytes)... + [1666962633.919525][218195:218195] CHIP:EM: <<< [E:35660r M:223187611 (Ack:233122113)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666962633.919569][218195:218195] CHIP:IN: (S) Sending msg 223187611 on secure session with LSID: 51726 + [1666962633.920056][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:36920 | 223187611 | [Interaction Model (1) / Report Data (0x05) / Session = 9443 / Exchange = 35660] + [1666962633.920109][218195:218195] CHIP:DMG: Header Flags = + [1666962633.920135][218195:218195] CHIP:DMG: { + [1666962633.920191][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666962633.920217][218195:218195] CHIP:DMG: { + [1666962633.920247][218195:218195] CHIP:DMG: AckMsg = 233122113 + [1666962633.920274][218195:218195] CHIP:DMG: NeedsAck = true + [1666962633.920298][218195:218195] CHIP:DMG: } + [1666962633.920341][218195:218195] CHIP:DMG: } + [1666962633.920369][218195:218195] CHIP:DMG: + [1666962633.920402][218195:218195] CHIP:DMG: Encrypted Payload (70 bytes) = + [1666962633.920429][218195:218195] CHIP:DMG: { + [1666962633.920457][218195:218195] CHIP:DMG: data = 00e324009b924d0de62b84bd7b24624502b15e2ec8b599c529c8ac3a956f5e9a79da1da8c1aa91b82ba68ef69977ca852087f29101f04a5ac0a4d021c627302b9504b6d3223f + [1666962633.920482][218195:218195] CHIP:DMG: buffer_ptr = 94136416766688 + [1666962633.920507][218195:218195] CHIP:DMG: } + [1666962633.920528][218195:218195] CHIP:DMG: + [1666962633.920579][218195:218195] CHIP:DMG: Decrypted Payload (36 bytes) = + [1666962633.920607][218195:218195] CHIP:DMG: { + [1666962633.920632][218195:218195] CHIP:DMG: data = 153601153501260083c07f68370124020c24031d24040318360218181818290424ff0118 + [1666962633.920659][218195:218195] CHIP:DMG: } + [1666962633.920684][218195:218195] CHIP:DMG: + [1666962633.920786][218195:218195] CHIP:DMG: ReportDataMessage = + [1666962633.920814][218195:218195] CHIP:DMG: { + [1666962633.920837][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666962633.920874][218195:218195] CHIP:DMG: [ + [1666962633.920901][218195:218195] CHIP:DMG: AttributeReportIB = + [1666962633.920945][218195:218195] CHIP:DMG: { + [1666962633.920972][218195:218195] CHIP:DMG: AttributeDataIB = + [1666962633.921004][218195:218195] CHIP:DMG: { + [1666962633.921039][218195:218195] CHIP:DMG: DataVersion = 0x687fc083, + [1666962633.921085][218195:218195] CHIP:DMG: AttributePathIB = + [1666962633.921119][218195:218195] CHIP:DMG: { + [1666962633.921153][218195:218195] CHIP:DMG: Endpoint = 0xc, + [1666962633.921187][218195:218195] CHIP:DMG: Cluster = 0x1d, + [1666962633.921229][218195:218195] CHIP:DMG: Attribute = 0x0000_0003, + [1666962633.921262][218195:218195] CHIP:DMG: } + [1666962633.921298][218195:218195] CHIP:DMG: + [1666962633.921331][218195:218195] CHIP:DMG: Data = [ + [1666962633.921366][218195:218195] CHIP:DMG: + [1666962633.921399][218195:218195] CHIP:DMG: ], + [1666962633.921430][218195:218195] CHIP:DMG: }, + [1666962633.921471][218195:218195] CHIP:DMG: + [1666962633.921501][218195:218195] CHIP:DMG: }, + [1666962633.921541][218195:218195] CHIP:DMG: + [1666962633.921570][218195:218195] CHIP:DMG: ], + [1666962633.921610][218195:218195] CHIP:DMG: + [1666962633.921641][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666962633.921670][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666962633.921695][218195:218195] CHIP:DMG: } + [1666962633.921723][218195:218195] CHIP:DMG: disabled: true - label: @@ -6160,448 +5400,367 @@ tests: from the above list" PICS: MCORE.DEVLIST.UseDeviceName verification: | - NodeLabel is supported for endpoints 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 + NodeLabel is supported for endpoints 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ./chip-tool bridgeddevicebasicinformation read node-label 1 3 - Verify the node-label attribute response with endpoint 3 On TH(bridge-app) Log: - - [1678949732.758830][30220:30220] CHIP:IM: Received Read request - [1678949732.758854][30220:30220] CHIP:DMG: ReadRequestMessage = - [1678949732.758859][30220:30220] CHIP:DMG: { - [1678949732.758862][30220:30220] CHIP:DMG: AttributePathIBs = - [1678949732.758866][30220:30220] CHIP:DMG: [ - [1678949732.758870][30220:30220] CHIP:DMG: AttributePathIB = - [1678949732.758875][30220:30220] CHIP:DMG: { - [1678949732.758879][30220:30220] CHIP:DMG: Endpoint = 0x3, - [1678949732.758884][30220:30220] CHIP:DMG: Cluster = 0x39, - [1678949732.758889][30220:30220] CHIP:DMG: Attribute = 0x0000_0005, - [1678949732.758893][30220:30220] CHIP:DMG: } - [1678949732.758897][30220:30220] CHIP:DMG: - [1678949732.758901][30220:30220] CHIP:DMG: ], - [1678949732.758906][30220:30220] CHIP:DMG: - [1678949732.758910][30220:30220] CHIP:DMG: isFabricFiltered = true, - [1678949732.758914][30220:30220] CHIP:DMG: InteractionModelRevision = 1 - [1678949732.758918][30220:30220] CHIP:DMG: }, - [1678949732.758937][30220:30220] CHIP:DMG: IM RH moving to [GeneratingReports] - [1678949732.758953][30220:30220] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1678949732.758959][30220:30220] CHIP:DMG: Cluster 39, Attribute 5 is dirty + Verify the node-label attribute response with endpoint 3 On TH(bridge-app) Log: + + [1678949732.758830][30220:30220] CHIP:IM: Received Read request + [1678949732.758854][30220:30220] CHIP:DMG: ReadRequestMessage = + [1678949732.758859][30220:30220] CHIP:DMG: { + [1678949732.758862][30220:30220] CHIP:DMG: AttributePathIBs = + [1678949732.758866][30220:30220] CHIP:DMG: [ + [1678949732.758870][30220:30220] CHIP:DMG: AttributePathIB = + [1678949732.758875][30220:30220] CHIP:DMG: { + [1678949732.758879][30220:30220] CHIP:DMG: Endpoint = 0x3, + [1678949732.758884][30220:30220] CHIP:DMG: Cluster = 0x39, + [1678949732.758889][30220:30220] CHIP:DMG: Attribute = 0x0000_0005, + [1678949732.758893][30220:30220] CHIP:DMG: } + [1678949732.758897][30220:30220] CHIP:DMG: + [1678949732.758901][30220:30220] CHIP:DMG: ], + [1678949732.758906][30220:30220] CHIP:DMG: + [1678949732.758910][30220:30220] CHIP:DMG: isFabricFiltered = true, + [1678949732.758914][30220:30220] CHIP:DMG: InteractionModelRevision = 1 + [1678949732.758918][30220:30220] CHIP:DMG: }, + [1678949732.758937][30220:30220] CHIP:DMG: IM RH moving to [GeneratingReports] + [1678949732.758953][30220:30220] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1678949732.758959][30220:30220] CHIP:DMG: Cluster 39, Attribute 5 is dirty ./chip-tool bridgeddevicebasicinformation read node-label 1 4 - Verify the node-label attribute response with endpoint 4 On TH(bridge-app) Log: - - [1663916874.414183][1588:1588] CHIP:DMG: - [1663916874.414304][1588:1588] CHIP:DMG: ReportDataMessage = - [1663916874.414340][1588:1588] CHIP:DMG: { - [1663916874.414401][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663916874.414441][1588:1588] CHIP:DMG: [ - [1663916874.414472][1588:1588] CHIP:DMG: AttributeReportIB = - [1663916874.414552][1588:1588] CHIP:DMG: { - [1663916874.414618][1588:1588] CHIP:DMG: AttributeDataIB = - [1663916874.414665][1588:1588] CHIP:DMG: { - [1663916874.414738][1588:1588] CHIP:DMG: DataVersion = 0x74fbff86, - [1663916874.414779][1588:1588] CHIP:DMG: AttributePathIB = - [1663916874.414858][1588:1588] CHIP:DMG: { - [1663916874.414939][1588:1588] CHIP:DMG: Endpoint = 0x4, - [1663916874.415016][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663916874.415090][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663916874.415129][1588:1588] CHIP:DMG: } - [1663916874.415210][1588:1588] CHIP:DMG: - [1663916874.415288][1588:1588] CHIP:DMG: Data = "TempSensor 1" (12 chars), - [1663916874.415365][1588:1588] CHIP:DMG: }, - [1663916874.415440][1588:1588] CHIP:DMG: - [1663916874.415477][1588:1588] CHIP:DMG: }, - [1663916874.415583][1588:1588] CHIP:DMG: - [1663916874.415646][1588:1588] CHIP:DMG: ], - [1663916874.415714][1588:1588] CHIP:DMG: - [1663916874.415750][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663916874.415813][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663916874.415842][1588:1588] CHIP:DMG: } - [1663916874.415870][1588:1588] CHIP:DMG: - [1663916874.416152][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663916874.416190][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663916874.416261][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] - [1663916874.416299][1588:1588] CHIP:DMG: All ReadHandler-s are clean, clear Globa + Verify the node-label attribute response with endpoint 4 On TH(bridge-app) Log: + + [1663916874.414183][1588:1588] CHIP:DMG: + [1663916874.414304][1588:1588] CHIP:DMG: ReportDataMessage = + [1663916874.414340][1588:1588] CHIP:DMG: { + [1663916874.414401][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663916874.414441][1588:1588] CHIP:DMG: [ + [1663916874.414472][1588:1588] CHIP:DMG: AttributeReportIB = + [1663916874.414552][1588:1588] CHIP:DMG: { + [1663916874.414618][1588:1588] CHIP:DMG: AttributeDataIB = + [1663916874.414665][1588:1588] CHIP:DMG: { + [1663916874.414738][1588:1588] CHIP:DMG: DataVersion = 0x74fbff86, + [1663916874.414779][1588:1588] CHIP:DMG: AttributePathIB = + [1663916874.414858][1588:1588] CHIP:DMG: { + [1663916874.414939][1588:1588] CHIP:DMG: Endpoint = 0x4, + [1663916874.415016][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663916874.415090][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663916874.415129][1588:1588] CHIP:DMG: } + [1663916874.415210][1588:1588] CHIP:DMG: + [1663916874.415288][1588:1588] CHIP:DMG: Data = "TempSensor 1" (12 chars), + [1663916874.415365][1588:1588] CHIP:DMG: }, + [1663916874.415440][1588:1588] CHIP:DMG: + [1663916874.415477][1588:1588] CHIP:DMG: }, + [1663916874.415583][1588:1588] CHIP:DMG: + [1663916874.415646][1588:1588] CHIP:DMG: ], + [1663916874.415714][1588:1588] CHIP:DMG: + [1663916874.415750][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663916874.415813][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663916874.415842][1588:1588] CHIP:DMG: } + [1663916874.415870][1588:1588] CHIP:DMG: + [1663916874.416152][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663916874.416190][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663916874.416261][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + [1663916874.416299][1588:1588] CHIP:DMG: All ReadHandler-s are clean, clear Globa + + ./chip-tool bridgeddevicebasicinformation read node-label 1 5 - Verify the node-label attribute response with endpoint 5 On TH(bridge-app) Log: - - [1663925132.199931][1588:1588] CHIP:DMG: - [1663925132.200086][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925132.200117][1588:1588] CHIP:DMG: { - [1663925132.200153][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925132.200190][1588:1588] CHIP:DMG: [ - [1663925132.200216][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925132.200253][1588:1588] CHIP:DMG: { - [1663925132.200293][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925132.200331][1588:1588] CHIP:DMG: { - [1663925132.200370][1588:1588] CHIP:DMG: DataVersion = 0xd32877aa, - [1663925132.200415][1588:1588] CHIP:DMG: AttributePathIB = - [1663925132.200451][1588:1588] CHIP:DMG: { - [1663925132.200499][1588:1588] CHIP:DMG: Endpoint = 0x5, - [1663925132.200549][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925132.200589][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925132.200625][1588:1588] CHIP:DMG: } - [1663925132.200697][1588:1588] CHIP:DMG: - [1663925132.200739][1588:1588] CHIP:DMG: Data = "TempSensor 2" (12 chars), - [1663925132.200774][1588:1588] CHIP:DMG: }, - [1663925132.200821][1588:1588] CHIP:DMG: - [1663925132.200851][1588:1588] CHIP:DMG: }, - [1663925132.200898][1588:1588] CHIP:DMG: - [1663925132.200925][1588:1588] CHIP:DMG: ], - [1663925132.200958][1588:1588] CHIP:DMG: - [1663925132.200996][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925132.201025][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925132.201060][1588:1588] CHIP:DMG: } - [1663925132.201084][1588:1588] CHIP:DMG: - [1663925132.201317][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925132.201350][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925132.201375][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] - [1663925132.201409][1588:1588] CHIP:DMG: All ReadHandler-s are clean, clear Globa + Verify the node-label attribute response with endpoint 5 On TH(bridge-app) Log: + + [1663925132.199931][1588:1588] CHIP:DMG: + [1663925132.200086][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925132.200117][1588:1588] CHIP:DMG: { + [1663925132.200153][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925132.200190][1588:1588] CHIP:DMG: [ + [1663925132.200216][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925132.200253][1588:1588] CHIP:DMG: { + [1663925132.200293][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925132.200331][1588:1588] CHIP:DMG: { + [1663925132.200370][1588:1588] CHIP:DMG: DataVersion = 0xd32877aa, + [1663925132.200415][1588:1588] CHIP:DMG: AttributePathIB = + [1663925132.200451][1588:1588] CHIP:DMG: { + [1663925132.200499][1588:1588] CHIP:DMG: Endpoint = 0x5, + [1663925132.200549][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663925132.200589][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663925132.200625][1588:1588] CHIP:DMG: } + [1663925132.200697][1588:1588] CHIP:DMG: + [1663925132.200739][1588:1588] CHIP:DMG: Data = "TempSensor 2" (12 chars), + [1663925132.200774][1588:1588] CHIP:DMG: }, + [1663925132.200821][1588:1588] CHIP:DMG: + [1663925132.200851][1588:1588] CHIP:DMG: }, + [1663925132.200898][1588:1588] CHIP:DMG: + [1663925132.200925][1588:1588] CHIP:DMG: ], + [1663925132.200958][1588:1588] CHIP:DMG: + [1663925132.200996][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925132.201025][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925132.201060][1588:1588] CHIP:DMG: } + [1663925132.201084][1588:1588] CHIP:DMG: + [1663925132.201317][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925132.201350][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925132.201375][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + [1663925132.201409][1588:1588] CHIP:DMG: All ReadHandler-s are clean, clear Globa + ./chip-tool bridgeddevicebasicinformation read node-label 1 6 - Verify the node-label attribute response with endpoint 6 On TH(bridge-app) Log: - - [1663925170.922635][1588:1588] CHIP:DMG: } - [1663925170.922652][1588:1588] CHIP:DMG: - [1663925170.922724][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925170.922754][1588:1588] CHIP:DMG: { - [1663925170.922773][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925170.922800][1588:1588] CHIP:DMG: [ - [1663925170.922821][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925170.922851][1588:1588] CHIP:DMG: { - [1663925170.922880][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925170.922910][1588:1588] CHIP:DMG: { - [1663925170.922946][1588:1588] CHIP:DMG: DataVersion = 0x57453e4d, - [1663925170.922974][1588:1588] CHIP:DMG: AttributePathIB = - [1663925170.923008][1588:1588] CHIP:DMG: { - [1663925170.923037][1588:1588] CHIP:DMG: Endpoint = 0x6, - [1663925170.923076][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925170.923103][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925170.923139][1588:1588] CHIP:DMG: } - [1663925170.923169][1588:1588] CHIP:DMG: - [1663925170.923211][1588:1588] CHIP:DMG: Data = "Composed Device" (15 chars), - [1663925170.923247][1588:1588] CHIP:DMG: }, - [1663925170.923278][1588:1588] CHIP:DMG: - [1663925170.923310][1588:1588] CHIP:DMG: }, - [1663925170.923336][1588:1588] CHIP:DMG: - [1663925170.923365][1588:1588] CHIP:DMG: ], - [1663925170.923391][1588:1588] CHIP:DMG: - [1663925170.923421][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925170.923444][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925170.923464][1588:1588] CHIP:DMG: } - [1663925170.923491][1588:1588] CHIP:DMG: - [1663925170.923700][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925170.923732][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925170.923752][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + Verify the node-label attribute response with endpoint 6 On TH(bridge-app) Log: + + [1663925170.922635][1588:1588] CHIP:DMG: } + [1663925170.922652][1588:1588] CHIP:DMG: + [1663925170.922724][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925170.922754][1588:1588] CHIP:DMG: { + [1663925170.922773][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925170.922800][1588:1588] CHIP:DMG: [ + [1663925170.922821][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925170.922851][1588:1588] CHIP:DMG: { + [1663925170.922880][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925170.922910][1588:1588] CHIP:DMG: { + [1663925170.922946][1588:1588] CHIP:DMG: DataVersion = 0x57453e4d, + [1663925170.922974][1588:1588] CHIP:DMG: AttributePathIB = + [1663925170.923008][1588:1588] CHIP:DMG: { + [1663925170.923037][1588:1588] CHIP:DMG: Endpoint = 0x6, + [1663925170.923076][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663925170.923103][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663925170.923139][1588:1588] CHIP:DMG: } + [1663925170.923169][1588:1588] CHIP:DMG: + [1663925170.923211][1588:1588] CHIP:DMG: Data = "Composed Device" (15 chars), + [1663925170.923247][1588:1588] CHIP:DMG: }, + [1663925170.923278][1588:1588] CHIP:DMG: + [1663925170.923310][1588:1588] CHIP:DMG: }, + [1663925170.923336][1588:1588] CHIP:DMG: + [1663925170.923365][1588:1588] CHIP:DMG: ], + [1663925170.923391][1588:1588] CHIP:DMG: + [1663925170.923421][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925170.923444][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925170.923464][1588:1588] CHIP:DMG: } + [1663925170.923491][1588:1588] CHIP:DMG: + [1663925170.923700][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925170.923732][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925170.923752][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + ./chip-tool bridgeddevicebasicinformation read node-label 1 7 - Verify the node-label attribute response with endpoint 7 On TH(bridge-app) Log: - - [1663925266.540251][1588:1588] CHIP:DMG: - [1663925266.540311][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925266.540333][1588:1588] CHIP:DMG: { - [1663925266.540352][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925266.540377][1588:1588] CHIP:DMG: [ - [1663925266.540397][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925266.540428][1588:1588] CHIP:DMG: { - [1663925266.540454][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925266.540482][1588:1588] CHIP:DMG: { - [1663925266.540511][1588:1588] CHIP:DMG: DataVersion = 0xc2bc27ff, - [1663925266.540538][1588:1588] CHIP:DMG: AttributePathIB = - [1663925266.540565][1588:1588] CHIP:DMG: { - [1663925266.540593][1588:1588] CHIP:DMG: Endpoint = 0x7, - [1663925266.540624][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925266.540683][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925266.540713][1588:1588] CHIP:DMG: } - [1663925266.540743][1588:1588] CHIP:DMG: - [1663925266.540776][1588:1588] CHIP:DMG: Data = "Composed TempSensor 1" (21 chars), - [1663925266.540802][1588:1588] CHIP:DMG: }, - [1663925266.540828][1588:1588] CHIP:DMG: - [1663925266.540853][1588:1588] CHIP:DMG: }, - [1663925266.540880][1588:1588] CHIP:DMG: - [1663925266.540900][1588:1588] CHIP:DMG: ], - [1663925266.540924][1588:1588] CHIP:DMG: - [1663925266.540945][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925266.540965][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925266.540984][1588:1588] CHIP:DMG: } - [1663925266.541003][1588:1588] CHIP:DMG: - [1663925266.541190][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925266.541220][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925266.541239][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + Verify the node-label attribute response with endpoint 7 On TH(bridge-app) Log: + + [1663925266.540251][1588:1588] CHIP:DMG: + [1663925266.540311][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925266.540333][1588:1588] CHIP:DMG: { + [1663925266.540352][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925266.540377][1588:1588] CHIP:DMG: [ + [1663925266.540397][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925266.540428][1588:1588] CHIP:DMG: { + [1663925266.540454][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925266.540482][1588:1588] CHIP:DMG: { + [1663925266.540511][1588:1588] CHIP:DMG: DataVersion = 0xc2bc27ff, + [1663925266.540538][1588:1588] CHIP:DMG: AttributePathIB = + [1663925266.540565][1588:1588] CHIP:DMG: { + [1663925266.540593][1588:1588] CHIP:DMG: Endpoint = 0x7, + [1663925266.540624][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663925266.540683][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663925266.540713][1588:1588] CHIP:DMG: } + [1663925266.540743][1588:1588] CHIP:DMG: + [1663925266.540776][1588:1588] CHIP:DMG: Data = "Composed TempSensor 1" (21 chars), + [1663925266.540802][1588:1588] CHIP:DMG: }, + [1663925266.540828][1588:1588] CHIP:DMG: + [1663925266.540853][1588:1588] CHIP:DMG: }, + [1663925266.540880][1588:1588] CHIP:DMG: + [1663925266.540900][1588:1588] CHIP:DMG: ], + [1663925266.540924][1588:1588] CHIP:DMG: + [1663925266.540945][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925266.540965][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925266.540984][1588:1588] CHIP:DMG: } + [1663925266.541003][1588:1588] CHIP:DMG: + [1663925266.541190][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925266.541220][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925266.541239][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] ./chip-tool bridgeddevicebasicinformation read node-label 1 8 - Verify the node-label attribute response with endpoint 8 On TH(bridge-app) Log: - - [1663925300.298779][1588:1588] CHIP:DMG: - [1663925300.298852][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925300.298881][1588:1588] CHIP:DMG: { - [1663925300.298905][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925300.298941][1588:1588] CHIP:DMG: [ - [1663925300.298970][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925300.299005][1588:1588] CHIP:DMG: { - [1663925300.299035][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925300.299072][1588:1588] CHIP:DMG: { - [1663925300.299111][1588:1588] CHIP:DMG: DataVersion = 0xbbf17d88, - [1663925300.299145][1588:1588] CHIP:DMG: AttributePathIB = - [1663925300.299181][1588:1588] CHIP:DMG: { - [1663925300.299218][1588:1588] CHIP:DMG: Endpoint = 0x8, - [1663925300.299256][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925300.299290][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925300.299325][1588:1588] CHIP:DMG: } - [1663925300.299364][1588:1588] CHIP:DMG: - [1663925300.299404][1588:1588] CHIP:DMG: Data = "Composed TempSensor 2" (21 chars), - [1663925300.299435][1588:1588] CHIP:DMG: }, - [1663925300.299474][1588:1588] CHIP:DMG: - [1663925300.299501][1588:1588] CHIP:DMG: }, - [1663925300.299533][1588:1588] CHIP:DMG: - [1663925300.299558][1588:1588] CHIP:DMG: ], - [1663925300.299591][1588:1588] CHIP:DMG: - [1663925300.299618][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925300.299645][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925300.299670][1588:1588] CHIP:DMG: } - [1663925300.299694][1588:1588] CHIP:DMG: - [1663925300.299901][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925300.299936][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925300.299963][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + Verify the node-label attribute response with endpoint 8 On TH(bridge-app) Log: + + [1663925300.298779][1588:1588] CHIP:DMG: + [1663925300.298852][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925300.298881][1588:1588] CHIP:DMG: { + [1663925300.298905][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925300.298941][1588:1588] CHIP:DMG: [ + [1663925300.298970][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925300.299005][1588:1588] CHIP:DMG: { + [1663925300.299035][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925300.299072][1588:1588] CHIP:DMG: { + [1663925300.299111][1588:1588] CHIP:DMG: DataVersion = 0xbbf17d88, + [1663925300.299145][1588:1588] CHIP:DMG: AttributePathIB = + [1663925300.299181][1588:1588] CHIP:DMG: { + [1663925300.299218][1588:1588] CHIP:DMG: Endpoint = 0x8, + [1663925300.299256][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663925300.299290][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663925300.299325][1588:1588] CHIP:DMG: } + [1663925300.299364][1588:1588] CHIP:DMG: + [1663925300.299404][1588:1588] CHIP:DMG: Data = "Composed TempSensor 2" (21 chars), + [1663925300.299435][1588:1588] CHIP:DMG: }, + [1663925300.299474][1588:1588] CHIP:DMG: + [1663925300.299501][1588:1588] CHIP:DMG: }, + [1663925300.299533][1588:1588] CHIP:DMG: + [1663925300.299558][1588:1588] CHIP:DMG: ], + [1663925300.299591][1588:1588] CHIP:DMG: + [1663925300.299618][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925300.299645][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925300.299670][1588:1588] CHIP:DMG: } + [1663925300.299694][1588:1588] CHIP:DMG: + [1663925300.299901][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925300.299936][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925300.299963][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] ./chip-tool bridgeddevicebasicinformation read node-label 1 9 - Verify the node-label attribute response with endpoint 9 On TH(bridge-app) Log: - - [[1666958851.515530][218195:218195] CHIP:IM: Received Read request - [1666958851.515565][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666958851.515574][218195:218195] CHIP:DMG: { - [1666958851.515580][218195:218195] CHIP:DMG: AttributePathIBs = - [1666958851.515587][218195:218195] CHIP:DMG: [ - [1666958851.515593][218195:218195] CHIP:DMG: AttributePathIB = - [1666958851.515600][218195:218195] CHIP:DMG: { - [1666958851.515608][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666958851.515614][218195:218195] CHIP:DMG: Cluster = 0x39, - [1666958851.515621][218195:218195] CHIP:DMG: Attribute = 0x0000_0005, - [1666958851.515628][218195:218195] CHIP:DMG: } - [1666958851.515636][218195:218195] CHIP:DMG: - [1666958851.515644][218195:218195] CHIP:DMG: ], - [1666958851.515653][218195:218195] CHIP:DMG: - [1666958851.515662][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666958851.515669][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666958851.515675][218195:218195] CHIP:DMG: }, - [1666958851.515699][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666958851.515728][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666958851.515738][218195:218195] CHIP:DMG: Cluster 39, Attribute 5 is dirty - [1666958851.515745][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_0039 Endpoint=9 AttributeId=0x0000_0005 (expanded=0) - [1666958851.515757][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0039 e=9 p=v - [1666958851.515769][218195:218195] CHIP:DMG: AccessControl: allowed - [1666958851.515782][218195:218195] CHIP:DL: HandleReadBridgedDeviceBasicAttribute: attrId=5, maxReadLength=32 - [1666958851.515794][218195:218195] CHIP:DMG: Sending report (payload has 57 bytes)... - [1666958851.515924][218195:218195] CHIP:EM: <<< [E:20358r M:66131052 (Ack:253479066)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666958851.515940][218195:218195] CHIP:IN: (S) Sending msg 66131052 on secure session with LSID: 51689 - [1666958851.516081][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:54839 | 66131052 | [Interaction Model (1) / Report Data (0x05) / Session = 6677 / Exchange = 20358] - [1666958851.516097][218195:218195] CHIP:DMG: Header Flags = - [1666958851.516103][218195:218195] CHIP:DMG: { - [1666958851.516118][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666958851.516124][218195:218195] CHIP:DMG: { - [1666958851.516132][218195:218195] CHIP:DMG: AckMsg = 253479066 - [1666958851.516138][218195:218195] CHIP:DMG: NeedsAck = true - [1666958851.516145][218195:218195] CHIP:DMG: } - [1666958851.516156][218195:218195] CHIP:DMG: } - [1666958851.516164][218195:218195] CHIP:DMG: - [1666958851.516176][218195:218195] CHIP:DMG: Encrypted Payload (91 bytes) = - [1666958851.516183][218195:218195] CHIP:DMG: { - [1666958851.516189][218195:218195] CHIP:DMG: data = 00151a006c14f10325c9f5331a35f20fa16be3ceda01445f551638bb2ba508cc6b1666f59e06e74bc584bc934058635c17b11c1939bb423ea2b038ac2a8cea7f3da0654d15a4c65fb430532d0242f57de305682b4bf8366f6b0ed3 - [1666958851.516196][218195:218195] CHIP:DMG: buffer_ptr = 94136416754912 - [1666958851.516202][218195:218195] CHIP:DMG: } - [1666958851.516207][218195:218195] CHIP:DMG: - [1666958851.516220][218195:218195] CHIP:DMG: Decrypted Payload (57 bytes) = - [1666958851.516225][218195:218195] CHIP:DMG: { - [1666958851.516230][218195:218195] CHIP:DMG: data = 15360115350126007121f7c43701240209240339240405182c0215436f6d706f73656420506f77657220536f75726365181818290424ff0118 - [1666958851.516236][218195:218195] CHIP:DMG: } - [1666958851.516241][218195:218195] CHIP:DMG: - [1666958851.516264][218195:218195] CHIP:DMG: ReportDataMessage = - [1666958851.516270][218195:218195] CHIP:DMG: { - [1666958851.516278][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666958851.516286][218195:218195] CHIP:DMG: [ - [1666958851.516290][218195:218195] CHIP:DMG: AttributeReportIB = - [1666958851.516298][218195:218195] CHIP:DMG: { - [1666958851.516303][218195:218195] CHIP:DMG: AttributeDataIB = - [1666958851.516309][218195:218195] CHIP:DMG: { - [1666958851.516315][218195:218195] CHIP:DMG: DataVersion = 0xc4f72171, - [1666958851.516320][218195:218195] CHIP:DMG: AttributePathIB = - [1666958851.516326][218195:218195] CHIP:DMG: { - [1666958851.516332][218195:218195] CHIP:DMG: Endpoint = 0x9, - [1666958851.516338][218195:218195] CHIP:DMG: Cluster = 0x39, - [1666958851.516344][218195:218195] CHIP:DMG: Attribute = 0x0000_0005, - [1666958851.516349][218195:218195] CHIP:DMG: } - [1666958851.516356][218195:218195] CHIP:DMG: - [1666958851.516364][218195:218195] CHIP:DMG: Data = "Composed Power Source" (21 chars), - [1666958851.516372][218195:218195] CHIP:DMG: }, - [1666958851.516384][218195:218195] CHIP:DMG: - [1666958851.516390][218195:218195] CHIP:DMG: }, - [1666958851.516399][218195:218195] CHIP:DMG: - [1666958851.516404][218195:218195] CHIP:DMG: ], - [1666958851.516412][218195:218195] CHIP:DMG: - [1666958851.516417][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666958851.516422][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666958851.516426][218195:218195] CHIP:DMG: } + Verify the node-label attribute response with endpoint 9 On TH(bridge-app) Log: + + [1666958851.516264][218195:218195] CHIP:DMG: ReportDataMessage = + [1666958851.516270][218195:218195] CHIP:DMG: { + [1666958851.516278][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666958851.516286][218195:218195] CHIP:DMG: [ + [1666958851.516290][218195:218195] CHIP:DMG: AttributeReportIB = + [1666958851.516298][218195:218195] CHIP:DMG: { + [1666958851.516303][218195:218195] CHIP:DMG: AttributeDataIB = + [1666958851.516309][218195:218195] CHIP:DMG: { + [1666958851.516315][218195:218195] CHIP:DMG: DataVersion = 0xc4f72171, + [1666958851.516320][218195:218195] CHIP:DMG: AttributePathIB = + [1666958851.516326][218195:218195] CHIP:DMG: { + [1666958851.516332][218195:218195] CHIP:DMG: Endpoint = 0x9, + [1666958851.516338][218195:218195] CHIP:DMG: Cluster = 0x39, + [1666958851.516344][218195:218195] CHIP:DMG: Attribute = 0x0000_0005, + [1666958851.516349][218195:218195] CHIP:DMG: } + [1666958851.516356][218195:218195] CHIP:DMG: + [1666958851.516364][218195:218195] CHIP:DMG: Data = "Action Light 1" (14 chars), + [1666958851.516372][218195:218195] CHIP:DMG: }, + [1666958851.516384][218195:218195] CHIP:DMG: + [1666958851.516390][218195:218195] CHIP:DMG: }, + [1666958851.516399][218195:218195] CHIP:DMG: + [1666958851.516404][218195:218195] CHIP:DMG: ], + [1666958851.516412][218195:218195] CHIP:DMG: + [1666958851.516417][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666958851.516422][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666958851.516426][218195:218195] CHIP:DMG: } ./chip-tool bridgeddevicebasicinformation read node-label 1 10 - Verify the node-label attribute response with endpoint 10 On TH(bridge-app) Log: - - [1663925401.539430][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925401.539454][1588:1588] CHIP:DMG: { - [1663925401.539494][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925401.539526][1588:1588] CHIP:DMG: [ - [1663925401.539547][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925401.539595][1588:1588] CHIP:DMG: { - [1663925401.539623][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925401.539653][1588:1588] CHIP:DMG: { - [1663925401.539722][1588:1588] CHIP:DMG: DataVersion = 0x21cb142c, - [1663925401.539750][1588:1588] CHIP:DMG: AttributePathIB = - [1663925401.539799][1588:1588] CHIP:DMG: { - [1663925401.539828][1588:1588] CHIP:DMG: Endpoint = 0xa, - [1663925401.539884][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925401.539915][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925401.539943][1588:1588] CHIP:DMG: } - [1663925401.539993][1588:1588] CHIP:DMG: - [1663925401.540046][1588:1588] CHIP:DMG: Data = "Action Light 1" (14 chars), - [1663925401.540074][1588:1588] CHIP:DMG: }, - [1663925401.540121][1588:1588] CHIP:DMG: - [1663925401.540164][1588:1588] CHIP:DMG: }, - [1663925401.540193][1588:1588] CHIP:DMG: - [1663925401.540215][1588:1588] CHIP:DMG: ], - [1663925401.540260][1588:1588] CHIP:DMG: - [1663925401.540303][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925401.540345][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925401.540365][1588:1588] CHIP:DMG: } - [1663925401.540385][1588:1588] CHIP:DMG: - [1663925401.540668][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925401.540720][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925401.540740][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + Verify the node-label attribute response with endpoint 10 On TH(bridge-app) Log: + + [1663925401.539430][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925401.539454][1588:1588] CHIP:DMG: { + [1663925401.539494][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925401.539526][1588:1588] CHIP:DMG: [ + [1663925401.539547][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925401.539595][1588:1588] CHIP:DMG: { + [1663925401.539623][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925401.539653][1588:1588] CHIP:DMG: { + [1663925401.539722][1588:1588] CHIP:DMG: DataVersion = 0x21cb142c, + [1663925401.539750][1588:1588] CHIP:DMG: AttributePathIB = + [1663925401.539799][1588:1588] CHIP:DMG: { + [1663925401.539828][1588:1588] CHIP:DMG: Endpoint = 0xa, + [1663925401.539884][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663925401.539915][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663925401.539943][1588:1588] CHIP:DMG: } + [1663925401.539993][1588:1588] CHIP:DMG: + [1663925401.540046][1588:1588] CHIP:DMG: Data = "Action Light 2" (14 chars), + [1663925401.540074][1588:1588] CHIP:DMG: }, + [1663925401.540121][1588:1588] CHIP:DMG: + [1663925401.540164][1588:1588] CHIP:DMG: }, + [1663925401.540193][1588:1588] CHIP:DMG: + [1663925401.540215][1588:1588] CHIP:DMG: ], + [1663925401.540260][1588:1588] CHIP:DMG: + [1663925401.540303][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925401.540345][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925401.540365][1588:1588] CHIP:DMG: } + [1663925401.540385][1588:1588] CHIP:DMG: + [1663925401.540668][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925401.540720][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925401.540740][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + ./chip-tool bridgeddevicebasicinformation read node-label 1 11 - Verify the node-label attribute response with endpoint 11 On TH(bridge-app) Log: - - [1663925451.561534][1588:1588] CHIP:DMG: - [1663925451.561598][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925451.561622][1588:1588] CHIP:DMG: { - [1663925451.561640][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925451.561667][1588:1588] CHIP:DMG: [ - [1663925451.561769][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925451.561803][1588:1588] CHIP:DMG: { - [1663925451.561827][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925451.561856][1588:1588] CHIP:DMG: { - [1663925451.561886][1588:1588] CHIP:DMG: DataVersion = 0x9309014a, - [1663925451.561914][1588:1588] CHIP:DMG: AttributePathIB = - [1663925451.561943][1588:1588] CHIP:DMG: { - [1663925451.561975][1588:1588] CHIP:DMG: Endpoint = 0xb, - [1663925451.562007][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925451.562038][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925451.562068][1588:1588] CHIP:DMG: } - [1663925451.562101][1588:1588] CHIP:DMG: - [1663925451.562132][1588:1588] CHIP:DMG: Data = "Action Light 2" (14 chars), - [1663925451.562160][1588:1588] CHIP:DMG: }, - [1663925451.562192][1588:1588] CHIP:DMG: - [1663925451.562216][1588:1588] CHIP:DMG: }, - [1663925451.562244][1588:1588] CHIP:DMG: - [1663925451.562266][1588:1588] CHIP:DMG: ], - [1663925451.562293][1588:1588] CHIP:DMG: - [1663925451.562315][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925451.562337][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925451.562358][1588:1588] CHIP:DMG: } - [1663925451.562378][1588:1588] CHIP:DMG: - [1663925451.562569][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925451.562600][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925451.562621][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + Verify the node-label attribute response with endpoint 11 On TH(bridge-app) Log: + + [1663925451.561534][1588:1588] CHIP:DMG: + [1663925451.561598][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925451.561622][1588:1588] CHIP:DMG: { + [1663925451.561640][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925451.561667][1588:1588] CHIP:DMG: [ + [1663925451.561769][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925451.561803][1588:1588] CHIP:DMG: { + [1663925451.561827][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925451.561856][1588:1588] CHIP:DMG: { + [1663925451.561886][1588:1588] CHIP:DMG: DataVersion = 0x9309014a, + [1663925451.561914][1588:1588] CHIP:DMG: AttributePathIB = + [1663925451.561943][1588:1588] CHIP:DMG: { + [1663925451.561975][1588:1588] CHIP:DMG: Endpoint = 0xb, + [1663925451.562007][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663925451.562038][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663925451.562068][1588:1588] CHIP:DMG: } + [1663925451.562101][1588:1588] CHIP:DMG: + [1663925451.562132][1588:1588] CHIP:DMG: Data = "Action Light 3" (14 chars), + [1663925451.562160][1588:1588] CHIP:DMG: }, + [1663925451.562192][1588:1588] CHIP:DMG: + [1663925451.562216][1588:1588] CHIP:DMG: }, + [1663925451.562244][1588:1588] CHIP:DMG: + [1663925451.562266][1588:1588] CHIP:DMG: ], + [1663925451.562293][1588:1588] CHIP:DMG: + [1663925451.562315][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925451.562337][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925451.562358][1588:1588] CHIP:DMG: } + [1663925451.562378][1588:1588] CHIP:DMG: + [1663925451.562569][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925451.562600][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925451.562621][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] ./chip-tool bridgeddevicebasicinformation read node-label 1 12 - Verify the node-label attribute response with endpoint 12 On TH(bridge-app) Log: - - [1663925487.322435][1588:1588] CHIP:DMG: - [1663925487.322496][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925487.322518][1588:1588] CHIP:DMG: { - [1663925487.322535][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925487.322562][1588:1588] CHIP:DMG: [ - [1663925487.322583][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925487.322611][1588:1588] CHIP:DMG: { - [1663925487.322634][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925487.322662][1588:1588] CHIP:DMG: { - [1663925487.322691][1588:1588] CHIP:DMG: DataVersion = 0x41122f72, - [1663925487.322717][1588:1588] CHIP:DMG: AttributePathIB = - [1663925487.322743][1588:1588] CHIP:DMG: { - [1663925487.322774][1588:1588] CHIP:DMG: Endpoint = 0xc, - [1663925487.322803][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925487.322831][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925487.322858][1588:1588] CHIP:DMG: } - [1663925487.322886][1588:1588] CHIP:DMG: - [1663925487.322917][1588:1588] CHIP:DMG: Data = "Action Light 3" (14 chars), - [1663925487.322943][1588:1588] CHIP:DMG: }, - [1663925487.322971][1588:1588] CHIP:DMG: - [1663925487.322993][1588:1588] CHIP:DMG: }, - [1663925487.323020][1588:1588] CHIP:DMG: - [1663925487.323039][1588:1588] CHIP:DMG: ], - [1663925487.323064][1588:1588] CHIP:DMG: - [1663925487.323085][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925487.323106][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925487.323127][1588:1588] CHIP:DMG: } - [1663925487.323144][1588:1588] CHIP:DMG: - [1663925487.323323][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925487.323433][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925487.323453][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] - - ./chip-tool bridgeddevicebasicinformation read node-label 1 13 - - Verify the node-label attribute response with endpoint 13 On TH(bridge-app) Log: - - [1663925529.771162][1588:1588] CHIP:DMG: } - [1663925529.771179][1588:1588] CHIP:DMG: - [1663925529.771266][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925529.771291][1588:1588] CHIP:DMG: { - [1663925529.771309][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925529.771338][1588:1588] CHIP:DMG: [ - [1663925529.771359][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925529.771405][1588:1588] CHIP:DMG: { - [1663925529.771430][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925529.771476][1588:1588] CHIP:DMG: { - [1663925529.771509][1588:1588] CHIP:DMG: DataVersion = 0x14547f83, - [1663925529.771537][1588:1588] CHIP:DMG: AttributePathIB = - [1663925529.771568][1588:1588] CHIP:DMG: { - [1663925529.771596][1588:1588] CHIP:DMG: Endpoint = 0xd, - [1663925529.771627][1588:1588] CHIP:DMG: Cluster = 0x39, - [1663925529.771679][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, - [1663925529.771705][1588:1588] CHIP:DMG: } - [1663925529.771737][1588:1588] CHIP:DMG: - [1663925529.771766][1588:1588] CHIP:DMG: Data = "Action Light 4" (14 chars), - [1663925529.771813][1588:1588] CHIP:DMG: }, - [1663925529.771846][1588:1588] CHIP:DMG: - [1663925529.771869][1588:1588] CHIP:DMG: }, - [1663925529.771897][1588:1588] CHIP:DMG: - [1663925529.771942][1588:1588] CHIP:DMG: ], - [1663925529.771969][1588:1588] CHIP:DMG: - [1663925529.771990][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925529.772011][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925529.772053][1588:1588] CHIP:DMG: } - [1663925529.772071][1588:1588] CHIP:DMG: - [1663925529.772301][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925529.772330][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925529.772349][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] - [1663925529.772399][1588:1588] CHIP:DMG: All ReadHandler-s are clean, clear Glob + Verify the node-label attribute response with endpoint 12 On TH(bridge-app) Log: + + [1663925487.322435][1588:1588] CHIP:DMG: + [1663925487.322496][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925487.322518][1588:1588] CHIP:DMG: { + [1663925487.322535][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925487.322562][1588:1588] CHIP:DMG: [ + [1663925487.322583][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925487.322611][1588:1588] CHIP:DMG: { + [1663925487.322634][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925487.322662][1588:1588] CHIP:DMG: { + [1663925487.322691][1588:1588] CHIP:DMG: DataVersion = 0x41122f72, + [1663925487.322717][1588:1588] CHIP:DMG: AttributePathIB = + [1663925487.322743][1588:1588] CHIP:DMG: { + [1663925487.322774][1588:1588] CHIP:DMG: Endpoint = 0xc, + [1663925487.322803][1588:1588] CHIP:DMG: Cluster = 0x39, + [1663925487.322831][1588:1588] CHIP:DMG: Attribute = 0x0000_0005, + [1663925487.322858][1588:1588] CHIP:DMG: } + [1663925487.322886][1588:1588] CHIP:DMG: + [1663925487.322917][1588:1588] CHIP:DMG: Data = "Action Light 4" (14 chars), + [1663925487.322943][1588:1588] CHIP:DMG: }, + [1663925487.322971][1588:1588] CHIP:DMG: + [1663925487.322993][1588:1588] CHIP:DMG: }, + [1663925487.323020][1588:1588] CHIP:DMG: + [1663925487.323039][1588:1588] CHIP:DMG: ], + [1663925487.323064][1588:1588] CHIP:DMG: + [1663925487.323085][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925487.323106][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925487.323127][1588:1588] CHIP:DMG: } + [1663925487.323144][1588:1588] CHIP:DMG: + [1663925487.323323][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925487.323433][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925487.323453][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] disabled: true - label: @@ -6614,82 +5773,82 @@ tests: ./chip-tool onoff read on-off 1 3 - Verify onoff attribute response in TH(bridge-app) Log: - - [1666957927.222093][218195:218195] CHIP:IM: Received Read request - [1666957927.222155][218195:218195] CHIP:DMG: ReadRequestMessage = - [1666957927.222169][218195:218195] CHIP:DMG: { - [1666957927.222180][218195:218195] CHIP:DMG: AttributePathIBs = - [1666957927.222194][218195:218195] CHIP:DMG: [ - [1666957927.222205][218195:218195] CHIP:DMG: AttributePathIB = - [1666957927.222220][218195:218195] CHIP:DMG: { - [1666957927.222234][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666957927.222248][218195:218195] CHIP:DMG: Cluster = 0x6, - [1666957927.222263][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666957927.222275][218195:218195] CHIP:DMG: } - [1666957927.222290][218195:218195] CHIP:DMG: - [1666957927.222303][218195:218195] CHIP:DMG: ], - [1666957927.222319][218195:218195] CHIP:DMG: - [1666957927.222333][218195:218195] CHIP:DMG: isFabricFiltered = true, - [1666957927.222345][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666957927.222357][218195:218195] CHIP:DMG: }, - [1666957927.222411][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] - [1666957927.222466][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1666957927.222482][218195:218195] CHIP:DMG: Cluster 6, Attribute 0 is dirty - [1666957927.222494][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_0006 Endpoint=3 AttributeId=0x0000_0000 (expanded=0) - [1666957927.222512][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=3 p=v - [1666957927.222533][218195:218195] CHIP:DMG: AccessControl: allowed - [1666957927.222555][218195:218195] CHIP:DL: HandleReadOnOffAttribute: attrId=0, maxReadLength=1 - [1666957927.222577][218195:218195] CHIP:DMG: Sending report (payload has 35 bytes)... - [1666957927.222799][218195:218195] CHIP:EM: <<< [E:53351r M:13727602 (Ack:96464113)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) - [1666957927.222827][218195:218195] CHIP:IN: (S) Sending msg 13727602 on secure session with LSID: 51685 - [1666957927.223145][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:56786 | 13727602 | [Interaction Model (1) / Report Data (0x05) / Session = 25363 / Exchange = 53351] - [1666957927.223185][218195:218195] CHIP:DMG: Header Flags = - [1666957927.223202][218195:218195] CHIP:DMG: { - [1666957927.223229][218195:218195] CHIP:DMG: Exchange (0x06) = - [1666957927.223242][218195:218195] CHIP:DMG: { - [1666957927.223260][218195:218195] CHIP:DMG: AckMsg = 96464113 - [1666957927.223272][218195:218195] CHIP:DMG: NeedsAck = true - [1666957927.223290][218195:218195] CHIP:DMG: } - [1666957927.223313][218195:218195] CHIP:DMG: } - [1666957927.223327][218195:218195] CHIP:DMG: - [1666957927.223348][218195:218195] CHIP:DMG: Encrypted Payload (69 bytes) = - [1666957927.223363][218195:218195] CHIP:DMG: { - [1666957927.223374][218195:218195] CHIP:DMG: data = 001363007277d1008f49e047b2505b49e0dd0b226f40f828248add3b66d9d8270b0ab63fec452631d64abdfa04f0ba244338ae5b6fc6fc2d8eac78108f643211d6cb3c7450 - [1666957927.223387][218195:218195] CHIP:DMG: buffer_ptr = 94136416752992 - [1666957927.223397][218195:218195] CHIP:DMG: } - [1666957927.223407][218195:218195] CHIP:DMG: - [1666957927.223428][218195:218195] CHIP:DMG: Decrypted Payload (35 bytes) = - [1666957927.223439][218195:218195] CHIP:DMG: { - [1666957927.223450][218195:218195] CHIP:DMG: data = 1536011535012600adae46cf3701240203240306240400182802181818290424ff0118 - [1666957927.223461][218195:218195] CHIP:DMG: } - [1666957927.223478][218195:218195] CHIP:DMG: - [1666957927.223537][218195:218195] CHIP:DMG: ReportDataMessage = - [1666957927.223556][218195:218195] CHIP:DMG: { - [1666957927.223571][218195:218195] CHIP:DMG: AttributeReportIBs = - [1666957927.223595][218195:218195] CHIP:DMG: [ - [1666957927.223612][218195:218195] CHIP:DMG: AttributeReportIB = - [1666957927.223636][218195:218195] CHIP:DMG: { - [1666957927.223652][218195:218195] CHIP:DMG: AttributeDataIB = - [1666957927.223666][218195:218195] CHIP:DMG: { - [1666957927.223798][218195:218195] CHIP:DMG: DataVersion = 0xcf46aead, - [1666957927.223824][218195:218195] CHIP:DMG: AttributePathIB = - [1666957927.223844][218195:218195] CHIP:DMG: { - [1666957927.223859][218195:218195] CHIP:DMG: Endpoint = 0x3, - [1666957927.223874][218195:218195] CHIP:DMG: Cluster = 0x6, - [1666957927.223889][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, - [1666957927.223902][218195:218195] CHIP:DMG: } - [1666957927.223922][218195:218195] CHIP:DMG: - [1666957927.223948][218195:218195] CHIP:DMG: Data = false, - [1666957927.223965][218195:218195] CHIP:DMG: }, - [1666957927.223988][218195:218195] CHIP:DMG: - [1666957927.224005][218195:218195] CHIP:DMG: }, - [1666957927.224026][218195:218195] CHIP:DMG: - [1666957927.224042][218195:218195] CHIP:DMG: ], - [1666957927.224064][218195:218195] CHIP:DMG: - [1666957927.224081][218195:218195] CHIP:DMG: SuppressResponse = true, - [1666957927.224100][218195:218195] CHIP:DMG: InteractionModelRevision = 1 - [1666957927.224118][218195:218195] CHIP:DMG: } + Verify onoff attribute response in TH(bridge-app) Log: + + [1666957927.222093][218195:218195] CHIP:IM: Received Read request + [1666957927.222155][218195:218195] CHIP:DMG: ReadRequestMessage = + [1666957927.222169][218195:218195] CHIP:DMG: { + [1666957927.222180][218195:218195] CHIP:DMG: AttributePathIBs = + [1666957927.222194][218195:218195] CHIP:DMG: [ + [1666957927.222205][218195:218195] CHIP:DMG: AttributePathIB = + [1666957927.222220][218195:218195] CHIP:DMG: { + [1666957927.222234][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666957927.222248][218195:218195] CHIP:DMG: Cluster = 0x6, + [1666957927.222263][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666957927.222275][218195:218195] CHIP:DMG: } + [1666957927.222290][218195:218195] CHIP:DMG: + [1666957927.222303][218195:218195] CHIP:DMG: ], + [1666957927.222319][218195:218195] CHIP:DMG: + [1666957927.222333][218195:218195] CHIP:DMG: isFabricFiltered = true, + [1666957927.222345][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666957927.222357][218195:218195] CHIP:DMG: }, + [1666957927.222411][218195:218195] CHIP:DMG: IM RH moving to [GeneratingReports] + [1666957927.222466][218195:218195] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 + [1666957927.222482][218195:218195] CHIP:DMG: Cluster 6, Attribute 0 is dirty + [1666957927.222494][218195:218195] CHIP:DMG: Reading attribute: Cluster=0x0000_0006 Endpoint=3 AttributeId=0x0000_0000 (expanded=0) + [1666957927.222512][218195:218195] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=3 p=v + [1666957927.222533][218195:218195] CHIP:DMG: AccessControl: allowed + [1666957927.222555][218195:218195] CHIP:DL: HandleReadOnOffAttribute: attrId=0, maxReadLength=1 + [1666957927.222577][218195:218195] CHIP:DMG: Sending report (payload has 35 bytes)... + [1666957927.222799][218195:218195] CHIP:EM: <<< [E:53351r M:13727602 (Ack:96464113)] (S) Msg TX to 1:000000000001B669 [E0A2] --- Type 0001:05 (IM:ReportData) + [1666957927.222827][218195:218195] CHIP:IN: (S) Sending msg 13727602 on secure session with LSID: 51685 + [1666957927.223145][218195:218195] CHIP:DMG: >> to UDP:[fe80::485c:bace:6107:3682%wlp3s0]:56786 | 13727602 | [Interaction Model (1) / Report Data (0x05) / Session = 25363 / Exchange = 53351] + [1666957927.223185][218195:218195] CHIP:DMG: Header Flags = + [1666957927.223202][218195:218195] CHIP:DMG: { + [1666957927.223229][218195:218195] CHIP:DMG: Exchange (0x06) = + [1666957927.223242][218195:218195] CHIP:DMG: { + [1666957927.223260][218195:218195] CHIP:DMG: AckMsg = 96464113 + [1666957927.223272][218195:218195] CHIP:DMG: NeedsAck = true + [1666957927.223290][218195:218195] CHIP:DMG: } + [1666957927.223313][218195:218195] CHIP:DMG: } + [1666957927.223327][218195:218195] CHIP:DMG: + [1666957927.223348][218195:218195] CHIP:DMG: Encrypted Payload (69 bytes) = + [1666957927.223363][218195:218195] CHIP:DMG: { + [1666957927.223374][218195:218195] CHIP:DMG: data = 001363007277d1008f49e047b2505b49e0dd0b226f40f828248add3b66d9d8270b0ab63fec452631d64abdfa04f0ba244338ae5b6fc6fc2d8eac78108f643211d6cb3c7450 + [1666957927.223387][218195:218195] CHIP:DMG: buffer_ptr = 94136416752992 + [1666957927.223397][218195:218195] CHIP:DMG: } + [1666957927.223407][218195:218195] CHIP:DMG: + [1666957927.223428][218195:218195] CHIP:DMG: Decrypted Payload (35 bytes) = + [1666957927.223439][218195:218195] CHIP:DMG: { + [1666957927.223450][218195:218195] CHIP:DMG: data = 1536011535012600adae46cf3701240203240306240400182802181818290424ff0118 + [1666957927.223461][218195:218195] CHIP:DMG: } + [1666957927.223478][218195:218195] CHIP:DMG: + [1666957927.223537][218195:218195] CHIP:DMG: ReportDataMessage = + [1666957927.223556][218195:218195] CHIP:DMG: { + [1666957927.223571][218195:218195] CHIP:DMG: AttributeReportIBs = + [1666957927.223595][218195:218195] CHIP:DMG: [ + [1666957927.223612][218195:218195] CHIP:DMG: AttributeReportIB = + [1666957927.223636][218195:218195] CHIP:DMG: { + [1666957927.223652][218195:218195] CHIP:DMG: AttributeDataIB = + [1666957927.223666][218195:218195] CHIP:DMG: { + [1666957927.223798][218195:218195] CHIP:DMG: DataVersion = 0xcf46aead, + [1666957927.223824][218195:218195] CHIP:DMG: AttributePathIB = + [1666957927.223844][218195:218195] CHIP:DMG: { + [1666957927.223859][218195:218195] CHIP:DMG: Endpoint = 0x3, + [1666957927.223874][218195:218195] CHIP:DMG: Cluster = 0x6, + [1666957927.223889][218195:218195] CHIP:DMG: Attribute = 0x0000_0000, + [1666957927.223902][218195:218195] CHIP:DMG: } + [1666957927.223922][218195:218195] CHIP:DMG: + [1666957927.223948][218195:218195] CHIP:DMG: Data = false, + [1666957927.223965][218195:218195] CHIP:DMG: }, + [1666957927.223988][218195:218195] CHIP:DMG: + [1666957927.224005][218195:218195] CHIP:DMG: }, + [1666957927.224026][218195:218195] CHIP:DMG: + [1666957927.224042][218195:218195] CHIP:DMG: ], + [1666957927.224064][218195:218195] CHIP:DMG: + [1666957927.224081][218195:218195] CHIP:DMG: SuppressResponse = true, + [1666957927.224100][218195:218195] CHIP:DMG: InteractionModelRevision = 1 + [1666957927.224118][218195:218195] CHIP:DMG: } disabled: true - label: @@ -6798,37 +5957,37 @@ tests: Verify MeasuredValue attribute response on TH(bridge-app) Log: - [[1663925677.995424][1588:1588] CHIP:DMG: - [1663925677.995497][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925677.995521][1588:1588] CHIP:DMG: { - [1663925677.995549][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925677.995576][1588:1588] CHIP:DMG: [ - [1663925677.995607][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925677.995638][1588:1588] CHIP:DMG: { - [1663925677.995671][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925677.995697][1588:1588] CHIP:DMG: { - [1663925677.995736][1588:1588] CHIP:DMG: DataVersion = 0xf0f8afb8, - [1663925677.995767][1588:1588] CHIP:DMG: AttributePathIB = - [1663925677.995805][1588:1588] CHIP:DMG: { - [1663925677.995836][1588:1588] CHIP:DMG: Endpoint = 0x4, - [1663925677.995875][1588:1588] CHIP:DMG: Cluster = 0x402, - [1663925677.995907][1588:1588] CHIP:DMG: Attribute = 0x0000_0000, - [1663925677.995945][1588:1588] CHIP:DMG: } - [1663925677.995977][1588:1588] CHIP:DMG: - [1663925677.996019][1588:1588] CHIP:DMG: Data = 100, - [1663925677.996048][1588:1588] CHIP:DMG: }, - [1663925677.996087][1588:1588] CHIP:DMG: - [1663925677.996112][1588:1588] CHIP:DMG: }, - [1663925677.996149][1588:1588] CHIP:DMG: - [1663925677.996171][1588:1588] CHIP:DMG: ], - [1663925677.996208][1588:1588] CHIP:DMG: - [1663925677.996230][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925677.996260][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925677.996282][1588:1588] CHIP:DMG: } - [1663925677.996301][1588:1588] CHIP:DMG: - [1663925677.996528][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925677.996561][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925677.996585][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + [[1663925677.995424][1588:1588] CHIP:DMG: + [1663925677.995497][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925677.995521][1588:1588] CHIP:DMG: { + [1663925677.995549][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925677.995576][1588:1588] CHIP:DMG: [ + [1663925677.995607][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925677.995638][1588:1588] CHIP:DMG: { + [1663925677.995671][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925677.995697][1588:1588] CHIP:DMG: { + [1663925677.995736][1588:1588] CHIP:DMG: DataVersion = 0xf0f8afb8, + [1663925677.995767][1588:1588] CHIP:DMG: AttributePathIB = + [1663925677.995805][1588:1588] CHIP:DMG: { + [1663925677.995836][1588:1588] CHIP:DMG: Endpoint = 0x4, + [1663925677.995875][1588:1588] CHIP:DMG: Cluster = 0x402, + [1663925677.995907][1588:1588] CHIP:DMG: Attribute = 0x0000_0000, + [1663925677.995945][1588:1588] CHIP:DMG: } + [1663925677.995977][1588:1588] CHIP:DMG: + [1663925677.996019][1588:1588] CHIP:DMG: Data = 100, + [1663925677.996048][1588:1588] CHIP:DMG: }, + [1663925677.996087][1588:1588] CHIP:DMG: + [1663925677.996112][1588:1588] CHIP:DMG: }, + [1663925677.996149][1588:1588] CHIP:DMG: + [1663925677.996171][1588:1588] CHIP:DMG: ], + [1663925677.996208][1588:1588] CHIP:DMG: + [1663925677.996230][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925677.996260][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925677.996282][1588:1588] CHIP:DMG: } + [1663925677.996301][1588:1588] CHIP:DMG: + [1663925677.996528][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925677.996561][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925677.996585][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] disabled: true - label: @@ -6885,39 +6044,39 @@ tests: verification: | ./chip-tool powersource read bat-charge-level 1 9 - Verify BatChargeLevel attribute response on TH(bridge-app) Log: - - [1663925822.845528][1588:1588] CHIP:DMG: - [1663925822.845587][1588:1588] CHIP:DMG: ReportDataMessage = - [1663925822.845609][1588:1588] CHIP:DMG: { - [1663925822.845627][1588:1588] CHIP:DMG: AttributeReportIBs = - [1663925822.845652][1588:1588] CHIP:DMG: [ - [1663925822.845672][1588:1588] CHIP:DMG: AttributeReportIB = - [1663925822.845697][1588:1588] CHIP:DMG: { - [1663925822.845720][1588:1588] CHIP:DMG: AttributeDataIB = - [1663925822.845747][1588:1588] CHIP:DMG: { - [1663925822.845775][1588:1588] CHIP:DMG: DataVersion = 0xc7a1a64e, - [1663925822.845801][1588:1588] CHIP:DMG: AttributePathIB = - [1663925822.845829][1588:1588] CHIP:DMG: { - [1663925822.845859][1588:1588] CHIP:DMG: Endpoint = 0x9, - [1663925822.845888][1588:1588] CHIP:DMG: Cluster = 0x2f, - [1663925822.845919][1588:1588] CHIP:DMG: Attribute = 0x0000_000E, - [1663925822.845946][1588:1588] CHIP:DMG: } - [1663925822.845978][1588:1588] CHIP:DMG: - [1663925822.846007][1588:1588] CHIP:DMG: Data = 58, - [1663925822.846035][1588:1588] CHIP:DMG: }, - [1663925822.846063][1588:1588] CHIP:DMG: - [1663925822.846086][1588:1588] CHIP:DMG: }, - [1663925822.846112][1588:1588] CHIP:DMG: - [1663925822.846131][1588:1588] CHIP:DMG: ], - [1663925822.846156][1588:1588] CHIP:DMG: - [1663925822.846176][1588:1588] CHIP:DMG: SuppressResponse = true, - [1663925822.846201][1588:1588] CHIP:DMG: InteractionModelRevision = 1 - [1663925822.846221][1588:1588] CHIP:DMG: } - [1663925822.846238][1588:1588] CHIP:DMG: - [1663925822.846416][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 - [1663925822.846442][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages - [1663925822.846461][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] + Verify BatChargeLevel attribute response on TH(bridge-app) Log: + + [1663925822.845528][1588:1588] CHIP:DMG: + [1663925822.845587][1588:1588] CHIP:DMG: ReportDataMessage = + [1663925822.845609][1588:1588] CHIP:DMG: { + [1663925822.845627][1588:1588] CHIP:DMG: AttributeReportIBs = + [1663925822.845652][1588:1588] CHIP:DMG: [ + [1663925822.845672][1588:1588] CHIP:DMG: AttributeReportIB = + [1663925822.845697][1588:1588] CHIP:DMG: { + [1663925822.845720][1588:1588] CHIP:DMG: AttributeDataIB = + [1663925822.845747][1588:1588] CHIP:DMG: { + [1663925822.845775][1588:1588] CHIP:DMG: DataVersion = 0xc7a1a64e, + [1663925822.845801][1588:1588] CHIP:DMG: AttributePathIB = + [1663925822.845829][1588:1588] CHIP:DMG: { + [1663925822.845859][1588:1588] CHIP:DMG: Endpoint = 0x9, + [1663925822.845888][1588:1588] CHIP:DMG: Cluster = 0x2f, + [1663925822.845919][1588:1588] CHIP:DMG: Attribute = 0x0000_000E, + [1663925822.845946][1588:1588] CHIP:DMG: } + [1663925822.845978][1588:1588] CHIP:DMG: + [1663925822.846007][1588:1588] CHIP:DMG: Data = 58, + [1663925822.846035][1588:1588] CHIP:DMG: }, + [1663925822.846063][1588:1588] CHIP:DMG: + [1663925822.846086][1588:1588] CHIP:DMG: }, + [1663925822.846112][1588:1588] CHIP:DMG: + [1663925822.846131][1588:1588] CHIP:DMG: ], + [1663925822.846156][1588:1588] CHIP:DMG: + [1663925822.846176][1588:1588] CHIP:DMG: SuppressResponse = true, + [1663925822.846201][1588:1588] CHIP:DMG: InteractionModelRevision = 1 + [1663925822.846221][1588:1588] CHIP:DMG: } + [1663925822.846238][1588:1588] CHIP:DMG: + [1663925822.846416][1588:1588] CHIP:DMG: OnReportConfirm: NumReports = 0 + [1663925822.846442][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages + [1663925822.846461][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] disabled: true - label: @@ -7039,6 +6198,7 @@ tests: verification: | Verify on TH(bridge-app) Log + b [1659089470.077297][12236:12241] CHIP:DL: Device[Light 1]: New Name="Light 1b" disabled: True @@ -7051,7 +6211,7 @@ tests: ./chip-tool descriptor read parts-list 1 0 - Verify the PartList list attribute response with 13 entries on TH(bridge-app) Log: + Verify the PartList list attribute response with 12 entries on TH(bridge-app) Log: [[1663926036.463802][1588:1588] CHIP:DMG: [1663926036.464013][1588:1588] CHIP:DMG: ReportDataMessage = @@ -7289,24 +6449,6 @@ tests: [1663926036.470365][1588:1588] CHIP:DMG: } [1663926036.470395][1588:1588] CHIP:DMG: [1663926036.470421][1588:1588] CHIP:DMG: Data = 13, - [1663926036.470446][1588:1588] CHIP:DMG: }, - [1663926036.470473][1588:1588] CHIP:DMG: - [1663926036.470495][1588:1588] CHIP:DMG: }, - [1663926036.470526][1588:1588] CHIP:DMG: - [1663926036.470545][1588:1588] CHIP:DMG: AttributeReportIB = - [1663926036.470572][1588:1588] CHIP:DMG: { - [1663926036.470594][1588:1588] CHIP:DMG: AttributeDataIB = - [1663926036.470618][1588:1588] CHIP:DMG: { - [1663926036.470646][1588:1588] CHIP:DMG: DataVersion = 0x6f679aa8, - [1663926036.470672][1588:1588] CHIP:DMG: AttributePathIB = - [1663926036.470701][1588:1588] CHIP:DMG: { - [1663926036.470730][1588:1588] CHIP:DMG: Endpoint = 0x0, - [1663926036.470756][1588:1588] CHIP:DMG: Cluster = 0x1d, - [1663926036.470784][1588:1588] CHIP:DMG: Attribute = 0x0000_0003, - [1663926036.470813][1588:1588] CHIP:DMG: ListIndex = Null, - [1663926036.470840][1588:1588] CHIP:DMG: } - [1663926036.470868][1588:1588] CHIP:DMG: - [1663926036.470898][1588:1588] CHIP:DMG: Data = 14, [1663926036.470921][1588:1588] CHIP:DMG: }, [1663926036.470948][1588:1588] CHIP:DMG: [1663926036.470970][1588:1588] CHIP:DMG: }, @@ -7544,24 +6686,6 @@ tests: [1663926082.697464][1588:1588] CHIP:DMG: } [1663926082.697498][1588:1588] CHIP:DMG: [1663926082.697529][1588:1588] CHIP:DMG: Data = 13, - [1663926082.697557][1588:1588] CHIP:DMG: }, - [1663926082.697587][1588:1588] CHIP:DMG: - [1663926082.697612][1588:1588] CHIP:DMG: }, - [1663926082.697646][1588:1588] CHIP:DMG: - [1663926082.697668][1588:1588] CHIP:DMG: AttributeReportIB = - [1663926082.697698][1588:1588] CHIP:DMG: { - [1663926082.697723][1588:1588] CHIP:DMG: AttributeDataIB = - [1663926082.697752][1588:1588] CHIP:DMG: { - [1663926082.697780][1588:1588] CHIP:DMG: DataVersion = 0x2b116729, - [1663926082.697812][1588:1588] CHIP:DMG: AttributePathIB = - [1663926082.697841][1588:1588] CHIP:DMG: { - [1663926082.697872][1588:1588] CHIP:DMG: Endpoint = 0x1, - [1663926082.697901][1588:1588] CHIP:DMG: Cluster = 0x1d, - [1663926082.697939][1588:1588] CHIP:DMG: Attribute = 0x0000_0003, - [1663926082.697970][1588:1588] CHIP:DMG: ListIndex = Null, - [1663926082.697997][1588:1588] CHIP:DMG: } - [1663926082.698031][1588:1588] CHIP:DMG: - [1663926082.698064][1588:1588] CHIP:DMG: Data = 14, [1663926082.698096][1588:1588] CHIP:DMG: }, [1663926082.698126][1588:1588] CHIP:DMG: [1663926082.698151][1588:1588] CHIP:DMG: }, @@ -7576,9 +6700,9 @@ tests: [1663926082.698681][1588:1588] CHIP:DMG: ReportsInFlight = 0 with readHandler 0, RE has no more messages [1663926082.698702][1588:1588] CHIP:DMG: IM RH moving to [AwaitingDestruction] - ./chip-tool descriptor read parts-list 1 14 + ./chip-tool descriptor read parts-list 1 13 - Verify PartList attribute response with endpoint 14 on TH(bridge-app) Log + Verify PartList attribute response with endpoint 13 on TH(bridge-app) Log [1659972886.385225][3652:3652] CHIP:IM: Received Read request [1659972886.385307][3652:3652] CHIP:DMG: ReadRequestMessage = @@ -7587,7 +6711,7 @@ tests: [1659972886.385413][3652:3652] CHIP:DMG: [ [1659972886.385438][3652:3652] CHIP:DMG: AttributePathIB = [1659972886.385482][3652:3652] CHIP:DMG: { - [1659972886.385511][3652:3652] CHIP:DMG: Endpoint = 0x14, + [1659972886.385511][3652:3652] CHIP:DMG: Endpoint = 0xd, [1659972886.385555][3652:3652] CHIP:DMG: Cluster = 0x1d, [1659972886.385596][3652:3652] CHIP:DMG: Attribute = 0x0000_0003, [1659972886.385630][3652:3652] CHIP:DMG: } @@ -7601,9 +6725,9 @@ tests: [1659972886.386016][3652:3652] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 [1659972886.386056][3652:3652] CHIP:DMG: Cluster 1d, Attribute 3 is dirty - ./chip-tool descriptor read device-type-list 1 14 + ./chip-tool descriptor read device-type-list 1 13 - Verify DeviceTypeList attribute response with endpoint 14 on TH(bridge-app) Log + Verify DeviceTypeList attribute response with endpoint 13 on TH(bridge-app) Log [1659972694.732632][3652:3652] CHIP:IM: Received Read request [1659972694.732712][3652:3652] CHIP:DMG: ReadRequestMessage = @@ -7612,7 +6736,7 @@ tests: [1659972694.732800][3652:3652] CHIP:DMG: [ [1659972694.732824][3652:3652] CHIP:DMG: AttributePathIB = [1659972694.732866][3652:3652] CHIP:DMG: { - [1659972694.732905][3652:3652] CHIP:DMG: Endpoint = 0x14, + [1659972694.732905][3652:3652] CHIP:DMG: Endpoint = 0xd, [1659972694.732940][3652:3652] CHIP:DMG: Cluster = 0x1d, [1659972694.732980][3652:3652] CHIP:DMG: Attribute = 0x0000_0000, [1659972694.733009][3652:3652] CHIP:DMG: } @@ -7649,7 +6773,7 @@ tests: ./chip-tool descriptor read parts-list 1 0 - Verify PartList attribute response with 12 entries on TH(bridge-app) Log + Verify PartList attribute response with 11 entries on TH(bridge-app) Log [[1663926036.463802][1588:1588] CHIP:DMG: [1663926036.464013][1588:1588] CHIP:DMG: ReportDataMessage = @@ -7869,24 +6993,6 @@ tests: [1663926036.470365][1588:1588] CHIP:DMG: } [1663926036.470395][1588:1588] CHIP:DMG: [1663926036.470421][1588:1588] CHIP:DMG: Data = 13, - [1663926036.470446][1588:1588] CHIP:DMG: }, - [1663926036.470473][1588:1588] CHIP:DMG: - [1663926036.470495][1588:1588] CHIP:DMG: }, - [1663926036.470526][1588:1588] CHIP:DMG: - [1663926036.470545][1588:1588] CHIP:DMG: AttributeReportIB = - [1663926036.470572][1588:1588] CHIP:DMG: { - [1663926036.470594][1588:1588] CHIP:DMG: AttributeDataIB = - [1663926036.470618][1588:1588] CHIP:DMG: { - [1663926036.470646][1588:1588] CHIP:DMG: DataVersion = 0x6f679aa8, - [1663926036.470672][1588:1588] CHIP:DMG: AttributePathIB = - [1663926036.470701][1588:1588] CHIP:DMG: { - [1663926036.470730][1588:1588] CHIP:DMG: Endpoint = 0x0, - [1663926036.470756][1588:1588] CHIP:DMG: Cluster = 0x1d, - [1663926036.470784][1588:1588] CHIP:DMG: Attribute = 0x0000_0003, - [1663926036.470813][1588:1588] CHIP:DMG: ListIndex = Null, - [1663926036.470840][1588:1588] CHIP:DMG: } - [1663926036.470868][1588:1588] CHIP:DMG: - [1663926036.470898][1588:1588] CHIP:DMG: Data = 14, [1663926036.470921][1588:1588] CHIP:DMG: }, [1663926036.470948][1588:1588] CHIP:DMG: [1663926036.470970][1588:1588] CHIP:DMG: }, @@ -7904,7 +7010,7 @@ tests: ./chip-tool descriptor read parts-list 1 1 - Verify part list attribute response contains 11 entries on TH(bridge-app) Log + Verify part list attribute response contains 10 entries on TH(bridge-app) Log [1663926082.690768][1588:1588] CHIP:DMG: [1663926082.690991][1588:1588] CHIP:DMG: ReportDataMessage = @@ -8106,24 +7212,6 @@ tests: [1663926082.697464][1588:1588] CHIP:DMG: } [1663926082.697498][1588:1588] CHIP:DMG: [1663926082.697529][1588:1588] CHIP:DMG: Data = 13, - [1663926082.697557][1588:1588] CHIP:DMG: }, - [1663926082.697587][1588:1588] CHIP:DMG: - [1663926082.697612][1588:1588] CHIP:DMG: }, - [1663926082.697646][1588:1588] CHIP:DMG: - [1663926082.697668][1588:1588] CHIP:DMG: AttributeReportIB = - [1663926082.697698][1588:1588] CHIP:DMG: { - [1663926082.697723][1588:1588] CHIP:DMG: AttributeDataIB = - [1663926082.697752][1588:1588] CHIP:DMG: { - [1663926082.697780][1588:1588] CHIP:DMG: DataVersion = 0x2b116729, - [1663926082.697812][1588:1588] CHIP:DMG: AttributePathIB = - [1663926082.697841][1588:1588] CHIP:DMG: { - [1663926082.697872][1588:1588] CHIP:DMG: Endpoint = 0x1, - [1663926082.697901][1588:1588] CHIP:DMG: Cluster = 0x1d, - [1663926082.697939][1588:1588] CHIP:DMG: Attribute = 0x0000_0003, - [1663926082.697970][1588:1588] CHIP:DMG: ListIndex = Null, - [1663926082.697997][1588:1588] CHIP:DMG: } - [1663926082.698031][1588:1588] CHIP:DMG: - [1663926082.698064][1588:1588] CHIP:DMG: Data = 14, [1663926082.698096][1588:1588] CHIP:DMG: }, [1663926082.698126][1588:1588] CHIP:DMG: [1663926082.698151][1588:1588] CHIP:DMG: }, diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml index 123fcda3674535..b95c22cf3e2c4d 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml @@ -132,79 +132,77 @@ tests: Verify ServerList entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, Here ServerList entries are 69. - [1689762254.556272][4639:4641] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1164998279 - [1689762254.556406][4639:4641] CHIP:TOO: ServerList: 71 entries - [1689762254.556437][4639:4641] CHIP:TOO: [1]: 3 - [1689762254.556462][4639:4641] CHIP:TOO: [2]: 4 - [1689762254.556486][4639:4641] CHIP:TOO: [3]: 5 - [1689762254.556511][4639:4641] CHIP:TOO: [4]: 6 - [1689762254.556535][4639:4641] CHIP:TOO: [5]: 7 - [1689762254.556559][4639:4641] CHIP:TOO: [6]: 8 - [1689762254.556583][4639:4641] CHIP:TOO: [7]: 15 - [1689762254.556608][4639:4641] CHIP:TOO: [8]: 29 - [1689762254.556632][4639:4641] CHIP:TOO: [9]: 30 - [1689762254.556657][4639:4641] CHIP:TOO: [10]: 37 - [1689762254.556681][4639:4641] CHIP:TOO: [11]: 47 - [1689762254.556705][4639:4641] CHIP:TOO: [12]: 59 - [1689762254.556730][4639:4641] CHIP:TOO: [13]: 64 - [1689762254.556782][4639:4641] CHIP:TOO: [14]: 65 - [1689762254.556810][4639:4641] CHIP:TOO: [15]: 69 - [1689762254.556834][4639:4641] CHIP:TOO: [16]: 80 - [1689762254.556858][4639:4641] CHIP:TOO: [17]: 87 - [1689762254.556883][4639:4641] CHIP:TOO: [18]: 91 - [1689762254.556907][4639:4641] CHIP:TOO: [19]: 92 - [1689762254.556931][4639:4641] CHIP:TOO: [20]: 96 - [1689762254.556955][4639:4641] CHIP:TOO: [21]: 113 - [1689762254.556980][4639:4641] CHIP:TOO: [22]: 114 - [1689762254.557004][4639:4641] CHIP:TOO: [23]: 115 - [1689762254.557028][4639:4641] CHIP:TOO: [24]: 116 - [1689762254.557052][4639:4641] CHIP:TOO: [25]: 117 - [1689762254.557077][4639:4641] CHIP:TOO: [26]: 118 - [1689762254.557101][4639:4641] CHIP:TOO: [27]: 119 - [1689762254.557125][4639:4641] CHIP:TOO: [28]: 120 - [1689762254.557149][4639:4641] CHIP:TOO: [29]: 121 - [1689762254.557173][4639:4641] CHIP:TOO: [30]: 122 - [1689762254.557198][4639:4641] CHIP:TOO: [31]: 123 - [1689762254.557222][4639:4641] CHIP:TOO: [32]: 124 - [1689762254.557246][4639:4641] CHIP:TOO: [33]: 257 - [1689762254.557270][4639:4641] CHIP:TOO: [34]: 258 - [1689762254.557295][4639:4641] CHIP:TOO: [35]: 259 - [1689762254.557319][4639:4641] CHIP:TOO: [36]: 512 - [1689762254.557343][4639:4641] CHIP:TOO: [37]: 513 - [1689762254.557368][4639:4641] CHIP:TOO: [38]: 514 - [1689762254.557392][4639:4641] CHIP:TOO: [39]: 516 - [1689762254.557416][4639:4641] CHIP:TOO: [40]: 768 - [1689762254.557440][4639:4641] CHIP:TOO: [41]: 769 - [1689762254.557465][4639:4641] CHIP:TOO: [42]: 1024 - [1689762254.557489][4639:4641] CHIP:TOO: [43]: 1026 - [1689762254.557514][4639:4641] CHIP:TOO: [44]: 1027 - [1689762254.557538][4639:4641] CHIP:TOO: [45]: 1028 - [1689762254.557562][4639:4641] CHIP:TOO: [46]: 1029 - [1689762254.557587][4639:4641] CHIP:TOO: [47]: 1030 - [1689762254.557611][4639:4641] CHIP:TOO: [48]: 1036 - [1689762254.557635][4639:4641] CHIP:TOO: [49]: 1037 - [1689762254.557659][4639:4641] CHIP:TOO: [50]: 1043 - [1689762254.557684][4639:4641] CHIP:TOO: [51]: 1045 - [1689762254.557708][4639:4641] CHIP:TOO: [52]: 1066 - [1689762254.557732][4639:4641] CHIP:TOO: [53]: 1067 - [1689762254.557757][4639:4641] CHIP:TOO: [54]: 1068 - [1689762254.557781][4639:4641] CHIP:TOO: [55]: 1069 - [1689762254.557805][4639:4641] CHIP:TOO: [56]: 1070 - [1689762254.557829][4639:4641] CHIP:TOO: [57]: 1071 - [1689762254.557853][4639:4641] CHIP:TOO: [58]: 1283 - [1689762254.557878][4639:4641] CHIP:TOO: [59]: 1284 - [1689762254.557902][4639:4641] CHIP:TOO: [60]: 1285 - [1689762254.557926][4639:4641] CHIP:TOO: [61]: 1286 - [1689762254.557950][4639:4641] CHIP:TOO: [62]: 1287 - [1689762254.557975][4639:4641] CHIP:TOO: [63]: 1288 - [1689762254.557999][4639:4641] CHIP:TOO: [64]: 1289 - [1689762254.558024][4639:4641] CHIP:TOO: [65]: 1290 - [1689762254.558048][4639:4641] CHIP:TOO: [66]: 1291 - [1689762254.558072][4639:4641] CHIP:TOO: [67]: 1292 - [1689762254.558097][4639:4641] CHIP:TOO: [68]: 1293 - [1689762254.558121][4639:4641] CHIP:TOO: [69]: 1294 - [1689762254.558145][4639:4641] CHIP:TOO: [70]: 2820 - [1689762254.558170][4639:4641] CHIP:TOO: [71]: 4294048773 + [1692618512.334390][31683:31685] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 2832593371 + [1692618512.334424][31683:31685] CHIP:TOO: ServerList: 69 entries + [1692618512.334429][31683:31685] CHIP:TOO: [1]: 3 + [1692618512.334432][31683:31685] CHIP:TOO: [2]: 4 + [1692618512.334435][31683:31685] CHIP:TOO: [3]: 5 + [1692618512.334438][31683:31685] CHIP:TOO: [4]: 6 + [1692618512.334441][31683:31685] CHIP:TOO: [5]: 7 + [1692618512.334443][31683:31685] CHIP:TOO: [6]: 8 + [1692618512.334446][31683:31685] CHIP:TOO: [7]: 15 + [1692618512.334449][31683:31685] CHIP:TOO: [8]: 29 + [1692618512.334452][31683:31685] CHIP:TOO: [9]: 30 + [1692618512.334455][31683:31685] CHIP:TOO: [10]: 37 + [1692618512.334458][31683:31685] CHIP:TOO: [11]: 47 + [1692618512.334461][31683:31685] CHIP:TOO: [12]: 59 + [1692618512.334464][31683:31685] CHIP:TOO: [13]: 64 + [1692618512.334467][31683:31685] CHIP:TOO: [14]: 65 + [1692618512.334469][31683:31685] CHIP:TOO: [15]: 69 + [1692618512.334472][31683:31685] CHIP:TOO: [16]: 80 + [1692618512.334475][31683:31685] CHIP:TOO: [17]: 81 + [1692618512.334478][31683:31685] CHIP:TOO: [18]: 82 + [1692618512.334481][31683:31685] CHIP:TOO: [19]: 84 + [1692618512.334483][31683:31685] CHIP:TOO: [20]: 85 + [1692618512.334486][31683:31685] CHIP:TOO: [21]: 86 + [1692618512.334489][31683:31685] CHIP:TOO: [22]: 87 + [1692618512.334492][31683:31685] CHIP:TOO: [23]: 89 + [1692618512.334495][31683:31685] CHIP:TOO: [24]: 91 + [1692618512.334498][31683:31685] CHIP:TOO: [25]: 92 + [1692618512.334501][31683:31685] CHIP:TOO: [26]: 93 + [1692618512.334504][31683:31685] CHIP:TOO: [27]: 96 + [1692618512.334506][31683:31685] CHIP:TOO: [28]: 97 + [1692618512.334509][31683:31685] CHIP:TOO: [29]: 113 + [1692618512.334512][31683:31685] CHIP:TOO: [30]: 114 + [1692618512.334515][31683:31685] CHIP:TOO: [31]: 257 + [1692618512.334517][31683:31685] CHIP:TOO: [32]: 258 + [1692618512.334520][31683:31685] CHIP:TOO: [33]: 259 + [1692618512.334523][31683:31685] CHIP:TOO: [34]: 512 + [1692618512.334526][31683:31685] CHIP:TOO: [35]: 513 + [1692618512.334529][31683:31685] CHIP:TOO: [36]: 514 + [1692618512.334532][31683:31685] CHIP:TOO: [37]: 516 + [1692618512.334535][31683:31685] CHIP:TOO: [38]: 768 + [1692618512.334538][31683:31685] CHIP:TOO: [39]: 769 + [1692618512.334541][31683:31685] CHIP:TOO: [40]: 1024 + [1692618512.334543][31683:31685] CHIP:TOO: [41]: 1026 + [1692618512.334546][31683:31685] CHIP:TOO: [42]: 1027 + [1692618512.334549][31683:31685] CHIP:TOO: [43]: 1028 + [1692618512.334552][31683:31685] CHIP:TOO: [44]: 1029 + [1692618512.334555][31683:31685] CHIP:TOO: [45]: 1030 + [1692618512.334558][31683:31685] CHIP:TOO: [46]: 1036 + [1692618512.334560][31683:31685] CHIP:TOO: [47]: 1037 + [1692618512.334563][31683:31685] CHIP:TOO: [48]: 1043 + [1692618512.334566][31683:31685] CHIP:TOO: [49]: 1045 + [1692618512.334569][31683:31685] CHIP:TOO: [50]: 1066 + [1692618512.334572][31683:31685] CHIP:TOO: [51]: 1067 + [1692618512.334575][31683:31685] CHIP:TOO: [52]: 1068 + [1692618512.334578][31683:31685] CHIP:TOO: [53]: 1069 + [1692618512.334580][31683:31685] CHIP:TOO: [54]: 1070 + [1692618512.334583][31683:31685] CHIP:TOO: [55]: 1071 + [1692618512.334586][31683:31685] CHIP:TOO: [56]: 1283 + [1692618512.334589][31683:31685] CHIP:TOO: [57]: 1284 + [1692618512.334592][31683:31685] CHIP:TOO: [58]: 1285 + [1692618512.334595][31683:31685] CHIP:TOO: [59]: 1286 + [1692618512.334597][31683:31685] CHIP:TOO: [60]: 1287 + [1692618512.334600][31683:31685] CHIP:TOO: [61]: 1288 + [1692618512.334603][31683:31685] CHIP:TOO: [62]: 1289 + [1692618512.334606][31683:31685] CHIP:TOO: [63]: 1290 + [1692618512.334609][31683:31685] CHIP:TOO: [64]: 1291 + [1692618512.334612][31683:31685] CHIP:TOO: [65]: 1292 + [1692618512.334614][31683:31685] CHIP:TOO: [66]: 1293 + [1692618512.334617][31683:31685] CHIP:TOO: [67]: 1294 + [1692618512.334620][31683:31685] CHIP:TOO: [68]: 2820 + [1692618512.334623][31683:31685] CHIP:TOO: [69]: 4294048773 disabled: true - label: "Step 3: TH reads 'ClientList' attribute" @@ -243,7 +241,7 @@ tests: [1672919326.178777][33468:33470] CHIP:TOO: [2]: 2 disabled: true - - label: "Step 5: TH reads from the DUT the 'TagList' attribute." + - label: "Step 6: TH reads from the DUT the 'TagList' attribute." PICS: DESC.S.A0004 verification: | ./chip-tool descriptor read tag-list 1 0 diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml index ef5aa7eeca2010..4e0904126d1187 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 88.2.1. [TC-DGGEN-2.1] Attributes [DUT as Server] @@ -22,6 +21,14 @@ config: nodeId: 0x12344321 cluster: "General Diagnostics" endpoint: 0 + timeout: 11500 + + TEST_EVENT_ENABLE_KEY: + type: octet_string + defaultValue: "hex:00112233445566778899aabbccddeeff" + TEST_EVENT_TRIGGER_KEY: + type: int64u + defaultValue: "0x0000000000000003" tests: - label: "Step 1: Wait for the commissioned device to be retrieved" @@ -32,35 +39,94 @@ tests: - name: "nodeId" value: nodeId + #Not possible in YAML. what extact values to be checked - label: "Step 2: TH reads NetworkInterfaces structure attribute from DUT." - PICS: DGGEN.S.A0000 - command: "readAttribute" - attribute: "NetworkInterfaces" - response: - constraints: - type: list + verification: | + ./chip-tool generaldiagnostics read network-interfaces 1 0 + On TH(chip-tool), Verify that The NetworkInterfaces attribute SHALL be a list of NetworkInterface structs, i.e The read data type( NetworkInterface struct) must match the value listed below + • Name(interface name) + • IsOperational (indicates the node is operational in the fabric) + • OffPremiseServicesReachableIPv4(Ability to reach off-premise services it uses by utilizing IPv4, if not NULL) + • OffPremiseServicesReachableIPv6(Ability to reach off-premise services it uses by utilizing IPv6, if not NULL) + • HardwareAddress(MAC-layer address for a 802.3 or IEEE 802.11-2020 network interface, or 802.15.4) + • IPv4Addresses and IPv6Addresses (a list of the unicast IPv6 addresses that are GUA and ULA) + • Type(Interface types). + + Below is the example value which is observed in the RPI platform the value may be differ based on the dut implementation. + + + [1685950177.429619][36103:36105] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0000 DataVersion: 234312508 + [1685950177.429734][36103:36105] CHIP:TOO: NetworkInterfaces: 3 entries + [1685950177.430061][36103:36105] CHIP:TOO: [1]: { + [1685950177.430075][36103:36105] CHIP:TOO: Name: docker0 + [1685950177.430084][36103:36105] CHIP:TOO: IsOperational: FALSE + [1685950177.430105][36103:36105] CHIP:TOO: OffPremiseServicesReachableIPv4: null + [1685950177.430114][36103:36105] CHIP:TOO: OffPremiseServicesReachableIPv6: null + [1685950177.430124][36103:36105] CHIP:TOO: HardwareAddress: 024238D9D191 + [1685950177.430145][36103:36105] CHIP:TOO: IPv4Addresses: 1 entries + [1685950177.430158][36103:36105] CHIP:TOO: [1]: AC110001 + [1685950177.430168][36103:36105] CHIP:TOO: IPv6Addresses: 1 entries + [1685950177.430177][36103:36105] CHIP:TOO: [1]: + [1685950177.430186][36103:36105] CHIP:TOO: Type: 0 + [1685950177.430194][36103:36105] CHIP:TOO: } + [1685950177.430221][36103:36105] CHIP:TOO: [2]: { + [1685950177.430229][36103:36105] CHIP:TOO: Name: wlp0s20f3 + [1685950177.430236][36103:36105] CHIP:TOO: IsOperational: TRUE + [1685950177.430244][36103:36105] CHIP:TOO: OffPremiseServicesReachableIPv4: null + [1685950177.430251][36103:36105] CHIP:TOO: OffPremiseServicesReachableIPv6: null + [1685950177.430260][36103:36105] CHIP:TOO: HardwareAddress: 8C1D96786A13 + [1685950177.430269][36103:36105] CHIP:TOO: IPv4Addresses: 1 entries + [1685950177.430280][36103:36105] CHIP:TOO: [1]: C0A80065 + [1685950177.430290][36103:36105] CHIP:TOO: IPv6Addresses: 1 entries + [1685950177.430300][36103:36105] CHIP:TOO: [1]: FE80000000000000E9F62C082794357D + [1685950177.430309][36103:36105] CHIP:TOO: Type: 1 + [1685950177.430316][36103:36105] CHIP:TOO: } + [1685950177.430337][36103:36105] CHIP:TOO: [3]: { + [1685950177.430345][36103:36105] CHIP:TOO: Name: lo + [1685950177.430352][36103:36105] CHIP:TOO: IsOperational: TRUE + [1685950177.430360][36103:36105] CHIP:TOO: OffPremiseServicesReachableIPv4: null + [1685950177.430368][36103:36105] CHIP:TOO: OffPremiseServicesReachableIPv6: null + [1685950177.430376][36103:36105] CHIP:TOO: HardwareAddress: 000000000000 + [1685950177.430385][36103:36105] CHIP:TOO: IPv4Addresses: 1 entries + [1685950177.430395][36103:36105] CHIP:TOO: [1]: 7F000001 + [1685950177.430405][36103:36105] CHIP:TOO: IPv6Addresses: 1 entries + [1685950177.430415][36103:36105] CHIP:TOO: [1]: 00000000000000000000000000000001 + [1685950177.430424][36103:36105] CHIP:TOO: Type: 0 + [1685950177.430431][36103:36105] CHIP:TOO: } + [1685950177.430535][36103:36105] CHIP:EM: <<< [E:29275i S:57421 M:236457298 (Ack:61012080)] (S) Msg TX to 1:0000000000000001 [6ADE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1685950177.430558][36103:36105] CHIP:IN: (S) Sending msg 236457298 on secure session with LSID: 57421 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && DGGEN.S.A0000 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Step 3: TH reads a RebootCount attribute value from DUT." + - label: "Step 3a: TH reads a RebootCount attribute value from DUT." PICS: DGGEN.S.A0001 command: "readAttribute" attribute: "RebootCount" response: + saveAs: boot_count1 constraints: type: int16u - minValue: 0 + minValue: 1 maxValue: 65535 - - label: "Step 3a: Reboot target device" + - label: "Step 3b: Reboot target device" PICS: PICS_SDK_CI_ONLY cluster: "SystemCommands" command: "Reboot" - label: "Step 3b: Reboot target device(DUT)" + PICS: PICS_USER_PROMPT verification: | Did the DUT successfully reboot? cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP arguments: values: - name: "message" @@ -68,17 +134,69 @@ tests: - name: "expectedValue" value: "y" - - label: "Step 3c: Reboot target device" + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Step 3b: TH reads a RebootCount attribute value from DUT. Store the + value in boot_count2." + PICS: DGGEN.S.A0001 + command: "readAttribute" + attribute: "RebootCount" + response: + constraints: + type: int16u + minValue: boot_count1 + 1 + maxValue: 65535 + + - label: + "Step 4a: TH reads the Uptime attribute value of DUT. Store the value + in uptime1" + PICS: DGGEN.S.A0002 + command: "readAttribute" + attribute: "UpTime" + response: + saveAs: uptime1 + constraints: + type: int64u + + - label: "Wait 10 seconds" + PICS: DGGEN.S.A0002 + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10000 + + - label: + "Step 4b: TH reads a Uptime attribute value of DUT. Store the value in + uptime2. Verify that uptime2 is greater than uptime1." + PICS: DGGEN.S.A0002 + command: "readAttribute" + attribute: "UpTime" + response: + saveAs: uptime2 + constraints: + type: int64u + minValue: uptime1 + + - label: "Step 4c: Reboot target device" PICS: PICS_SDK_CI_ONLY cluster: "SystemCommands" command: "Reboot" - - label: "Step 3d: Reboot target device(DUT)" + - label: "Step 4c:Reboot target device(DUT)" + PICS: PICS_USER_PROMPT verification: | Did the DUT successfully reboot? cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP arguments: values: - name: "message" @@ -95,36 +213,28 @@ tests: value: nodeId - label: - "Step 4: DUT reboots and TH reads a UpTime attribute value of DUT - since some arbitrary start time of DUT rebooting." - PICS: DGGEN.S.A0002 + "Step 4c: TH reads a Uptime attribute value of DUT. Store the value in + uptime3. Verify that uptime3 is lesser than uptime2." + PICS: DGGEN.S.A0003 command: "readAttribute" attribute: "UpTime" response: + saveAs: uptime3 constraints: type: int64u + maxValue: uptime2 - - label: "TH reads a TotalOperationalHours attribute value from DUT." - PICS: DGGEN.S.A0003 - command: "readAttribute" - attribute: "TotalOperationalHours" - response: - constraints: - type: int32u - minValue: 0x0 - maxValue: 0xFFFFFFFE - - - label: "Step 6a: Reboot target device" + - label: "Step 5a: Reboot target device" PICS: PICS_SDK_CI_ONLY cluster: "SystemCommands" command: "Reboot" - - label: "Reboot target device(DUT)" + - label: "Step 5a: Reboot target device(DUT)" + PICS: PICS_USER_PROMPT verification: | Did the DUT successfully reboot? cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP arguments: values: - name: "message" @@ -140,7 +250,7 @@ tests: - name: "nodeId" value: nodeId - - label: "Step 6: TH reads BootReason attribute value from DUT." + - label: "Step 5b: TH reads BootReason attribute value from DUT." PICS: DGGEN.S.A0004 command: "readAttribute" attribute: "BootReason" @@ -149,184 +259,229 @@ tests: minValue: 0 maxValue: 6 - #issue #13029 - - label: "Step 7: TH reads ActiveHardwareFaults attribute value from DUT." - verification: | - This is optional attribute implemented in RPI, may vary based on DUT implementation on TH(chip-tool) log - - ./chip-tool generaldiagnostics read active-hardware-faults 1 0 - - On TH(chip-tool), Verify that ActiveHardwareFaults attribute the attribute response should be empty. But when a hardware fault occurs, the return attribute value must match the value listed in the HardwareFault ENUM table 11.11.6.1. - [1654682785.894724][33006:33011] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0005 DataVersion: 804003636 - [1654682785.894846][33006:33011] CHIP:TOO: ActiveHardwareFaults: 0 entries - [1654682785.894952][33006:33011] CHIP:EM: Sending Standalone Ack for MessageCounter:30803984 on exchange 62441i - - - Please use Interactive mode to Verify subscription test cases - Here the command to enter interactive mode:-- ./chip-tool interactive start - - generaldiagnostics subscribe active-hardware-faults 0 100 1 0 - - Verify in TH(chip-tool) log - - [1657539676.878976][10068:10073] CHIP:DMG: ReportDataMessage = - [1657539676.879047][10068:10073] CHIP:DMG: { - [1657539676.879109][10068:10073] CHIP:DMG: SubscriptionId = 0xd985fd71, - [1657539676.879215][10068:10073] CHIP:DMG: AttributeReportIBs = - [1657539676.879302][10068:10073] CHIP:DMG: [ - [1657539676.879366][10068:10073] CHIP:DMG: AttributeReportIB = - [1657539676.879490][10068:10073] CHIP:DMG: { - [1657539676.879588][10068:10073] CHIP:DMG: AttributeDataIB = - [1657539676.879833][10068:10073] CHIP:DMG: { - [1657539676.879952][10068:10073] CHIP:DMG: DataVersion = 0x3dc6b482, - [1657539676.880061][10068:10073] CHIP:DMG: AttributePathIB = - [1657539676.880175][10068:10073] CHIP:DMG: { - [1657539676.880291][10068:10073] CHIP:DMG: Endpoint = 0x0, - [1657539676.880410][10068:10073] CHIP:DMG: Cluster = 0x33, - [1657539676.880528][10068:10073] CHIP:DMG: Attribute = 0x0000_0005, - [1657539676.880639][10068:10073] CHIP:DMG: } - [1657539676.880758][10068:10073] CHIP:DMG: - [1657539676.880870][10068:10073] CHIP:DMG: Data = [ - [1657539676.880981][10068:10073] CHIP:DMG: - [1657539676.881097][10068:10073] CHIP:DMG: ], - [1657539676.881205][10068:10073] CHIP:DMG: }, - [1657539676.881321][10068:10073] CHIP:DMG: - [1657539676.881415][10068:10073] CHIP:DMG: }, - [1657539676.881523][10068:10073] CHIP:DMG: - [1657539676.881589][10068:10073] CHIP:DMG: ], - [1657539676.881667][10068:10073] CHIP:DMG: - [1657539676.881728][10068:10073] CHIP:DMG: InteractionModelRevision = 1 - [1657539676.881816][10068:10073] CHIP:DMG: } - [1657539676.882117][10068:10073] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0005 DataVersion: 1036432514 - [1657539676.882225][10068:10073] CHIP:TOO: ActiveHardwareFaults: 0 entries - [1657539676.882319][10068:10073] CHIP:DMG: MoveToState ReadClient[0xffff70009ef0]: Moving to [AwaitingSu] - [1657539676.882445][10068:10073] CHIP:EM: Piggybacking Ack for MessageCounter:144228832 on exchange: 14723i - [1657539676.882594][10068:10073] CHIP:IN: Prepared secure message 0xffff700046b8 to 0x0000000000000001 (1) of type 0x1 and protocolId (0, 1) on exchange 14723i with MessageCounter:6634271. - [1657539676.882686][10068:10073] CHIP:IN: Sending encrypted msg 0xffff700046b8 with MessageCounter:6634271 to 0x0000000000000001 (1) at monotonic time: 00000000016FEF43 msec - [1657539676.884825][10068:10073] CHIP:EM: Received message of type 0x4 with protocolId (0, 1) and MessageCounter:144228833 on exchange 14723i - [1657539676.884920][10068:10073] CHIP:EM: Found matching exchange: 14723i, Delegate: 0xffff70009ef0 - [1657539676.885002][10068:10073] CHIP:EM: Rxd Ack; Removing MessageCounter:6634271 from Retrans Table on exchange 14723i - [1657539676.885062][10068:10073] CHIP:EM: Removed CHIP MessageCounter:6634271 from RetransTable on exchange 14723i - [1657539676.885171][10068:10073] CHIP:DMG: SubscribeResponseMessage = - [1657539676.885237][10068:10073] CHIP:DMG: { - [1657539676.885298][10068:10073] CHIP:DMG: SubscriptionId = 0xd985fd71, - [1657539676.885407][10068:10073] CHIP:DMG: MaxInterval = 0x64, - [1657539676.885477][10068:10073] CHIP:DMG: InteractionModelRevision = 1 - [1657539676.885549][10068:10073] CHIP:DMG: } - [1657539676.885617][10068:10073] CHIP:DMG: Subscription established with SubscriptionID = 0xd985fd71 MinInterval = 20s MaxInterval = 100s Peer = 01:0000000000000001 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGGEN.S.A0005 + - label: "Step 6a: TH subscribes to ActiveHardwareFaults attribute from DUT" + PICS: DGGEN.S.A0005 + command: "subscribeAttribute" + attribute: "ActiveHardwareFaults" + minInterval: 10 + maxInterval: 1000 + response: + constraints: + type: list + + - label: "Step 6b: TH reads ActiveHardwareFaults attribute value from DUT." + PICS: DGGEN.S.A0005 + command: "readAttribute" + attribute: "ActiveHardwareFaults" + response: + constraints: + type: list + minLength: 0 + maxLength: 11 + + - label: "Step 7a: TH subscribes to ActiveRadioFaults attribute from DUT" + PICS: DGGEN.S.A0006 + command: "subscribeAttribute" + attribute: "ActiveRadioFaults" + minInterval: 10 + maxInterval: 1000 + response: + constraints: + type: list + + - label: "Step 7b: TH reads ActiveRadioFaults attribute value from DUT." + PICS: DGGEN.S.A0006 + command: "readAttribute" + attribute: "ActiveRadioFaults" + response: + constraints: + type: list + minLength: 0 + maxLength: 7 + + - label: "Step 8a: TH subscribes to ActiveNetworkFaults attribute from DUT" + PICS: DGGEN.S.A0007 + command: "subscribeAttribute" + attribute: "ActiveNetworkFaults" + minInterval: 100 + maxInterval: 1000 + response: + constraints: + type: list + + - label: "Step 8b: TH reads ActiveNetworkFaults attribute value from DUT." + PICS: DGGEN.S.A0007 + command: "readAttribute" + attribute: "ActiveNetworkFaults" + response: + constraints: + type: list + minLength: 0 + maxLength: 4 + + - label: "Step 9a: TH reads TestEventTriggersEnabled attribute value" + PICS: DGGEN.S.A0008 + cluster: "General Diagnostics" + command: "readAttribute" + attribute: "TestEventTriggersEnabled" + response: + saveAs: TestEventTriggersEnabledValue + + - label: + "Step 9b: Verify ff this TestEventTriggersEnabled attribute value is + set to True" + PICS: DGGEN.S.A0008 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" arguments: values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "Value1" + value: true + - name: "Value2" + value: TestEventTriggersEnabledValue + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue - - label: "Step 8: TH reads ActiveRadioFaults attribute value from DUT." - verification: | - This is optional attribute implemented in RPI, may vary based on DUT implementation on TH(chip-tool) log - - ./chip-tool generaldiagnostics read active-radio-faults 1 0 - On TH(chip-tool), Verify that ActiveRadioFaults attribute response should be empty. But when a radio fault occurs, the return attribute value must match the value listed in the RadioFault ENUM table. 11.11.6.2. - - [1654682886.109092][33026:33031] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0006 DataVersion: 804003636 - [1654682886.109197][33026:33031] CHIP:TOO: ActiveRadioFaults: 0 entries - [1654682886.109321][33026:33031] CHIP:EM: Sending Standalone Ack for MessageCounter:174138703 on exchange 49820i - - Please use Interactive mode to Verify subscription test cases - Here the command to enter interactive mode:-- ./chip-tool interactive start - generaldiagnostics subscribe active-radio-faults 100 1000 1 0 - - Verify in TH(chip-tool) Log - [1654682933.931539][33037:33042] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0006 DataVersion: 804003636 - [1654682933.931617][33037:33042] CHIP:TOO: ActiveRadioFaults: 0 entries - [1654682933.931659][33037:33042] CHIP:DMG: MoveToState ReadClient[0xffff7c0042e0]: Moving to [AwaitingSu] - [1654682933.931711][33037:33042] CHIP:EM: Piggybacking Ack for MessageCounter:4435222 on exchange: 32960i - [1654682933.931773][33037:33042] CHIP:IN: Prepared secure message 0xaaab093c04b8 to 0x0000000000000001 (1) of type 0x1 and protocolId (0, 1) on exchange 32960i with MessageCounter:3568188. - [1654682933.931813][33037:33042] CHIP:IN: Sending encrypted msg 0xaaab093c04b8 with MessageCounter:3568188 to 0x0000000000000001 (1) at monotonic time: 0000000000CD8AFA msec - [1654682933.933165][33037:33042] CHIP:EM: Received message of type 0x4 with protocolId (0, 1) and MessageCounter:4435223 on exchange 32960i - [1654682933.933260][33037:33042] CHIP:EM: Found matching exchange: 32960i, Delegate: 0xffff7c0042e0 - [1654682933.933312][33037:33042] CHIP:EM: Rxd Ack; Removing MessageCounter:3568188 from Retrans Table on exchange 32960i - [1654682933.933345][33037:33042] CHIP:EM: Removed CHIP MessageCounter:3568188 from RetransTable on exchange 32960i - [1654682933.933408][33037:33042] CHIP:DMG: SubscribeResponseMessage = - [1654682933.933445][33037:33042] CHIP:DMG: { - [1654682933.933478][33037:33042] CHIP:DMG: SubscriptionId = 0xc5357d7e, - [1654682933.933513][33037:33042] CHIP:DMG: MinIntervalFloorSeconds = 0x64, - [1654682933.933548][33037:33042] CHIP:DMG: MaxIntervalCeilingSeconds = 0x3e8, - [1654682933.933583][33037:33042] CHIP:DMG: InteractionModelRevision = 1 - [1654682933.933615][33037:33042] CHIP:DMG: } - [1654682933.933655][33037:33042] CHIP:DMG: Subscription established with SubscriptionID = 0xc5357d7e MinInterval = 100s MaxInterval = 1000s Peer = 01:0000000000000001 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGGEN.S.A0006 + - label: + "Step 9c: When configured TRUE, Node has been configured with one or + more test event triggers by virtue of the internally programmed non + zero EnableKey value" + runIf: IsExpectedValue + PICS: DGGEN.S.C00.Rsp + command: "TestEventTrigger" arguments: values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "EnableKey" + value: TEST_EVENT_ENABLE_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_KEY + + - label: + "Step 10a: TH reads the TotalOperationalHours attribute from the DUT. + Store the value in operational_hours1." + PICS: DGGEN.S.A0003 + command: "readAttribute" + attribute: "TotalOperationalHours" + response: + saveAs: operational_hours1 + constraints: + type: int32u + minValue: 0x0 + maxValue: 0xFFFFFFFE - - label: "Step 9: TH reads ActiveNetworkFaults attribute value from DUT." + - label: "Wait for 2 hours and 5 minutes." + PICS: DGGEN.S.A0003 + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 7500000 + + - label: + "Step 10a: TH reads the TotalOperationalHours attribute from the DUT. + Verify that operational_hours2 is greater than operational_hours1." + PICS: DGGEN.S.A0003 + command: "readAttribute" + attribute: "TotalOperationalHours" + response: + constraints: + type: int32u + minValue: operational_hours1 + maxValue: 0xFFFFFFFE + + - label: "Step 10b: Reset Devices to factory defaults" + PICS: PICS_SDK_CI_ONLY + cluster: "SystemCommands" + command: "FactoryReset" + + - label: "Step 10b: Reset Devices to factory defaults" + PICS: PICS_USER_PROMPT verification: | - This is optional attribute implemented in RPI, may vary based on DUT implementation on TH(chip-tool) log - - ./chip-tool generaldiagnostics read active-network-faults 1 0 - - On TH(chip-tool), Verify that ActiveNetworkFaults attribute value attribute response should be empty. But when a network fault occurs, the return attribute value must match the value listed in the NetworkFault ENUM table 11.11.6.3 - - [1654683004.591353][33044:33049] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0007 DataVersion: 804003636 - [1654683004.591438][33044:33049] CHIP:TOO: ActiveNetworkFaults: 0 entries - [1654683004.591526][33044:33049] CHIP:EM: Sending Standalone Ack for MessageCounter:113863817 on exchange 44900i - - Please use Interactive mode to Verify subscription test cases - Here the command to enter interactive mode:-- ./chip-tool interactive start - generaldiagnostics subscribe active-network-faults 100 1000 1 0 - - Verify on TH(chip-tool) - [1654683075.593822][33054:33059] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0007 DataVersion: 804003636 - [1654683075.593966][33054:33059] CHIP:TOO: ActiveNetworkFaults: 0 entries - [1654683075.594038][33054:33059] CHIP:DMG: MoveToState ReadClient[0xffff80004340]: Moving to [AwaitingSu] - [1654683075.594125][33054:33059] CHIP:EM: Piggybacking Ack for MessageCounter:222691244 on exchange: 29895i - [1654683075.594231][33054:33059] CHIP:IN: Prepared secure message 0xaaaadcf2ae78 to 0x0000000000000001 (1) of type 0x1 and protocolId (0, 1) on exchange 29895i with MessageCounter:9439431. - [1654683075.594299][33054:33059] CHIP:IN: Sending encrypted msg 0xaaaadcf2ae78 with MessageCounter:9439431 to 0x0000000000000001 (1) at monotonic time: 0000000000CFB459 msec - [1654683075.595402][33054:33059] CHIP:EM: Received message of type 0x4 with protocolId (0, 1) and MessageCounter:222691245 on exchange 29895i - [1654683075.595461][33054:33059] CHIP:EM: Found matching exchange: 29895i, Delegate: 0xffff80004340 - [1654683075.595522][33054:33059] CHIP:EM: Rxd Ack; Removing MessageCounter:9439431 from Retrans Table on exchange 29895i - [1654683075.595568][33054:33059] CHIP:EM: Removed CHIP MessageCounter:9439431 from RetransTable on exchange 29895i - [1654683075.595649][33054:33059] CHIP:DMG: SubscribeResponseMessage = - [1654683075.595700][33054:33059] CHIP:DMG: { - [1654683075.595743][33054:33059] CHIP:DMG: SubscriptionId = 0x41507073, - [1654683075.595792][33054:33059] CHIP:DMG: MinIntervalFloorSeconds = 0x64, - [1654683075.595840][33054:33059] CHIP:DMG: MaxIntervalCeilingSeconds = 0x3e8, - [1654683075.595886][33054:33059] CHIP:DMG: InteractionModelRevision = 1 - [1654683075.595929][33054:33059] CHIP:DMG: } - [1654683075.595984][33054:33059] CHIP:DMG: Subscription established with SubscriptionID = 0x41507073 MinInterval = 100s MaxInterval = 1000s Peer = 01:0000000000000001 + Reset Devices to factory defaults cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGGEN.S.A0007 arguments: values: - name: "message" - value: "Please enter 'y' for success" + value: "Factory Reset the DUT and enter 'y' after success" - name: "expectedValue" value: "y" - - label: "Step 10: TH reads TestEventTriggersEnabled attribute value" - verification: | - ./chip-tool generaldiagnostics read test-event-triggers-enabled 1 0 - On TH(chip-tool), Verify that TestEventTriggersEnabled attribute value should be data type bool on TH(chip-tool) log + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Step 10b: TH reads the TotalOperationalHours attribute from the DUT. + Verify that the value of 'TotalOperationalHours' is 0." + PICS: DGGEN.S.A0003 + command: "readAttribute" + attribute: "TotalOperationalHours" + response: + value: 0 + constraints: + type: int32u + + - label: "Wait for 1 hour 5 minutes." + PICS: DGGEN.S.A0003 + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 3900000 + + - label: + "Step 10c: TH reads the TotalOperationalHours attribute from the DUT. + Verify that the value of 'TotalOperationalHours' is 1." + PICS: DGGEN.S.A0003 + command: "readAttribute" + attribute: "TotalOperationalHours" + response: + value: 1 + constraints: + type: int32u - [1655188892.957794][2868:2873] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0008 DataVersion: 3562689442 - [1655188892.957869][2868:2873] CHIP:TOO: TestEventTriggersEnabled: FALSE - [1655188892.957999][2868:2873] CHIP:EM: Sending Standalone Ack for MessageCounter:133140817 on exchange 23176i + - label: "Step 10d: Reboot target device" + PICS: PICS_SDK_CI_ONLY + cluster: "SystemCommands" + command: "Reboot" + + - label: "Step 10d: Reboot target device(DUT)" + PICS: PICS_USER_PROMPT + verification: | + Did the DUT successfully reboot? cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGGEN.S.A0008 arguments: values: - name: "message" - value: "Please enter 'y' for success" + value: "Please reboot the DUT and enter 'y' after DUT starts" - name: "expectedValue" value: "y" + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Step 10c: TH reads the TotalOperationalHours attribute from the DUT. + Verify that the value of 'TotalOperationalHours' is 1." + PICS: DGGEN.S.A0003 + command: "readAttribute" + attribute: "TotalOperationalHours" + response: + value: 1 + constraints: + type: int32u diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_2_3.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_2_3.yaml index 18b3f0fc4e2eeb..dfa6f38fd8c582 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_2_3.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 88.2.3. [TC-DGGEN-2.3] Command Received [DUT as Server] @@ -20,53 +19,73 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" + cluster: "General Diagnostics" endpoint: 0 + PIXIT.DGGEN.ENABLEKEY: + type: octet_string + defaultValue: "hex:00112233445566778899aabbccddeeff" + tests: - - label: "Step 1: Commission DUT to TH" - verification: | - execute the below mentioned command to put DUT into a commissionable state, Pls use equivalent command on the respective DUT - ./chip-all-clusters-app + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - Once DUT reach the commissionable state pls send below mentioned command on TH. Pls use equivalent command on the respective DUT - ./chip-tool pairing onnetwork 1 20202021 - Verify the commissioning completed with success on TH1(chip-tool) from DUT - [1650455358.501816][4366:4371] CHIP:TOO: Device commissioning completed with success - disabled: true + - label: + "Step 2: TH reads TestEventTriggersEnabled attribute from General + Diagnostics Cluster" + command: "readAttribute" + attribute: "TestEventTriggersEnabled" + response: + saveAs: TestEventTriggersEnabledvalue + constraints: + type: boolean - - label: "Step 2: TH reads TestEventTriggersEnabled attribute value" - verification: | - ./chip-tool generaldiagnostics read test-event-triggers-enabled 1 0 - Verify that the TestEventTriggersEnabled value is of bool type. If this value is set to True, then proceed with step 3, otherwise skip step 3 On TH(chip-tool) - [1668678839.754134][146642:146644] CHIP:DMG: } - [1668678839.754234][146642:146644] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0008 DataVersion: 3696371826 - [1668678839.754256][146642:146644] CHIP:TOO: TestEventTriggersEnabled: FALSE - [1668678839.754325][146642:146644] CHIP:EM: <<< [E:58663i M:49131747 (Ack:74795807)] (S) Msg TX to 1:0000000000000001 [DE69] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + - label: + "If this value is set to True, then proceed with step 3, otherwise + skip step 3." + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: true + - name: "Value2" + value: TestEventTriggersEnabledvalue + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue - label: "Step 3: Invoke the TestEventTrigger command with EnableKey field set to PIXIT.DGGEN.ENABLEKEY and EventTrigger field set to 0." + runIf: IsExpectedValue PICS: DGGEN.S.C00.Rsp - verification: | - Based on Spec, EnableKey value is to be provided by manufacturer - below mentioned the example command to verify - ./chip-tool generaldiagnostics test-event-trigger 0 1 0 - disabled: true + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: PIXIT.DGGEN.ENABLEKEY + - name: "EventTrigger" + value: 0 + response: + error: INVALID_COMMAND - label: - "Step 4: Invoke the TestEventTrigger command with EnableKey field set - to 16 bytes of all zeroes and EventTrigger field set to 0." + "Invoke the TestEventTrigger command with EnableKey field set to + PIXIT.DGGEN.ENABLEKEY and EventTrigger field set to 0." PICS: DGGEN.S.C00.Rsp - verification: | - ./chip-tool generaldiagnostics test-event-trigger hex:0000000000000000 0 1 0 - - Verify that DUT responds with CONSTRAINT_ERROR On TH(chip-tool) - - [1659426470.994413][4451:4456] CHIP:DMG: InteractionModelRevision = 1 - [1659426470.994442][4451:4456] CHIP:DMG: }, - [1659426470.994513][4451:4456] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_0033 Command=0x0000_0000 Status=0x87 - [1659426470.994553][4451:4456] CHIP:TOO: Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1659426470.994618][4451:4456] CHIP:DMG: ICR moving to [AwaitingDe] - disabled: true + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: "hex:0000000000000000" + - name: "EventTrigger" + value: 0 + response: + error: CONSTRAINT_ERROR diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml index 38c949f960664c..c18c6fc6254636 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml @@ -24,6 +24,11 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + Step 5 is currently not supported and SHALL be skipped. + disabled: true + - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)." @@ -33,68 +38,77 @@ tests: - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." verification: | - Verify that the DUT response contains the ClusterRevision attribute and has the value 1. + ./chip-tool dishwasheralarm read cluster-revision 1 1 + Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 1 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: + + [1688447208.697823][4176:4178] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFD DataVersion: 1386394810 + [1688447208.701428][4176:4178] CHIP:TOO: ClusterRevision: 1 + [1688447208.701860][4176:4178] CHIP:EM: <<< [E:62008i S:18101 M:251225540 (Ack:117573954)] (S) Msg TX to 1:0000000000000001 [5AF3] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 3: TH reads from the DUT the FeatureMap attribute." verification: | - Verify that the DUT response contains the FeatureMap attribute and have the following bit set: - - bit 0: SHALL be 1 if and only if DISHALM.S.F00(Reset) + ./chip-tool dishwasheralarm read feature-map 1 1 + On TH(chip-tool), verify that DUT responds the Featuremap value as 1 and below is the sample log provided for the raspi platform: - All remaining bits SHALL be 0 + [1689841072.440418][2534:2536] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFC DataVersion: 3155962179 + [1689841072.440498][2534:2536] CHIP:TOO: FeatureMap: 1 + [1689841072.440655][2534:2536] CHIP:EM: <<< [E:51712i S:9959 M:43369330 (Ack:105494463)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 4: TH reads from the DUT the AttributeList attribute." verification: | - Verify that the DUT response contains the AttributeList attribute and have the list of supported attributes: - The list SHALL include all the mandatory entries: - 0x0000, 0x0002, 0x0003, 0xfff8, 0xfff9, 0xfffa, 0xfffb, 0xfffc & 0xfffd. - The list include entries based on feature support: - - 0x0001: SHALL be included if and only if DISHALM.S.F00(Reset). - The list SHALL NOT contain any additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) - - The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. - - The list SHALL NOT contain any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1) + ./chip-tool dishwasheralarm read attribute-list 1 1 + Verify " AttributeList " value consists the list of mandatory attributes (0, 2, 3, 65533, 65532, 65531, 65529, 65528) and optional attributes(1) on the TH(Chip-tool) Log: + Below is the sample log provided for the raspi platform: + [1692613019.157928][10524:10526] CHIP:DMG: } + [1692613019.158276][10524:10526] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFB DataVersion: 2220437053 + [1692613019.158381][10524:10526] CHIP:TOO: AttributeList: 9 entries + [1692613019.158441][10524:10526] CHIP:TOO: [1]: 0 + [1692613019.158479][10524:10526] CHIP:TOO: [2]: 1 + [1692613019.158517][10524:10526] CHIP:TOO: [3]: 2 + [1692613019.158551][10524:10526] CHIP:TOO: [4]: 3 + [1692613019.158587][10524:10526] CHIP:TOO: [5]: 65528 + [1692613019.158622][10524:10526] CHIP:TOO: [6]: 65529 + [1692613019.158657][10524:10526] CHIP:TOO: [7]: 65531 + [1692613019.158692][10524:10526] CHIP:TOO: [8]: 65532 + [1692613019.158727][10524:10526] CHIP:TOO: [9]: 65533 + [1692613019.158909][10524:10526] CHIP:EM: <<< [E:17897i S:25614 M:15345399 (Ack:182319742)] (S) Msg TX to 1:0000000000000001 [5213] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1692613019.158968][10524:10526] CHIP:IN: (S) Sending msg 15345399 on secure session with LSID: 25614 disabled: true - label: "Step 5: TH reads from the DUT the EventList attribute." verification: | - Verify that the DUT response contains the EventList attribute and have the list of supported events: - The list SHALL include all the mandatory entries: - 0x00 - This cluster has no entries in the standard or scoped range. - - The list SHALL NOT contain any additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) - - The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. - - The list SHALL NOT contain any values in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1) + ./chip-tool dishwasheralarm read event-list 1 1 + Verify " EventList attribute " consists the list may contain optional events(1) on the TH(Chip-tool) Log: + Below is the sample log provided for the raspi platform: + + [1689677416.105596][18367:18369] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFA DataVersion: 1517282962 + [1689677416.105625][18367:18369] CHIP:TOO: EventList: 1 entries + [1689677416.105635][18367:18369] CHIP:TOO: [1]: 0 + [1689677416.105696][18367:18369] CHIP:EM: <<< [E:51484i S:36714 M:192916227 (Ack:1705890)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689677416.105710][18367:18369] CHIP:IN: (S) Sending msg 192916227 on secure session with LSID: 36714 + [1689677416.105737][18367:18369] CHIP:EM: Flushed pending ack for MessageCounter:1705890 on exchange 51484i disabled: true - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." verification: | - Verify that the DUT response contains the AcceptedCommandList attribute and have the list of Accepted Command: - The list MAY include these optional entries: - - 0x01: SHALL be included if and only if DISHALM.S.C01.Rsp(Modify) - - The list include entries based on feature support: - - 0x00: SHALL be included if and only if DISHALM.S.C00.Rsp(Reset) - The list SHALL NOT contain any additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) - - The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. - - The list SHALL NOT contain any values in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1) + ./chip-tool dishwasheralarm read accepted-command-list 1 1 + Verify " AcceptedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + + [1689841406.078608][2570:2572] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFF9 DataVersion: 3155962179 + [1689841406.078674][2570:2572] CHIP:TOO: AcceptedCommandList: 2 entries + [1689841406.078701][2570:2572] CHIP:TOO: [1]: 0 + [1689841406.078724][2570:2572] CHIP:TOO: [2]: 1 + [1689841406.078870][2570:2572] CHIP:EM: <<< [E:3182i S:59744 M:116852840 (Ack:196212236)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." verification: | - Verify that the DUT response contains the GeneratedCommandList attribute and have the list of Generated Command: - This cluster has no entries in the standard or scoped range. - - The list SHALL NOT contain any additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) - - The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. + ./chip-tool dishwasheralarm read generated-command-list 1 1 + Verify " GeneratedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - The list SHALL NOT contain any values in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1) + [1688447564.178537][4220:4222] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFF8 DataVersion: 1795162772 + [1688447564.178684][4220:4222] CHIP:TOO: GeneratedCommandList: 0 entries + [1688447564.178984][4220:4222] CHIP:EM: <<< [E:5540i S:25125 M:256711779 (Ack:197472718)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_2_1.yaml index 9a37dd811b1da6..3033fa6d99824c 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_2_1.yaml @@ -32,23 +32,43 @@ tests: - label: "Step 2: TH reads from the DUT the Mask attribute" PICS: DISHALM.S.A0000 verification: | - Verify that the DUT response contains a 32-bit value. + ./chip-tool dishwasheralarm read mask 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value. + + [1689842323.840486][2610:2612] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0000 DataVersion: 3155962179 + [1689842323.840542][2610:2612] CHIP:TOO: Mask: 47 + [1689842323.840664][2610:2612] CHIP:EM: <<< [E:45223i S:40488 M:16127435 (Ack:224755341)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 3: TH reads from the DUT the Latch attribute" - PICS: DISHALM.S.A0001 + PICS: DISHALM.S.F00 && DISHALM.S.A0001 verification: | - Verify that the DUT response contains a 32-bit value. + ./chip-tool dishwasheralarm read latch 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit. + + [1689842371.478172][2614:2616] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0001 DataVersion: 3155962179 + [1689842371.478244][2614:2616] CHIP:TOO: Latch: 3 + [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 4: TH reads from the DUT the State attribute" PICS: DISHALM.S.A0002 verification: | - Verify that the DUT response contains a 32-bit value. + ./chip-tool dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 7 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 4: TH reads from the DUT the Supported attribute" PICS: DISHALM.S.A0003 verification: | - Verify that the DUT response contains a 32-bit value. + ./chip-tool dishwasheralarm read supported 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value. + + [1689842542.000773][2629:2631] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0003 DataVersion: 3155962179 + [1689842542.000839][2629:2631] CHIP:TOO: Supported: 47 + [1689842542.000982][2629:2631] CHIP:EM: <<< [E:28372i S:5416 M:234677238 (Ack:122316593)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml index 150e60677d63e2..a991414d1e77e2 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml @@ -25,16 +25,71 @@ config: endpoint: 0 tests: - - label: "Step 1: Commission DUT to TH" + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + + - label: "Step 1a: Commission DUT to TH" verification: | disabled: true - - label: - "Step 2a: Operate device to set State attribute bit 0 (Inflow) to 1" - PICS: DISHALM.M.ManuallyControlled + - label: "Step 1b: Set up subscription to Notify event" + PICS: DISHALM.S.E00 + verification: | + Please use Interactive mode to subscribe the Notify event + Here the command to enter interactive mode after provision :- + ./chip-tool interactive start + + Please subscribe to the OperationalError event by sending below mentioned command + dishwasheralarm subscribe-event notify 4 10 1 1 --keepSubscriptions 1 + disabled: true + + - label: "Step 1c: TH reads from the DUT the Latch attribute." + PICS: DISHALM.S.A0001 verification: | + ./chip-tool dishwasheralarm read latch 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit and Save the value returned in the response as LatchResponse. + [1689842371.478172][2614:2616] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0001 DataVersion: 3155962179 + [1689842371.478244][2614:2616] CHIP:TOO: Latch: 3 + [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: + "Step 2a: Operate device to set the condition to raise the Inflow + alarm" + PICS: DISHALM.S.M.ManuallyControlled + verification: | + Operate device to set the condition to raise the Inflow alarm then Verify the received Notify event State bit 0 is set to TRUE On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 1 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -42,14 +97,49 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 0 of response SHALL be 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 1 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: - "Step 2c: Operate device to set State attribute bit 0 (Inflow) to 0" - PICS: DISHALM.M.ManuallyControlled + "Step 2c: Operate device to set the condition to lower the Inflow + alarm" + PICS: DISHALM.S.M.ManuallyControlled verification: | - + Operate device to set the condition to lower the Inflow alarm then Verify the received Notify event State bit 0 is set to false On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 0 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -57,8 +147,14 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 0 of response SHALL be 0 if bit 0 of DISHALM.S.A0001(Latch) is 0 - Bit 0 of response SHALL be 1 if bit 0 of DISHALM.S.A0001(Latch) is 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 1 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: @@ -66,7 +162,43 @@ tests: set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - + dishwasheralarm reset 1 1 1 + Verify the success Response on TH(chip-tool) + [1690974433.649056][3934:3936] CHIP:DMG: ], + [1690974433.649084][3934:3936] CHIP:DMG: + [1690974433.649106][3934:3936] CHIP:DMG: InteractionModelRevision = 1 + [1690974433.649129][3934:3936] CHIP:DMG: }, + [1690974433.649187][3934:3936] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_005D Command=0x0000_0000 Status=0x0 + [1690974433.649228][3934:3936] CHIP:DMG: ICR moving to [AwaitingDe] + + Verify the received Notify event State bit 0 is set to false On TH(chip-tool). + [1690974241.274464][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.274486][3923:3925] CHIP:DMG: } + [1690974241.274723][3923:3925] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690974241.274752][3923:3925] CHIP:TOO: Event number: 4 + [1690974241.274774][3923:3925] CHIP:TOO: Priority: Info + [1690974241.274795][3923:3925] CHIP:TOO: Timestamp: 1690973105431 + [1690974241.274920][3923:3925] CHIP:TOO: Notify: { + [1690974241.274951][3923:3925] CHIP:TOO: Active: 7 + [1690974241.274988][3923:3925] CHIP:TOO: Inactive: 0 + [1690974241.275014][3923:3925] CHIP:TOO: State: 0 + [1690974241.275039][3923:3925] CHIP:TOO: Mask: 47 + [1690974241.275092][3923:3925] CHIP:TOO: } + [1690974241.275164][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [AwaitingSu] + [1690974241.275346][3923:3925] CHIP:EM: <<< [E:2958i S:43592 M:104435282 (Ack:209133214)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690974241.275394][3923:3925] CHIP:IN: (S) Sending msg 104435282 on secure session with LSID: 43592 + [1690974241.276590][3923:3925] CHIP:EM: >>> [E:2958i S:43592 M:209133215 (Ack:104435282)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690974241.276633][3923:3925] CHIP:EM: Found matching exchange: 2958i, Delegate: 0xffff7c010ad0 + [1690974241.276724][3923:3925] CHIP:EM: Rxd Ack; Removing MessageCounter:104435282 from Retrans Table on exchange 2958i + [1690974241.276766][3923:3925] CHIP:DMG: SubscribeResponse is received + [1690974241.276850][3923:3925] CHIP:DMG: SubscribeResponseMessage = + [1690974241.276881][3923:3925] CHIP:DMG: { + [1690974241.276918][3923:3925] CHIP:DMG: SubscriptionId = 0x4ab1f037, + [1690974241.276949][3923:3925] CHIP:DMG: MaxInterval = 0xa, + [1690974241.276976][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.277011][3923:3925] CHIP:DMG: } + [1690974241.277042][3923:3925] CHIP:DMG: Subscription established with SubscriptionID = 0x4ab1f037 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690974241.277083][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -74,32 +206,12 @@ tests: attribute" PICS: DISHALM.S.F00 && DISHALM.S.A0002 verification: | - Bit 0 of response SHALL be 0 - disabled: true + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command - - label: "Step 4a: Set up subscription to Notify event" - PICS: DISHALM.S.E00 - verification: | + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 0. - disabled: true - - - label: - "Step 4b: Operate device to set State attribute bit 0 (Inflow) to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.E00 - verification: | - Receive Notify event with State bit 0 set to TRUE. - disabled: true - - - label: "Step 4c: TH reads from the DUT the State attribute" - PICS: DISHALM.S.A0002 - verification: | - Bit 0 of response SHALL be 1. - disabled: true - - - label: - "Step 4d: Operate device to set State attribute bit 0 (Inflow) to 0 TH - sends command Reset to DUT with bit 0 (Inflow) of Alarms set to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.C00.Rsp - verification: | - Receive Notify event with State bit 0 set to FALSE. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 0 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml index ee3dbf2555d626..89e64432a55b1c 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml @@ -20,20 +20,75 @@ PICS: - PIXIT.DISHALM.DrainAlarmSupported config: - nodeId: 0x12344321 + nodeId: "0x12344321" cluster: "Basic Information" endpoint: 0 tests: - - label: "Step 1: Commission DUT to TH" + - label: "Note" verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + + - label: "Step 1a: Commission DUT to TH" + verification: | + + disabled: true + + - label: "Step 1b: Set up subscription to Notify event" + PICS: DISHALM.S.E00 + verification: | + Please use Interactive mode to subscribe the Notify event + Here the command to enter interactive mode after provision :- + ./chip-tool interactive start + Please subscribe to the OperationalError event by sending below mentioned command + dishwasheralarm subscribe-event notify 4 10 1 1 --keepSubscriptions 1 disabled: true - - label: "Step 2a: Operate device to set State attribute bit 1 (Drain) to 1" - PICS: DISHALM.M.ManuallyControlled + - label: "Step 1c: TH reads from the DUT the Latch attribute." + PICS: DISHALM.S.A0001 verification: | + ./chip-tool dishwasheralarm read latch 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit and Save the value returned in the response as LatchResponse. + [1689842371.478172][2614:2616] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0001 DataVersion: 3155962179 + [1689842371.478244][2614:2616] CHIP:TOO: Latch: 3 + [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: + "Step 2a: Operate device to set the condition to raise the Drain alarm" + PICS: DISHALM.S.M.ManuallyControlled + verification: | + Operate device to set the condition to raise the Drain alarm then Verify the received Notify event State bit 1 is set to TRUE On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 1 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -41,13 +96,47 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 1 of response SHALL be 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 1 set to 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - - label: "Step 2c: Operate device to set State attribute bit 1 (Drain) to 0" - PICS: DISHALM.M.ManuallyControlled + - label: + "Step 2c: Operate device to set the condition to lower the Drain alarm" + PICS: DISHALM.S.M.ManuallyControlled verification: | - + Operate device to set the condition to lower the Drain alarmthen Verify the received Notify event State bit 1 is set to false if DISHALM.S.A0001(Latch) is 0 On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 0 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -55,8 +144,15 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 1 of response SHALL be 0 if bit 1 of DISHALM.S.A0001(Latch) is 0 - Bit 1 of response SHALL be 1 if bit 1 of DISHALM.S.A0001(Latch) is 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with Bit 1 of response SHALL be 0 if bit 1 if DISHALM.S.A0001(Latch) is 0 + Bit 1 of response SHALL be 1 if bit 1 if DISHALM.S.A0001(Latch) is 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: @@ -64,7 +160,43 @@ tests: set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - + dishwasheralarm reset 1 1 1 + Verify the success Response on TH(chip-tool) + [1690974433.649056][3934:3936] CHIP:DMG: ], + [1690974433.649084][3934:3936] CHIP:DMG: + [1690974433.649106][3934:3936] CHIP:DMG: InteractionModelRevision = 1 + [1690974433.649129][3934:3936] CHIP:DMG: }, + [1690974433.649187][3934:3936] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_005D Command=0x0000_0000 Status=0x0 + [1690974433.649228][3934:3936] CHIP:DMG: ICR moving to [AwaitingDe] + + Verify the received Notify event State bit 1 is set to false On TH(chip-tool). + [1690974241.274464][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.274486][3923:3925] CHIP:DMG: } + [1690974241.274723][3923:3925] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690974241.274752][3923:3925] CHIP:TOO: Event number: 4 + [1690974241.274774][3923:3925] CHIP:TOO: Priority: Info + [1690974241.274795][3923:3925] CHIP:TOO: Timestamp: 1690973105431 + [1690974241.274920][3923:3925] CHIP:TOO: Notify: { + [1690974241.274951][3923:3925] CHIP:TOO: Active: 7 + [1690974241.274988][3923:3925] CHIP:TOO: Inactive: 0 + [1690974241.275014][3923:3925] CHIP:TOO: State: 0 + [1690974241.275039][3923:3925] CHIP:TOO: Mask: 47 + [1690974241.275092][3923:3925] CHIP:TOO: } + [1690974241.275164][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [AwaitingSu] + [1690974241.275346][3923:3925] CHIP:EM: <<< [E:2958i S:43592 M:104435282 (Ack:209133214)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690974241.275394][3923:3925] CHIP:IN: (S) Sending msg 104435282 on secure session with LSID: 43592 + [1690974241.276590][3923:3925] CHIP:EM: >>> [E:2958i S:43592 M:209133215 (Ack:104435282)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690974241.276633][3923:3925] CHIP:EM: Found matching exchange: 2958i, Delegate: 0xffff7c010ad0 + [1690974241.276724][3923:3925] CHIP:EM: Rxd Ack; Removing MessageCounter:104435282 from Retrans Table on exchange 2958i + [1690974241.276766][3923:3925] CHIP:DMG: SubscribeResponse is received + [1690974241.276850][3923:3925] CHIP:DMG: SubscribeResponseMessage = + [1690974241.276881][3923:3925] CHIP:DMG: { + [1690974241.276918][3923:3925] CHIP:DMG: SubscriptionId = 0x4ab1f037, + [1690974241.276949][3923:3925] CHIP:DMG: MaxInterval = 0xa, + [1690974241.276976][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.277011][3923:3925] CHIP:DMG: } + [1690974241.277042][3923:3925] CHIP:DMG: Subscription established with SubscriptionID = 0x4ab1f037 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690974241.277083][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -72,30 +204,12 @@ tests: attribute" PICS: DISHALM.S.F00 && DISHALM.S.A0002 verification: | - Bit 1 of response SHALL be 0 - disabled: true + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command - - label: "Step 4a: Set up subscription to Notify event" - PICS: DISHALM.S.E00 - verification: | - disabled: true + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 1 set to 0. - - label: "Step 4b: Operate device to set State attribute bit 1 (Drain) to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.E00 - verification: | - Receive Notify event with State bit 1 set to TRUE. - disabled: true - - - label: "Step 4c: TH reads from the DUT the State attribute" - PICS: DISHALM.S.A0002 - verification: | - Bit 1 of response SHALL be 1. - disabled: true - - - label: - "Step 4d: Operate device to set State attribute bit 1 (Drain) to 0 TH - sends command Reset to DUT with bit 1 (Drain) of Alarms set to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.C00.Rsp - verification: | - Receive Notify event with State bit 1 set to FALSE. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 0 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml index b9b839e71d7041..9954513fad13a9 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml @@ -25,15 +25,70 @@ config: endpoint: 0 tests: - - label: "Step 1: Commission DUT to TH" + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + + - label: "Step 1a: Commission DUT to TH" verification: | disabled: true - - label: "Step 2a: Operate device to set State attribute bit 2 (Door) to 1" - PICS: DISHALM.M.ManuallyControlled + - label: "Step 1b: Set up subscription to Notify event" + PICS: DISHALM.S.E00 verification: | + Please use Interactive mode to subscribe the Notify event + Here the command to enter interactive mode after provision :- + ./chip-tool interactive start + Please subscribe to the OperationalError event by sending below mentioned command + dishwasheralarm subscribe-event notify 4 10 1 1 --keepSubscriptions 1 + disabled: true + + - label: "Step 1c: TH reads from the DUT the Latch attribute." + PICS: DISHALM.S.A0001 + verification: | + ./chip-tool dishwasheralarm read latch 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit and Save the value returned in the response as LatchResponse. + + [1689842371.478172][2614:2616] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0001 DataVersion: 3155962179 + [1689842371.478244][2614:2616] CHIP:TOO: Latch: 3 + [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: + "Step 2a: Operate device to set the condition to raise the Door alarm" + PICS: DISHALM.S.M.ManuallyControlled + verification: | + Operate device to set the condition to raise the Door alarm then Verify the received Notify event State bit 2 is set to TRUE On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 10 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -41,13 +96,48 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 2 of response SHALL be 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 2 set to 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 8 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - - label: "Step 2c: Operate device to set State attribute bit 2 (Door) to 0" - PICS: DISHALM.M.ManuallyControlled + - label: + "Step 2c: Operate device to set the condition to lower the Door alarm" + PICS: DISHALM.S.M.ManuallyControlled verification: | - + Operate device to set the condition to lower the Door alarm then Verify the received Notify event State bit 2 set to FALSE if DISHALM.S.A0001(Latch) is 0 On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 10 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -55,8 +145,15 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 2 of response SHALL be 0 if bit 2 of DISHALM.S.A0001(Latch) is 0 - Bit 2 of response SHALL be 1 if bit 2 of DISHALM.S.A0001(Latch) is 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with Bit 2 of response SHALL be 0 if bit 2 if DISHALM.S.A0001(Latch) is 0 + Bit 2 of response SHALL be 1 if bit 2 if DISHALM.S.A0001(Latch) is 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 8 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: @@ -64,7 +161,43 @@ tests: set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - + dishwasheralarm reset 1 1 1 + Verify the success response on TH(chip-tool) + [1690974433.649056][3934:3936] CHIP:DMG: ], + [1690974433.649084][3934:3936] CHIP:DMG: + [1690974433.649106][3934:3936] CHIP:DMG: InteractionModelRevision = 1 + [1690974433.649129][3934:3936] CHIP:DMG: }, + [1690974433.649187][3934:3936] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_005D Command=0x0000_0000 Status=0x0 + [1690974433.649228][3934:3936] CHIP:DMG: ICR moving to [AwaitingDe] + + Verify the received Notify event State bit 2 is set to false if DISHALM.S.A0001(Latch) is 1On TH(chip-tool). + [1690974241.274464][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.274486][3923:3925] CHIP:DMG: } + [1690974241.274723][3923:3925] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690974241.274752][3923:3925] CHIP:TOO: Event number: 4 + [1690974241.274774][3923:3925] CHIP:TOO: Priority: Info + [1690974241.274795][3923:3925] CHIP:TOO: Timestamp: 1690973105431 + [1690974241.274920][3923:3925] CHIP:TOO: Notify: { + [1690974241.274951][3923:3925] CHIP:TOO: Active: 7 + [1690974241.274988][3923:3925] CHIP:TOO: Inactive: 0 + [1690974241.275014][3923:3925] CHIP:TOO: State: 0 + [1690974241.275039][3923:3925] CHIP:TOO: Mask: 47 + [1690974241.275092][3923:3925] CHIP:TOO: } + [1690974241.275164][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [AwaitingSu] + [1690974241.275346][3923:3925] CHIP:EM: <<< [E:2958i S:43592 M:104435282 (Ack:209133214)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690974241.275394][3923:3925] CHIP:IN: (S) Sending msg 104435282 on secure session with LSID: 43592 + [1690974241.276590][3923:3925] CHIP:EM: >>> [E:2958i S:43592 M:209133215 (Ack:104435282)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690974241.276633][3923:3925] CHIP:EM: Found matching exchange: 2958i, Delegate: 0xffff7c010ad0 + [1690974241.276724][3923:3925] CHIP:EM: Rxd Ack; Removing MessageCounter:104435282 from Retrans Table on exchange 2958i + [1690974241.276766][3923:3925] CHIP:DMG: SubscribeResponse is received + [1690974241.276850][3923:3925] CHIP:DMG: SubscribeResponseMessage = + [1690974241.276881][3923:3925] CHIP:DMG: { + [1690974241.276918][3923:3925] CHIP:DMG: SubscriptionId = 0x4ab1f037, + [1690974241.276949][3923:3925] CHIP:DMG: MaxInterval = 0xa, + [1690974241.276976][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.277011][3923:3925] CHIP:DMG: } + [1690974241.277042][3923:3925] CHIP:DMG: Subscription established with SubscriptionID = 0x4ab1f037 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690974241.277083][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -72,31 +205,12 @@ tests: attribute" PICS: DISHALM.S.F00 && DISHALM.S.A0002 verification: | - Bit 2 of response SHALL be 0 - disabled: true - - - label: "Step 4a: Set up subscription to Notify event" - PICS: DISHALM.S.E00 - verification: | - - disabled: true - - - label: "Step 4b: Operate device to set State attribute bit 2 (Door) to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.E00 - verification: | - Receive Notify event with State bit 2 set to TRUE. - disabled: true + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command - - label: "Step 4c: TH reads from the DUT the State attribute" - PICS: DISHALM.S.A0002 - verification: | - Bit 2 of response SHALL be 1. - disabled: true + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 2 set to 0. - - label: - "Step 4d: Operate device to set State attribute bit 2 (Door) to 0 TH - sends command Reset to DUT with bit 2 (Door) of Alarms set to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.C00.Rsp - verification: | - Receive Notify event with State bit 2 set to FALSE. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 1 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml index 524ffba84ab4a7..6718ca38042624 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml @@ -27,16 +27,71 @@ config: endpoint: 0 tests: - - label: "Step 1: Commission DUT to TH" + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + + - label: "Step 1a: Commission DUT to TH" verification: | disabled: true - - label: - "Step 2a: Operate device to set State attribute bit 3 (TempLow) to 1" - PICS: DISHALM.M.ManuallyControlled + - label: "Step 1b: Set up subscription to Notify event" + PICS: DISHALM.S.E00 + verification: | + Please use Interactive mode to subscribe the Notify event + Here the command to enter interactive mode after provision :- + ./chip-tool interactive start + + Please subscribe to the OperationalError event by sending below mentioned command + dishwasheralarm subscribe-event notify 4 10 1 1 --keepSubscriptions 1 + disabled: true + + - label: "Step 1c: TH reads from the DUT the Latch attribute." + PICS: DISHALM.S.A0001 verification: | + ./chip-tool dishwasheralarm read latch 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit and Save the value returned in the response as LatchResponse. + + [1689842371.478172][2614:2616] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0001 DataVersion: 3155962179 + [1689842371.478244][2614:2616] CHIP:TOO: Latch: 3 + [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + - label: + "Step 2a: Operate device to set the condition to raise the TempLow + alarm" + PICS: DISHALM.S.M.ManuallyControlled + verification: | + Operate device to set the condition to raise the TempLow alarm then Verify the received Notify event State bit 3 is set to TRUE On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 1 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -44,14 +99,48 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 3 of response SHALL be 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 3 set to 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: - "Step 2c: Operate device to set State attribute bit 3 (TempLow) to 0" - PICS: DISHALM.M.ManuallyControlled + "Step 2c: Operate device to set the condition to lower the TempLow + alarm" + PICS: DISHALM.S.M.ManuallyControlled verification: | - + Operate device to set the condition to lower the TempLow alarm then Verify the received Notify event State bit 3 is set to false if DISHALM.S.A0001(Latch) is 0. On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 0 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -59,8 +148,14 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 3 of response SHALL be 0 if bit 3 of DISHALM.S.A0001(Latch) is 0 - Bit 3 of response SHALL be 1 if bit 3 of DISHALM.S.A0001(Latch) is 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with Bit 3 of response SHALL be 0 if bit 3 if DISHALM.S.A0001(Latch) is 0 + Bit 3 of response SHALL be 1 if bit 3 if DISHALM.S.A0001(Latch) is 1. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: @@ -68,7 +163,43 @@ tests: set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - + dishwasheralarm reset 1 1 1 + Verify the success Response on TH(chip-tool) + [1690974433.649056][3934:3936] CHIP:DMG: ], + [1690974433.649084][3934:3936] CHIP:DMG: + [1690974433.649106][3934:3936] CHIP:DMG: InteractionModelRevision = 1 + [1690974433.649129][3934:3936] CHIP:DMG: }, + [1690974433.649187][3934:3936] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_005D Command=0x0000_0000 Status=0x0 + [1690974433.649228][3934:3936] CHIP:DMG: ICR moving to [AwaitingDe] + + On TH(chip-tool), Verify that received Notify event with State bit 3 set to FALSE if DISHALM.S.A0001(Latch) is 1. + [1690974241.274464][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.274486][3923:3925] CHIP:DMG: } + [1690974241.274723][3923:3925] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690974241.274752][3923:3925] CHIP:TOO: Event number: 4 + [1690974241.274774][3923:3925] CHIP:TOO: Priority: Info + [1690974241.274795][3923:3925] CHIP:TOO: Timestamp: 1690973105431 + [1690974241.274920][3923:3925] CHIP:TOO: Notify: { + [1690974241.274951][3923:3925] CHIP:TOO: Active: 7 + [1690974241.274988][3923:3925] CHIP:TOO: Inactive: 0 + [1690974241.275014][3923:3925] CHIP:TOO: State: 0 + [1690974241.275039][3923:3925] CHIP:TOO: Mask: 47 + [1690974241.275092][3923:3925] CHIP:TOO: } + [1690974241.275164][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [AwaitingSu] + [1690974241.275346][3923:3925] CHIP:EM: <<< [E:2958i S:43592 M:104435282 (Ack:209133214)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690974241.275394][3923:3925] CHIP:IN: (S) Sending msg 104435282 on secure session with LSID: 43592 + [1690974241.276590][3923:3925] CHIP:EM: >>> [E:2958i S:43592 M:209133215 (Ack:104435282)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690974241.276633][3923:3925] CHIP:EM: Found matching exchange: 2958i, Delegate: 0xffff7c010ad0 + [1690974241.276724][3923:3925] CHIP:EM: Rxd Ack; Removing MessageCounter:104435282 from Retrans Table on exchange 2958i + [1690974241.276766][3923:3925] CHIP:DMG: SubscribeResponse is received + [1690974241.276850][3923:3925] CHIP:DMG: SubscribeResponseMessage = + [1690974241.276881][3923:3925] CHIP:DMG: { + [1690974241.276918][3923:3925] CHIP:DMG: SubscriptionId = 0x4ab1f037, + [1690974241.276949][3923:3925] CHIP:DMG: MaxInterval = 0xa, + [1690974241.276976][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.277011][3923:3925] CHIP:DMG: } + [1690974241.277042][3923:3925] CHIP:DMG: Subscription established with SubscriptionID = 0x4ab1f037 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690974241.277083][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -76,32 +207,12 @@ tests: attribute" PICS: DISHALM.S.F00 && DISHALM.S.A0002 verification: | - Bit 3 of response SHALL be 0 - disabled: true - - - label: "Step 4a: Set up subscription to Notify event" - PICS: DISHALM.S.E00 - verification: | + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command - disabled: true + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 3 set to 0. - - label: - "Step 4b: Operate device to set State attribute bit 3 (TempLow) to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.E00 - verification: | - Receive Notify event with State bit 3 set to TRUE. - disabled: true - - - label: "Step 4c: TH reads from the DUT the State attribute" - PICS: DISHALM.S.A0002 - verification: | - Bit 3 of response SHALL be 1. - disabled: true - - - label: - "Step 4d: Operate device to set State attribute bit 3 (TempLow) to 0 - TH sends command Reset to DUT with bit 3 (TempLow) of Alarms set to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.C00.Rsp - verification: | - Receive Notify event with State bit 3 set to FALSE. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 0 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml index 79534e46f7f2b7..87cfb045d00b73 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml @@ -27,16 +27,71 @@ config: endpoint: 0 tests: - - label: "Step 1: Commission DUT to TH" + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + + - label: "Step 1a: Commission DUT to TH" verification: | disabled: true - - label: - "Step 2a: Operate device to set State attribute bit 4 (TempHigh) to 1" - PICS: DISHALM.M.ManuallyControlled + - label: "Step 1b: Set up subscription to Notify event" + PICS: DISHALM.S.E00 + verification: | + Please use Interactive mode to subscribe the Notify event + Here the command to enter interactive mode after provision :- + ./chip-tool interactive start + + Please subscribe to the OperationalError event by sending below mentioned command + dishwasheralarm subscribe-event notify 4 10 1 1 --keepSubscriptions 1 + disabled: true + + - label: "Step 1c: TH reads from the DUT the Latch attribute." + PICS: DISHALM.S.A0001 verification: | + ./chip-tool dishwasheralarm read latch 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit and Save the value returned in the response as LatchResponse. + + [1689842371.478172][2614:2616] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0001 DataVersion: 3155962179 + [1689842371.478244][2614:2616] CHIP:TOO: Latch: 3 + [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + - label: + "Step 2a: Operate device to set the condition to raise the TempHigh + alarm" + PICS: DISHALM.S.M.ManuallyControlled + verification: | + Operate device to set the condition to raise the TempHigh alarm then Verify the received Notify event State bit 4 set to TRUE On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 1 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -44,14 +99,48 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 4 of response SHALL be 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 4 set to 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: - "Step 2c: Operate device to set State attribute bit 4 (TempHigh) to 0" - PICS: DISHALM.M.ManuallyControlled + "Step 2c: Operate device to set the condition to lower the TempHigh + alarm" + PICS: DISHALM.S.M.ManuallyControlled verification: | - + Operate device to set the condition to lower the TempHigh alarm then Verify the received Notify event State bit 4 set to FALSE if DISHALM.S.A0001(Latch) is 0 On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 0 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -59,8 +148,14 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 4 of response SHALL be 0 if bit 4 of DISHALM.S.A0001(Latch) is 0 - Bit 4 of response SHALL be 1 if bit 4 of DISHALM.S.A0001(Latch) is 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with Bit 4 of response SHALL be 0 if bit 4 if DISHALM.S.A0001(Latch) is 0 + Bit 4 of response SHALL be 1 if bit 4 if DISHALM.S.A0001(Latch) is 1. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: @@ -68,7 +163,43 @@ tests: Alarms set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - + dishwasheralarm reset 1 1 1 + Verify the success response on TH(chip-tool) + [1690974433.649056][3934:3936] CHIP:DMG: ], + [1690974433.649084][3934:3936] CHIP:DMG: + [1690974433.649106][3934:3936] CHIP:DMG: InteractionModelRevision = 1 + [1690974433.649129][3934:3936] CHIP:DMG: }, + [1690974433.649187][3934:3936] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_005D Command=0x0000_0000 Status=0x0 + [1690974433.649228][3934:3936] CHIP:DMG: ICR moving to [AwaitingDe] + + On TH(chip-tool), Verify that received Notify event with State bit 4 set to FALSE if DISHALM.S.A0001(Latch) is 1. + [1690974241.274464][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.274486][3923:3925] CHIP:DMG: } + [1690974241.274723][3923:3925] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690974241.274752][3923:3925] CHIP:TOO: Event number: 4 + [1690974241.274774][3923:3925] CHIP:TOO: Priority: Info + [1690974241.274795][3923:3925] CHIP:TOO: Timestamp: 1690973105431 + [1690974241.274920][3923:3925] CHIP:TOO: Notify: { + [1690974241.274951][3923:3925] CHIP:TOO: Active: 7 + [1690974241.274988][3923:3925] CHIP:TOO: Inactive: 0 + [1690974241.275014][3923:3925] CHIP:TOO: State: 0 + [1690974241.275039][3923:3925] CHIP:TOO: Mask: 47 + [1690974241.275092][3923:3925] CHIP:TOO: } + [1690974241.275164][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [AwaitingSu] + [1690974241.275346][3923:3925] CHIP:EM: <<< [E:2958i S:43592 M:104435282 (Ack:209133214)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690974241.275394][3923:3925] CHIP:IN: (S) Sending msg 104435282 on secure session with LSID: 43592 + [1690974241.276590][3923:3925] CHIP:EM: >>> [E:2958i S:43592 M:209133215 (Ack:104435282)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690974241.276633][3923:3925] CHIP:EM: Found matching exchange: 2958i, Delegate: 0xffff7c010ad0 + [1690974241.276724][3923:3925] CHIP:EM: Rxd Ack; Removing MessageCounter:104435282 from Retrans Table on exchange 2958i + [1690974241.276766][3923:3925] CHIP:DMG: SubscribeResponse is received + [1690974241.276850][3923:3925] CHIP:DMG: SubscribeResponseMessage = + [1690974241.276881][3923:3925] CHIP:DMG: { + [1690974241.276918][3923:3925] CHIP:DMG: SubscriptionId = 0x4ab1f037, + [1690974241.276949][3923:3925] CHIP:DMG: MaxInterval = 0xa, + [1690974241.276976][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.277011][3923:3925] CHIP:DMG: } + [1690974241.277042][3923:3925] CHIP:DMG: Subscription established with SubscriptionID = 0x4ab1f037 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690974241.277083][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -76,32 +207,12 @@ tests: attribute" PICS: DISHALM.S.F00 && DISHALM.S.A0002 verification: | - Bit 4 of response SHALL be 0 - disabled: true - - - label: "Step 4a: Set up subscription to Notify event" - PICS: DISHALM.S.E00 - verification: | + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command - disabled: true + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 4 set to 0. - - label: - "Step 4b: Operate device to set State attribute bit 4 (TempHigh) to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.E00 - verification: | - Receive Notify event with State bit 4 set to TRUE. - disabled: true - - - label: "Step 4c: TH reads from the DUT the State attribute" - PICS: DISHALM.S.A0002 - verification: | - Bit 4 of response SHALL be 1. - disabled: true - - - label: - "Step 4d: Operate device to set State attribute bit 4 (TempHigh) to 0 - TH sends command Reset to DUT with bit 4 (TempHigh) of Alarms set to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.C00.Rsp - verification: | - Receive Notify event with State bit 4 set to FALSE. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 0 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml index a894e3db5eba7c..e5f340c43fabae 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml @@ -26,17 +26,71 @@ config: endpoint: 0 tests: - - label: "Step 1: Commission DUT to TH" + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + + - label: "Step 1a: Commission DUT to TH" verification: | disabled: true - - label: - "Step 2a: Operate device to set State attribute bit 5 (WaterLevel) to - 1" - PICS: DISHALM.M.ManuallyControlled + - label: "Step 1b: Set up subscription to Notify event" + PICS: DISHALM.S.E00 + verification: | + Please use Interactive mode to subscribe the Notify event + Here the command to enter interactive mode after provision :- + ./chip-tool interactive start + + Please subscribe to the OperationalError event by sending below mentioned command + dishwasheralarm subscribe-event notify 4 10 1 1 --keepSubscriptions 1 + disabled: true + + - label: "Step 1c: TH reads from the DUT the Latch attribute." + PICS: DISHALM.S.A0001 verification: | + ./chip-tool dishwasheralarm read latch 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit and Save the value returned in the response as LatchResponse. + + [1689842371.478172][2614:2616] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0001 DataVersion: 3155962179 + [1689842371.478244][2614:2616] CHIP:TOO: Latch: 3 + [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + - label: + "Step 2a: Operate device to set the condition to raise the WaterLevel + alarm" + PICS: DISHALM.S.M.ManuallyControlled + verification: | + Operate device to set the condition to raise the WaterLevel alarm then Verify the received Notify event State bit 5 is set to TRUE On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 1 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -44,15 +98,48 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 5 of response SHALL be 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 5 set to 1. + + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: - "Step 2c: Operate device to set State attribute bit 5 (WaterLevel) to - 0" - PICS: DISHALM.M.ManuallyControlled + "Step 2c: Operate device to set the condition to lower the WaterLevel + alarm" + PICS: DISHALM.S.M.ManuallyControlled verification: | - + Operate device to set the condition to lower the WaterLevel alarm then Verify the received Notify event State bit 5 set to FALSE if DISHALM.S.A0001(Latch) is 0 On TH(chip-tool). + [1690973612.883794][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.883819][3893:3895] CHIP:DMG: } + [1690973612.883993][3893:3895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690973612.884020][3893:3895] CHIP:TOO: Event number: 4 + [1690973612.884041][3893:3895] CHIP:TOO: Priority: Info + [1690973612.884061][3893:3895] CHIP:TOO: Timestamp: 1690973105431 + [1690973612.884143][3893:3895] CHIP:TOO: Notify: { + [1690973612.884171][3893:3895] CHIP:TOO: Active: 7 + [1690973612.884195][3893:3895] CHIP:TOO: Inactive: 0 + [1690973612.884219][3893:3895] CHIP:TOO: State: 0 + [1690973612.884243][3893:3895] CHIP:TOO: Mask: 47 + [1690973612.884267][3893:3895] CHIP:TOO: } + [1690973612.884325][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [AwaitingSu] + [1690973612.884464][3893:3895] CHIP:EM: <<< [E:55179i S:51346 M:176888098 (Ack:160976726)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690973612.884511][3893:3895] CHIP:IN: (S) Sending msg 176888098 on secure session with LSID: 51346 + [1690973612.885556][3893:3895] CHIP:EM: >>> [E:55179i S:51346 M:160976727 (Ack:176888098)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690973612.885597][3893:3895] CHIP:EM: Found matching exchange: 55179i, Delegate: 0xffff8c010ad0 + [1690973612.885651][3893:3895] CHIP:EM: Rxd Ack; Removing MessageCounter:176888098 from Retrans Table on exchange 55179i + [1690973612.885692][3893:3895] CHIP:DMG: SubscribeResponse is received + [1690973612.885735][3893:3895] CHIP:DMG: SubscribeResponseMessage = + [1690973612.885762][3893:3895] CHIP:DMG: { + [1690973612.885787][3893:3895] CHIP:DMG: SubscriptionId = 0xfbcf12a6, + [1690973612.885815][3893:3895] CHIP:DMG: MaxInterval = 0xa, + [1690973612.885842][3893:3895] CHIP:DMG: InteractionModelRevision = 1 + [1690973612.885867][3893:3895] CHIP:DMG: } + [1690973612.885896][3893:3895] CHIP:DMG: Subscription established with SubscriptionID = 0xfbcf12a6 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690973612.885925][3893:3895] CHIP:DMG: MoveToState ReadClient[0xffff8c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -60,8 +147,14 @@ tests: attribute" PICS: DISHALM.S.A0002 verification: | - Bit 5 of response SHALL be 0 if bit 5 of DISHALM.S.A0001(Latch) is 0 - Bit 5 of response SHALL be 1 if bit 5 of DISHALM.S.A0001(Latch) is 1 + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command + + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with Bit 5 of response SHALL be 0 if bit 5 if DISHALM.S.A0001(Latch) is 0 + Bit 5 of response SHALL be 1 if bit 5 if DISHALM.S.A0001(Latch) is 1. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 2 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: @@ -69,7 +162,43 @@ tests: Alarms set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - + dishwasheralarm reset 1 1 1 + Verify the success response on TH(chip-tool) + [1690974433.649056][3934:3936] CHIP:DMG: ], + [1690974433.649084][3934:3936] CHIP:DMG: + [1690974433.649106][3934:3936] CHIP:DMG: InteractionModelRevision = 1 + [1690974433.649129][3934:3936] CHIP:DMG: }, + [1690974433.649187][3934:3936] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_005D Command=0x0000_0000 Status=0x0 + [1690974433.649228][3934:3936] CHIP:DMG: ICR moving to [AwaitingDe] + + On TH(chip-tool), Verify that received Notify event with State bit 5 set to FALSE if DISHALM.S.A0001(Latch) is 1. + [1690974241.274464][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.274486][3923:3925] CHIP:DMG: } + [1690974241.274723][3923:3925] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Event 0x0000_0000 + [1690974241.274752][3923:3925] CHIP:TOO: Event number: 4 + [1690974241.274774][3923:3925] CHIP:TOO: Priority: Info + [1690974241.274795][3923:3925] CHIP:TOO: Timestamp: 1690973105431 + [1690974241.274920][3923:3925] CHIP:TOO: Notify: { + [1690974241.274951][3923:3925] CHIP:TOO: Active: 7 + [1690974241.274988][3923:3925] CHIP:TOO: Inactive: 0 + [1690974241.275014][3923:3925] CHIP:TOO: State: 0 + [1690974241.275039][3923:3925] CHIP:TOO: Mask: 47 + [1690974241.275092][3923:3925] CHIP:TOO: } + [1690974241.275164][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [AwaitingSu] + [1690974241.275346][3923:3925] CHIP:EM: <<< [E:2958i S:43592 M:104435282 (Ack:209133214)] (S) Msg TX to 1:0000000000000001 [C934] --- Type 0001:01 (IM:StatusResponse) + [1690974241.275394][3923:3925] CHIP:IN: (S) Sending msg 104435282 on secure session with LSID: 43592 + [1690974241.276590][3923:3925] CHIP:EM: >>> [E:2958i S:43592 M:209133215 (Ack:104435282)] (S) Msg RX from 1:0000000000000001 [C934] --- Type 0001:04 (IM:SubscribeResponse) + [1690974241.276633][3923:3925] CHIP:EM: Found matching exchange: 2958i, Delegate: 0xffff7c010ad0 + [1690974241.276724][3923:3925] CHIP:EM: Rxd Ack; Removing MessageCounter:104435282 from Retrans Table on exchange 2958i + [1690974241.276766][3923:3925] CHIP:DMG: SubscribeResponse is received + [1690974241.276850][3923:3925] CHIP:DMG: SubscribeResponseMessage = + [1690974241.276881][3923:3925] CHIP:DMG: { + [1690974241.276918][3923:3925] CHIP:DMG: SubscriptionId = 0x4ab1f037, + [1690974241.276949][3923:3925] CHIP:DMG: MaxInterval = 0xa, + [1690974241.276976][3923:3925] CHIP:DMG: InteractionModelRevision = 1 + [1690974241.277011][3923:3925] CHIP:DMG: } + [1690974241.277042][3923:3925] CHIP:DMG: Subscription established with SubscriptionID = 0x4ab1f037 MinInterval = 4s MaxInterval = 10s Peer = 01:0000000000000001 + [1690974241.277083][3923:3925] CHIP:DMG: MoveToState ReadClient[0xffff7c010ac0]: Moving to [Subscripti] disabled: true - label: @@ -77,34 +206,12 @@ tests: attribute" PICS: DISHALM.S.F00 && DISHALM.S.A0002 verification: | - Bit 5 of response SHALL be 0 - disabled: true - - - label: "Step 4a: Set up subscription to Notify event" - PICS: DISHALM.S.E00 - verification: | + After a few seconds, TH reads from the DUT the State attribute by sending below mentioned command - disabled: true + dishwasheralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 5 set to 0. - - label: - "Step 4b: Operate device to set State attribute bit 5 (WaterLevel) to - 1" - PICS: DISHALM.S.A0002 && DISHALM.S.E00 - verification: | - Receive Notify event with State bit 5 set to TRUE. - disabled: true - - - label: "Step 4c: TH reads from the DUT the State attribute" - PICS: DISHALM.S.A0002 - verification: | - Bit 5 of response SHALL be 1. - disabled: true - - - label: - "Step 4d: Operate device to set State attribute bit 5 (WaterLevel) to - 0 TH sends command Reset to DUT with bit 5 (WaterLevel) of Alarms set - to 1" - PICS: DISHALM.S.A0002 && DISHALM.S.C00.Rsp - verification: | - Receive Notify event with State bit 5 set to FALSE. + [1689842479.694724][2624:2626] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_0002 DataVersion: 3155962179 + [1689842479.694781][2624:2626] CHIP:TOO: State: 0 + [1689842479.694921][2624:2626] CHIP:EM: <<< [E:40120i S:46763 M:178458342 (Ack:246107556)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml index e27bf45da37446..cd6c4dbac170a2 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml @@ -45,7 +45,7 @@ tests: verification: | ./chip-tool dishwashermode read feature-map 1 1 - On the TH(Chip-tool) Log, Verify featureMap value is 1 If TCCM.S.F00(DEPONOFF) true, Otherwise 0, T and below is the sample log provided for the raspi platform: + On the TH(Chip-tool) Log, Verify featureMap value is 1 If DISHM.S.F00(DEPONOFF) is true, Otherwise 0, and below is the sample log provided for the raspi platform: [1690365613.351850][27441:27443] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFFC DataVersion: 1130015440 [1690365613.351911][27441:27443] CHIP:TOO: FeatureMap: 1 @@ -56,9 +56,9 @@ tests: ./chip-tool dishwashermode read attribute-list 1 1 Verify the "AttributeList " should include the mandatory attributes (values 0, 1), - - global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and - - list may include optional attribute(value 0x0002), if MOD.S.A0004(StartUpMode) supports, - - list contains feature dependent attribute (values 0x0003), if MOD.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + - Global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and + - List may include optional attribute(value 0x0002), if DISHM.S.A0002(StartUpMode) supports, + - List contains feature dependent attribute (values 0x0003), if DISHM.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1689930814.439457][300741:300743] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFFB DataVersion: 2031856391 [1689930814.439500][300741:300743] CHIP:TOO: AttributeList: 10 entries @@ -99,7 +99,7 @@ tests: verification: | ./chip-tool dishwashermode read generated-command-list 1 1 - Verify "GeneratedCommandList" contains a list of mandatory commands (value 1) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + Verify " GeneratedCommandList" contains a list of mandatory commands (value 1) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1689997224.280302][360025:360027] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFF8 DataVersion: 1427220838 [1689997224.280330][360025:360027] CHIP:TOO: GeneratedCommandList: 1 entries diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_1_2.yaml index 34053c3f7f5ad2..17ee54b3df5fc7 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHM_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHM_1_2.yaml @@ -37,11 +37,11 @@ tests: ./chip-tool dishwashermode read supported-modes 1 1 Verify that the DUT response contains list of ModeOptionsStruct entries. - - Verify that list should contain at least one entry - - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value - - ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster alias tag value (RapidCool, RapidFreeze) or in the MfgTags (0x8000 to 0xBFFF) range + - Verify that the list has at least 2 and at most 255 entries + - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value. + - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the mode tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster-derived tag value (Normal, Heavy, Light) or in the MfgTags (0x8000 to 0xBFFF) range. - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 - - Verify that at least one ModeOptionsStruct entry includes either the RapidCool semantic tag or the RapidFreeze semantic tag in the SemanticTags field + - Verify that at least one ModeOptionsStruct entry includes the Normal mode tag - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: [1689997453.610123][360094:360096] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 1427220838 @@ -86,7 +86,7 @@ tests: verification: | ./chip-tool dishwashermode read current-mode 1 1 - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer and the value is from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + Verify on TH(chip-tool) logs, CurrentMode attribute is an integer value from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 [1689997642.999367][360160:360162] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0001 DataVersion: 1994417976 [1689997642.999395][360160:360162] CHIP:TOO: CurrentMode: 0 @@ -97,7 +97,7 @@ tests: verification: | ./chip-tool dishwashermode read on-mode 1 1 - Verify on TH(chip-tool) logs, OnMode attribute value is an integer and the value is from supported_modes_dut (As per spec default value is null) , below is the sample log provided for the raspi platform, Here OnMode attribute value is Null + Verify on TH(chip-tool) logs, OnMode attribute value is an integer from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here OnMode attribute value is Null [1649676072.465968][10754:10759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0003 DataVersion: 4277065072 [1649676072.466094][10754:10759] CHIP:TOO: OnMode: null @@ -108,7 +108,7 @@ tests: verification: | ./chip-tool dishwashermode read start-up-mode 1 1 - Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer(As per spec default value is null) and value is from supported_modes_dut, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null + Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null [1689997956.636092][360258:360260] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0002 DataVersion: 1994417976 [1689997956.636125][360258:360260] CHIP:TOO: StartUpMode: null diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_2_1.yaml index 767bf66498b0fe..45c1d644226b89 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHM_2_1.yaml @@ -24,28 +24,6 @@ config: endpoint: 0 tests: - - label: "Note" - verification: | - To execute this test case set onmode to any integer value because as default it value has null. - - ./chip-tool dishwashermode write on-mode 0 1 1 - - On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - - [1690188722.057858][15975:15977] CHIP:DMG: StatusIB = - [1690188722.057862][15975:15977] CHIP:DMG: { - [1690188722.057865][15975:15977] CHIP:DMG: status = 0x00 (SUCCESS), - [1690188722.057867][15975:15977] CHIP:DMG: }, - disabled: true - - - label: "Precondition" - verification: | - 1 Dishwasher Mode and OnOff clusters are available on the same endpoint - - 2 The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. - disabled: true - - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)." @@ -130,7 +108,7 @@ tests: - label: "Step 5: Manually put the device in a state from which it will FAIL to transition to PIXIT.DISHM.MODE_CHANGE_FAIL" - PICS: PIXIT.DISHM.CAN_TEST_MODE_FAILURE + PICS: DISHM.S.M.CAN_TEST_MODE_FAILURE verification: | Manual operation required disabled: true @@ -150,7 +128,7 @@ tests: - label: "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set to PIXIT.DISHM.MODE_CHANGE_FAIL" - PICS: PIXIT.DISHM.CAN_TEST_MODE_FAILURE && DISHM.S.C00.Rsp + PICS: DISHM.S.M.CAN_TEST_MODE_FAILURE && DISHM.S.C00.Rsp verification: | Note : Please skip this step as SDK is not enabled with this failure response diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_3_1.yaml index 78974199d806b8..e4262969f37951 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHM_3_1.yaml @@ -24,26 +24,64 @@ config: endpoint: 0 tests: - - label: "Note" + - label: "Precondition" verification: | - To execute this test case set onmode to any integer value because as default it value has null. + 1 Dishwasher Mode and OnOff clusters are available on the same endpoint - ./chip-tool dishwashermode write on-mode 0 1 1 + 2 The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. - On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + Read the SupportedModes attribute, select a value from SupportedModes and save the value as OnMode_value + ./chip-tool dishwashermode read supported-modes 1 1 - [1690188722.057858][15975:15977] CHIP:DMG: StatusIB = - [1690188722.057862][15975:15977] CHIP:DMG: { - [1690188722.057865][15975:15977] CHIP:DMG: status = 0x00 (SUCCESS), - [1690188722.057867][15975:15977] CHIP:DMG: }, - disabled: true + On TH(chip-tool) log, Verify the list of SupportedModes and below is the sample log provided for the raspi platform: + + [1692170674.471882][3058:3061] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 2502960191 + [1692170674.472010][3058:3061] CHIP:TOO: SupportedModes: 3 entries + [1692170674.472081][3058:3061] CHIP:TOO: [1]: { + [1692170674.472110][3058:3061] CHIP:TOO: Label: Normal + [1692170674.472135][3058:3061] CHIP:TOO: Mode: 0 + [1692170674.472163][3058:3061] CHIP:TOO: ModeTags: 1 entries + [1692170674.472223][3058:3061] CHIP:TOO: [1]: { + [1692170674.472252][3058:3061] CHIP:TOO: Value: 16384 + [1692170674.472288][3058:3061] CHIP:TOO: } + [1692170674.472314][3058:3061] CHIP:TOO: } + [1692170674.472385][3058:3061] CHIP:TOO: [2]: { + [1692170674.472411][3058:3061] CHIP:TOO: Label: Heavy + [1692170674.472435][3058:3061] CHIP:TOO: Mode: 1 + [1692170674.472475][3058:3061] CHIP:TOO: ModeTags: 2 entries + [1692170674.472506][3058:3061] CHIP:TOO: [1]: { + [1692170674.472542][3058:3061] CHIP:TOO: Value: 7 + [1692170674.472567][3058:3061] CHIP:TOO: } + [1692170674.472595][3058:3061] CHIP:TOO: [2]: { + [1692170674.472632][3058:3061] CHIP:TOO: Value: 16385 + [1692170674.472658][3058:3061] CHIP:TOO: } + [1692170674.472683][3058:3061] CHIP:TOO: } + [1692170674.472730][3058:3061] CHIP:TOO: [3]: { + [1692170674.472755][3058:3061] CHIP:TOO: Label: Light + [1692170674.472778][3058:3061] CHIP:TOO: Mode: 2 + [1692170674.472820][3058:3061] CHIP:TOO: ModeTags: 3 entries + [1692170674.472851][3058:3061] CHIP:TOO: [1]: { + [1692170674.472886][3058:3061] CHIP:TOO: Value: 16386 + [1692170674.472910][3058:3061] CHIP:TOO: } + [1692170674.472938][3058:3061] CHIP:TOO: [2]: { + [1692170674.472973][3058:3061] CHIP:TOO: Value: 8 + [1692170674.472996][3058:3061] CHIP:TOO: } + [1692170674.473024][3058:3061] CHIP:TOO: [3]: { + [1692170674.473048][3058:3061] CHIP:TOO: Value: 2 + [1692170674.473071][3058:3061] CHIP:TOO: } + [1692170674.473095][3058:3061] CHIP:TOO: } + + Set the OnMode attribute value to OnMode_value - - label: "Precondition" - verification: | - 1 Dishwasher Mode and OnOff clusters are available on the same endpoint + ./chip-tool dishwashermode write on-mode 0 1 1 - 2 The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. + On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1692170913.264454][3071:3073] CHIP:DMG: StatusIB = + [1692170913.264489][3071:3073] CHIP:DMG: { + [1692170913.264522][3071:3073] CHIP:DMG: status = 0x00 (SUCCESS), + [1692170913.264557][3071:3073] CHIP:DMG: }, disabled: true - label: @@ -58,7 +96,7 @@ tests: verification: | ./chip-tool dishwashermode read on-mode 1 1 - On TH(chip-tool), Verify that OnMode attribute value is an integer or Null + On TH(chip-tool), Verify that OnMode attribute value is an Integer Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 [1690188734.934221][15978:15980] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0003 DataVersion: 74242734 diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_3_2.yaml index 737dd31cc7c433..dfb4d8915d4618 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHM_3_2.yaml @@ -24,6 +24,11 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + !DISHM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL + disabled: true + - label: "Note" verification: | To Execute the TC-DISHM-3.2 test case using reboot in raspi device we followed the below suggested way: @@ -118,6 +123,13 @@ tests: [1690188912.259790][16011:16013] CHIP:DMG: status = 0x00 (SUCCESS), [1690188912.259800][16011:16013] CHIP:DMG: }, [1690188912.259813][16011:16013] CHIP:DMG: + + ./chip-tool dishwashermode read start-up-mode 1 1 + + On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform . + + [1692171314.157274][3112:3114] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0002 DataVersion: 2502960195 + [1692171314.157331][3112:3114] CHIP:TOO: StartUpMode: 0 disabled: true - label: "Step 5: TH reads from the DUT the CurrentMode attribute." diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_3_3.yaml index 3efe1d547d7a2e..2b394a489a86ae 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHM_3_3.yaml @@ -119,12 +119,19 @@ tests: [1690188912.259790][16011:16013] CHIP:DMG: status = 0x00 (SUCCESS), [1690188912.259800][16011:16013] CHIP:DMG: }, [1690188912.259813][16011:16013] CHIP:DMG: + + ./chip-tool dishwashermode read start-up-mode 1 1 + + On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform . + + [1692171314.157274][3112:3114] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0002 DataVersion: 2502960195 + [1692171314.157331][3112:3114] CHIP:TOO: StartUpMode: 0 disabled: true - label: "Step 5: TH reads from the DUT the OnMode attribute." PICS: DISHM.S.A0003 && DISHM.S.A0002 verification: | - Set onmode to any integer value because as default it value has null. + As default value of OnMode attribute is NULL. Set the OnMode to any mode value listed in the SupportedModes entries. ./chip-tool dishwashermode write on-mode 0 1 1 diff --git a/src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml index e6889393400d8c..827771bdd453db 100644 --- a/src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml @@ -67,7 +67,7 @@ tests: #List values range check support https://github.com/project-chip/connectedhomeip/issues/26570 - label: - "Step 4b: TTH reads AttributeList attribute from DUT. 1.The list SHALL + "Step 4b: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index ecd16a23b216fd..d1f05401eeb4ea 100755 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -35,6 +35,104 @@ tests: - name: "nodeId" value: nodeId + - label: "Precondition: Create new user" + PICS: DRLK.S.F00 && DRLK.S.F07 + command: "SetUser" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "OperationType" + value: 0 + - name: "UserIndex" + value: 1 + - name: "UserName" + value: "xxx" + - name: "UserUniqueID" + value: 6452 + - name: "UserStatus" + value: 1 + - name: "UserType" + value: 0 + - name: "CredentialRule" + value: 0 + + - label: "Precondition: Read the user back and verify its fields" + PICS: DRLK.S.F00 && DRLK.S.F07 + command: "GetUser" + arguments: + values: + - name: "UserIndex" + value: 1 + response: + values: + - name: "UserIndex" + value: 1 + - name: "UserName" + value: "xxx" + - name: "UserUniqueID" + value: 6452 + - name: "UserStatus" + value: 1 + - name: "UserType" + value: 0 + - name: "CredentialRule" + value: 0 + - name: "Credentials" + value: [] + - name: "CreatorFabricIndex" + value: 1 + - name: "LastModifiedFabricIndex" + value: 1 + - name: "NextUserIndex" + value: null + + - label: "Precondition: Create new PIN credential and lock/unlock user" + PICS: DRLK.S.F00 && DRLK.S.F07 + command: "SetCredential" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "OperationType" + value: 0 + - name: "Credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "CredentialData" + value: "123456" + - name: "UserIndex" + value: 1 + - name: "UserStatus" + value: null + - name: "UserType" + value: null + response: + values: + - name: "Status" + value: 0 + - name: "UserIndex" + value: null + - name: "NextCredentialIndex" + value: 2 + + - label: "Precondition: Verify created PIN credential" + PICS: DRLK.S.F00 && DRLK.S.F07 + command: "GetCredentialStatus" + arguments: + values: + - name: "Credential" + value: { CredentialType: 1, CredentialIndex: 1 } + response: + values: + - name: "CredentialExists" + value: true + - name: "UserIndex" + value: 1 + - name: "CreatorFabricIndex" + value: 1 + - name: "LastModifiedFabricIndex" + value: 1 + - name: "NextCredentialIndex" + value: null + - label: "Step 1a: TH reads LockState attribute from DUT" PICS: DRLK.S.A0000 command: "readAttribute" @@ -63,7 +161,16 @@ tests: value: LockStateValue - label: "Step 1d: TH sends a Lock Door command to the DUT." - PICS: DRLK.S.C00.Rsp + PICS: DRLK.S.C00.Rsp && DRLK.S.F00 && DRLK.S.F07 + command: "LockDoor" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "PINCode" + value: "123456" + + - label: "Step 1d: TH sends a Lock Door command to the DUT." + PICS: DRLK.S.C00.Rsp && !DRLK.S.F00 && !DRLK.S.F07 command: "LockDoor" timedInteractionTimeoutMs: 1000 @@ -84,10 +191,19 @@ tests: value: 1 - label: "Step 1e: TH sends a Unlock Door command to the DUT." - PICS: DRLK.S.C01.Rsp + PICS: DRLK.S.C01.Rsp && !DRLK.S.F00 && !DRLK.S.F07 command: "UnlockDoor" timedInteractionTimeoutMs: 1000 + - label: "Step 1e: TH sends a Unlock Door command to the DUT." + PICS: DRLK.S.C01.Rsp && DRLK.S.F00 && DRLK.S.F07 + command: "UnlockDoor" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "PINCode" + value: "123456" + - label: "Wait after Unlock Door" PICS: DRLK.S.C00.Rsp cluster: "DelayCommands" @@ -840,7 +956,7 @@ tests: verification: | ./chip-tool doorlock write-by-id 38 0 1 1 - Verify " DUT responds with UNSUPPORTED_WRITE" on the TH(Chip-tool) Log: + Via the TH (chip-tool), verify the UNSUPPORTED_WRITE response for Supported OperatingModes attribute write functionality. [1653637108.039160][3522:3527] CHIP:DMG: StatusIB = [1653637108.039205][3522:3527] CHIP:DMG: { @@ -957,7 +1073,7 @@ tests: ./chip-tool doorlock write-by-id 39 1 1 1 - Verify "DUT responds with UNSUPPORTED_WRITE " on the TH(Chip-tool) Log: + Via the TH (chip-tool), verify the UNSUPPORTED_WRITE response for Default ConfigurationRegister attribute write functionality. [1653637348.333879][3570:3575] CHIP:DMG: StatusIB = [1653637348.333920][3570:3575] CHIP:DMG: { @@ -991,8 +1107,9 @@ tests: command: "readAttribute" attribute: "EnableLocalProgramming" response: - value: 1 saveAs: Current_EnableLocal_Programming + constraints: + type: boolean - label: "Step 26b: TH writes EnableLocalProgramming attribute as false" PICS: DRLK.S.A0028.Write @@ -1029,7 +1146,8 @@ tests: command: "readAttribute" attribute: "EnableOneTouchLocking" response: - value: 0 + constraints: + type: boolean - label: "Step 27b: TH writes EnableOneTouchLocking attribute as true" PICS: DRLK.S.A0029 @@ -1050,7 +1168,8 @@ tests: command: "readAttribute" attribute: "EnableInsideStatusLED" response: - value: 0 + constraints: + type: boolean - label: "Step 28b: TH writes EnableInsideStatusLED attribute as true" PICS: DRLK.S.A002a @@ -1071,7 +1190,8 @@ tests: command: "readAttribute" attribute: "EnablePrivacyModeButton" response: - value: 0 + constraints: + type: boolean - label: "Step 29b: TH writes EnablePrivacy ModeButton attribute as true" PICS: DRLK.S.A002b @@ -1301,8 +1421,9 @@ tests: command: "readAttribute" attribute: "RequirePINforRemoteOperation" response: - value: 0 saveAs: Current_RequirePINFor_RemoteOperation + constraints: + type: boolean - label: "Step 33b: TH writes RequirePINfor RemoteOperation attribute as true" @@ -1411,3 +1532,21 @@ tests: attribute: "NumberOfCredentialsSupportedPerUser" response: value: NumberOfCredentialsSupportedPerUserValue + + - label: "Cleanup the created user" + PICS: DRLK.S.F00 && DRLK.S.F07 + command: "ClearUser" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "UserIndex" + value: 1 + + - label: "Clean the created credential" + PICS: DRLK.S.F00 && DRLK.S.F07 && DRLK.S.C26.Rsp + command: "ClearCredential" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "Credential" + value: { CredentialType: 1, CredentialIndex: 1 } diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml index c00e52dd5674e7..c7b566e61e9b7e 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml @@ -57,7 +57,7 @@ tests: - label: "Step 1a: Trigger the DUT to generate DoorLockAlarm Event (by LockJammed scenario)" - PICS: DRLK.S.E00 && DRLK.S.DetectLockJammed + PICS: DRLK.S.E00 && DRLK.S.M.DetectLockJammed verification: | To trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in lock-app to generate the event, Vendor Dut should have capability to generate this event) @@ -205,7 +205,7 @@ tests: disabled: true - label: "Step 3d: TH reads the LockOperation event from DUT" - PICS: DRLK.S.E02&& DRLK.S.F0c + PICS: DRLK.S.E02 && DRLK.S.F0c verification: | ./chip-tool doorlock read-event lock-operation 1 1 @@ -444,13 +444,13 @@ tests: - label: "Step 5a: TH sends Set User Command to DUT with the following values: - OperationType as 0-Add UserIndex as 4( Different from an existing + OperationType as 0-Add UserIndex as 2( Different from an existing UserIndex) UserName as xxx UserUniqueID as 6452 UserStatus as 1-OccupiedEnabled UserType as 0-UnrestrictedUser CredentialRule as 0-Single" PICS: DRLK.S.F08 && DRLK.S.C1a.Rsp verification: | - ./chip-tool doorlock set-user 0 4 xxx 6452 3 0 0 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock set-user 0 2 xxx 6452 3 0 0 1 1 --timedInteractionTimeoutMs 1000 Via the TH (chip-tool), verify the SUCCESS response for setting the users details. @@ -516,7 +516,7 @@ tests: [1659778039.469878][3278:3283] CHIP:TOO: LockDataType: 2 [1659778039.469903][3278:3283] CHIP:TOO: DataOperationType: 0 [1659778039.469981][3278:3283] CHIP:TOO: OperationSource: 7 - [1659778039.470006][3278:3283] CHIP:TOO: UserIndex: 4 + [1659778039.470006][3278:3283] CHIP:TOO: UserIndex: 2 [1659778039.470031][3278:3283] CHIP:TOO: FabricIndex: 1 [1659778039.470056][3278:3283] CHIP:TOO: SourceNode: 112233 [1659778039.470081][3278:3283] CHIP:TOO: DataIndex: 4 @@ -594,7 +594,7 @@ tests: [1659778136.034043][3293:3298] CHIP:TOO: LockDataType: 2 [1659778136.034068][3293:3298] CHIP:TOO: DataOperationType: 0 [1659778136.034093][3293:3298] CHIP:TOO: OperationSource: 7 - [1659778136.034117][3293:3298] CHIP:TOO: UserIndex: 4 + [1659778136.034117][3293:3298] CHIP:TOO: UserIndex: 2 [1659778136.034142][3293:3298] CHIP:TOO: FabricIndex: 1 [1659778136.034167][3293:3298] CHIP:TOO: SourceNode: 112233 [1659778136.034195][3293:3298] CHIP:TOO: DataIndex: 4 @@ -702,7 +702,7 @@ tests: 5a" PICS: DRLK.S.C1d.Rsp verification: | - ./chip-tool doorlock clear-user 4 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock clear-user 2 1 1 --timedInteractionTimeoutMs 1000 Via the TH (chip-tool), verify the SUCCESS response for clearing the users details. @@ -724,7 +724,7 @@ tests: - label: "Step 6a: TH sends Clear Credential Command to DUT for Credential - created in Step 3a" + created in Preconditions" PICS: DRLK.S.C26.Rsp verification: | ./chip-tool doorlock clear-credential '{ "credentialType" : 1 , "credentialIndex" : 1 }' 1 1 --timedInteractionTimeoutMs 1000 @@ -749,8 +749,8 @@ tests: disabled: true - label: - "Step 6b: TH sends Clear User Command to DUT for User created in Step - 3a" + "Step 6b: TH sends Clear User Command to DUT for user created in + Preconditions" PICS: DRLK.S.C1d.Rsp verification: | ./chip-tool doorlock clear-user 1 1 1 --timedInteractionTimeoutMs 1000 diff --git a/src/app/tests/suites/certification/Test_TC_DT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DT_1_1.yaml new file mode 100755 index 00000000000000..a3b051b576e571 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DT_1_1.yaml @@ -0,0 +1,142 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 57.1.1. [TC-DT-1.1] Base Device Type [DUT as Server] + +PICS: + - MCORE.DT.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: + "Step 1: TH performs a wildcard read of all attributes and endpoints" + verification: | + TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) + ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF + disabled: true + + - label: "Step 2: Verify that each endpoint includes a Descriptor cluster" + verification: | + On TH(chip-tool), Verify that the ReportDataMessage with each endpoint(endpoint 0, endpoint 1 and endpoint 2) includes a Descriptor cluster( Cluster: 0x0000_001D) + below is the sample log provided for the raspi platform: + + [1690185276.189270][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 + [1690185276.189273][40055:40057] CHIP:TOO: ClientList: 1 entries + [1690185276.189275][40055:40057] CHIP:TOO: [1]: 41 + [1690185276.189286][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 + [1690185276.189290][40055:40057] CHIP:TOO: PartsList: 2 entries + [1690185276.189293][40055:40057] CHIP:TOO: [1]: 1 + [1690185276.189295][40055:40057] CHIP:TOO: [2]: 2 + [1690185276.189298][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 + [1690185276.189300][40055:40057] CHIP:TOO: FeatureMap: 0 + [1690185276.189309][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 1390630643 + [1690185276.189311][40055:40057] CHIP:TOO: ClusterRevision: 1 + [1690185276.189326][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 1390630643 + [1690185276.189329][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries + [1690185276.189339][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 1390630643 + [1690185276.189341][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries + [1690185276.189353][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 1390630643 + [1690185276.189356][40055:40057] CHIP:TOO: EventList: 0 entries + [1690185276.189374][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 1390630643 + [1690185276.189378][40055:40057] CHIP:TOO: AttributeList: 10 entries + [1690185276.189380][40055:40057] CHIP:TOO: [1]: 0 + [1690185276.189382][40055:40057] CHIP:TOO: [2]: 1 + [1690185276.189384][40055:40057] CHIP:TOO: [3]: 2 + [1690185276.189386][40055:40057] CHIP:TOO: [4]: 3 + [1690185276.189388][40055:40057] CHIP:TOO: [5]: 65528 + [1690185276.189390][40055:40057] CHIP:TOO: [6]: 65529 + [1690185276.189392][40055:40057] CHIP:TOO: [7]: 65530 + [1690185276.189394][40055:40057] CHIP:TOO: [8]: 65531 + [1690185276.189396][40055:40057] CHIP:TOO: [9]: 65532 + [1690185276.189398][40055:40057] CHIP:TOO: [10]: 65533 + [1690185276.189408][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 3752520678 + [1690185276.189411][40055:40057] CHIP:TOO: Binding: 0 entries + [1690185276.189414][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFFC DataVersion: 3752520678 + + + + [1690185276.266589][40055:40057] CHIP:TOO: [68]: 4294048773 + [1690185276.266629][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 2743502132 + [1690185276.266634][40055:40057] CHIP:TOO: ClientList: 1 entries + [1690185276.266636][40055:40057] CHIP:TOO: [1]: 6 + [1690185276.266646][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2743502132 + [1690185276.266652][40055:40057] CHIP:TOO: PartsList: 0 entries + [1690185276.266656][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 2743502132 + [1690185276.266660][40055:40057] CHIP:TOO: FeatureMap: 0 + [1690185276.266668][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 2743502132 + [1690185276.266670][40055:40057] CHIP:TOO: ClusterRevision: 1 + [1690185276.266686][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 2743502132 + [1690185276.266689][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries + [1690185276.266699][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 2743502132 + [1690185276.266702][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries + [1690185276.266714][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 2743502132 + [1690185276.266717][40055:40057] CHIP:TOO: EventList: 0 entries + [1690185276.266737][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 2743502132 + [1690185276.266742][40055:40057] CHIP:TOO: AttributeList: 10 entries + [1690185276.266744][40055:40057] CHIP:TOO: [1]: 0 + [1690185276.266746][40055:40057] CHIP:TOO: [2]: 1 + [1690185276.266748][40055:40057] CHIP:TOO: [3]: 2 + [1690185276.266750][40055:40057] CHIP:TOO: [4]: 3 + [1690185276.266752][40055:40057] CHIP:TOO: [5]: 65528 + [1690185276.266755][40055:40057] CHIP:TOO: [6]: 65529 + [1690185276.266757][40055:40057] CHIP:TOO: [7]: 65530 + [1690185276.266759][40055:40057] CHIP:TOO: [8]: 65531 + [1690185276.266761][40055:40057] CHIP:TOO: [9]: 65532 + [1690185276.266762][40055:40057] CHIP:TOO: [10]: 65533 + [1690185276.266774][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 523636689 + [1690185276.266779][40055:40057] CHIP:TOO: Binding: 0 entries + + + [1690185276.399194][40055:40057] CHIP:TOO: Revision: 1 + [1690185276.399196][40055:40057] CHIP:TOO: } + [1690185276.399212][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 516620155 + [1690185276.399216][40055:40057] CHIP:TOO: ServerList: 5 entries + [1690185276.399218][40055:40057] CHIP:TOO: [1]: 4 + [1690185276.399220][40055:40057] CHIP:TOO: [2]: 6 + [1690185276.399222][40055:40057] CHIP:TOO: [3]: 29 + [1690185276.399223][40055:40057] CHIP:TOO: [4]: 47 + [1690185276.399225][40055:40057] CHIP:TOO: [5]: 1030 + [1690185276.399235][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 516620155 + [1690185276.399238][40055:40057] CHIP:TOO: ClientList: 0 entries + [1690185276.399247][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 516620155 + [1690185276.399251][40055:40057] CHIP:TOO: PartsList: 0 entries + [1690185276.399254][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 516620155 + [1690185276.399256][40055:40057] CHIP:TOO: FeatureMap: 0 + [1690185276.399265][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 516620155 + [1690185276.399267][40055:40057] CHIP:TOO: ClusterRevision: 1 + [1690185276.399282][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 516620155 + [1690185276.399285][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries + [1690185276.399294][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 516620155 + [1690185276.399297][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries + [1690185276.399309][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 516620155 + [1690185276.399311][40055:40057] CHIP:TOO: EventList: 0 entries + [1690185276.399329][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 516620155 + [1690185276.399334][40055:40057] CHIP:TOO: AttributeList: 10 entries + [1690185276.399336][40055:40057] CHIP:TOO: [1]: 0 + [1690185276.399338][40055:40057] CHIP:TOO: [2]: 1 + [1690185276.399340][40055:40057] CHIP:TOO: [3]: 2 + [1690185276.399341][40055:40057] CHIP:TOO: [4]: 3 + [1690185276.399343][40055:40057] CHIP:TOO: [5]: 65528 + [1690185276.399345][40055:40057] CHIP:TOO: [6]: 65529 + [1690185276.399347][40055:40057] CHIP:TOO: [7]: 65530 + [1690185276.399349][40055:40057] CHIP:TOO: [8]: 65531 + [1690185276.399350][40055:40057] CHIP:TOO: [9]: 65532 + [1690185276.399352][40055:40057] CHIP:TOO: [10]: 65533 + [1690185276.399354][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_002F Attribute 0x0000_0000 DataVersion: 850311415 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_FAN_2_5.yaml b/src/app/tests/suites/certification/Test_TC_FAN_2_5.yaml index 9283ca7d602bcc..1f2d084b49c7b0 100644 --- a/src/app/tests/suites/certification/Test_TC_FAN_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_FAN_2_5.yaml @@ -38,4 +38,4 @@ tests: attribute: "AirflowDirection" response: constraints: - type: enum8 + type: AirflowDirectionEnum diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml new file mode 100644 index 00000000000000..ed34bd274d83d6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml @@ -0,0 +1,228 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 26.3.1. [TC-GRPKEY-2.1] Attributes [DUT-Server] + +PICS: + - GRPKEY.S + +config: + nodeId: 0x12344321 + cluster: "Group Key Management" + endpoint: 0 + + # Users should set endpoint value on the command line to PIXIT.G.ENDPOINT + Groups.Endpoint: 1 + +tests: + - label: "Step 0: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Step 1: TH reads GroupKeyMap attribute from DUT using a + fabric-filtered read." + PICS: GRPKEY.S.A0000 + command: "readAttribute" + attribute: "GroupKeyMap" + fabricFiltered: true + response: + constraints: + type: list + + - label: + "Step 2: TH binds GroupId 0x0103 with GroupKeySetID 0x01a3 in the + GroupKeyMap attribute list on GroupKeyManagement cluster by writing + the GroupKeyMap attribute with one entry as follows: List item + 1:,GroupId: 0x0103,GroupKeySetId: 0x01a3" + PICS: GRPKEY.S.A0000 + command: "writeAttribute" + attribute: "GroupKeyMap" + arguments: + value: [{ FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a3 }] + + - label: + "Step 3: TH reads GroupKeyMap Attribute from the GroupKeyManagement + cluster from DUT using a fabric-filtered read." + PICS: GRPKEY.S.A0000 + command: "readAttribute" + attribute: "GroupKeyMap" + response: + value: [{ FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a3 }] + + - label: + "Step 4: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a3, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + + - label: + "Step 5: TH sends AddGroup Command to DUT on PIXIT.G.ENDPOINT with the + the following settings GroupID: 0x0103 GroupName: 'Test Group'" + PICS: G.S.C00.Rsp + endpoint: Groups.Endpoint + cluster: "Groups" + command: "AddGroup" + arguments: + values: + - name: GroupID + value: 0x0103 + - name: GroupName + value: "Test Group" + response: + values: + - name: "Status" + value: 0 + - name: "GroupID" + value: 0x0103 + + - label: + "Step 6: TH reads GroupTable attribute from GroupKeyManagement cluster + on DUT." + PICS: GRPKEY.S.A0001 + command: "readAttribute" + attribute: "GroupTable" + response: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0103, + Endpoints: [Groups.Endpoint], + GroupName: "Test Group", + }, + ] + + - label: + "Step 7a: TH attempts to write to the GroupTable attribute from + GroupKeyManagement cluster on DUT" + PICS: GRPKEY.S.A0001 && G.S.F00 + command: "writeAttribute" + attribute: "GroupTable" + arguments: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0104, + Endpoints: [Groups.Endpoint], + GroupName: "Test Group2", + }, + ] + response: + error: UNSUPPORTED_WRITE + + - label: + "Step 7b: TH attempts to write to the GroupTable attribute from + GroupKeyManagement cluster on DUT" + PICS: GRPKEY.S.A0001 && !G.S.F00 + command: "writeAttribute" + attribute: "GroupTable" + arguments: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0104, + Endpoints: [Groups.Endpoint], + GroupName: "", + }, + ] + response: + error: UNSUPPORTED_WRITE + + - label: + "Step 8: TH reads MaxGroupsPerFabric attribute from GroupKeyManagement + cluster on DUT using a fabric-filtered read." + PICS: GRPKEY.S.A0002 + command: "readAttribute" + attribute: "MaxGroupsPerFabric" + fabricFiltered: true + response: + saveAs: MaxGroupsPerFabricValue + constraints: + type: int16u + minValue: 0 + maxValue: 65535 + + - label: + "Step 9: TH attempts to write MaxGroupsPerFabric attribute of + GroupKeyManagement cluster to the same value as read in step 8." + PICS: GRPKEY.S.A0002 + command: "writeAttribute" + attribute: "MaxGroupsPerFabric" + arguments: + value: MaxGroupsPerFabricValue + response: + error: UNSUPPORTED_WRITE + + - label: + "Step 10: TH reads MaxGroupKeysPerFabric attribute from + GroupKeyManagement cluster on DUT using a fabric-filtered read." + PICS: GRPKEY.S.A0003 + command: "readAttribute" + attribute: "MaxGroupKeysPerFabric" + fabricFiltered: true + response: + saveAs: MaxGroupKeysPerFabricValue + constraints: + type: int16u + minValue: 0 + maxValue: 65535 + + - label: + "Step 11: TH attempts to write MaxGroupKeysPerFabric attribute of + GroupKeyManagement cluster on DUT to the same value as read in step + 10." + PICS: GRPKEY.S.A0003 + command: "writeAttribute" + attribute: "MaxGroupKeysPerFabric" + arguments: + value: MaxGroupKeysPerFabricValue + response: + error: UNSUPPORTED_WRITE + + - label: + "Step 12: TH cleans up the groups by sending the RemoveAllGroups + command to the DUT on PIXIT.G.ENDPOINT" + PICS: GRPKEY.S.C04.Rsp + cluster: "Groups" + endpoint: Groups.Endpoint + command: "RemoveAllGroups" + + - label: "TH verifies the group has been removed in the GroupTable" + PICS: GRPKEY.S.A0001 + cluster: "Group Key Management" + command: "readAttribute" + attribute: "GroupTable" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml new file mode 100644 index 00000000000000..d601de9a55f522 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml @@ -0,0 +1,774 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 26.3.2. [TC-GRPKEY-2.2] Primary functionality with DUT as Server + +PICS: + - GRPKEY.S + +config: + nodeId: 0x12344321 + cluster: "Group Key Management" + endpoint: 0 + +tests: + - label: "Step 0: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Step 1: TH reads MaxGroupKeysPerFabric attribute from + GroupKeyManagement cluster on DUT using a fabric-filtered read. Save + the value as Max_GrpKey for future use." + PICS: GRPKEY.S.A0003 + command: "readAttribute" + attribute: "MaxGroupKeysPerFabric" + fabricFiltered: true + response: + saveAs: Max_GrpKey + + - label: + "Step 2: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + + - label: + "Step 3: TH sends KeySetRead command to GroupKeyManagement cluster + with GroupKeySetID as 0x01a" + PICS: GRPKEY.S.C01.Rsp + command: "KeySetRead" + arguments: + values: + - name: "GroupKeySetID" + value: 0x01a + response: + values: + - name: "GroupKeySet" + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: null, + EpochStartTime0: 1, + EpochKey1: null, + EpochStartTime1: "18446744073709551613", + EpochKey2: null, + EpochStartTime2: "18446744073709551614", + } + + - label: + "Step 4: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT on EP0." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: null, + EpochStartTime1: null, + EpochKey2: null, + EpochStartTime2: null, + } + + - label: + "Step 5: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT on EP0." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: null, + EpochStartTime2: null, + } + + - label: + "Step 6: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: null, + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 7: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: null, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 8: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 0, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 9: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: null, + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 10: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: null, + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 11: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT. Note: EpochStartTime1 is earlier than EpochStartTime0" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: "18446744073709551613", + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: 1, + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 12: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT. Note: EpochKey1 and EpochStartTime1 are null when + EpochKey2 and EpochStartTime2 are not null" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: null, + EpochStartTime1: null, + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 13: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT. Note: EpochKey2 is set to null and EpochStartTime2 is + not null" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: null, + EpochStartTime2: "18446744073709551614", + } + response: + error: INVALID_COMMAND + + - label: + "Step 14: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT. Note: EpochKey2 is not null and EpochStartTime2 is + null" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: null, + } + response: + error: INVALID_COMMAND + + - label: + "Step 15: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT. Note: EpochStartTime2 is earlier than EpochStartTime1" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 1, + } + response: + error: INVALID_COMMAND + + - label: + "Step 16: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16: Repeat the step by sending EpochKey1 with 1 byte value (< 16 + bytes)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16: Note: Repeat the step by sending EpochKey2 with 1 byte value + (< 16 bytes)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16a: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT. Note: Repeat step 16 by sending KeySetWrite Command + with EpochKey0, EpochKey1 and EpochKey2 having 15 bytes value (< 16 + byte)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcddde", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16a: Repeat step 16a by sending KeySetWrite Command with + EpochKey1 having 15 bytes value (< 16 byte)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcddde", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16a: Repeat step 16a by sending KeySetWrite Command with + EpochKey2 having 15 bytes value (< 16 byte)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcddde", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16b: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT. Note: Repeat step 16 by sending KeySetWrite Command + with EpochKey0, EpochKey1 and EpochKey2 having 17 bytes value (> 16 + bytes)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedfde", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16b: Repeat step 16 by sending KeySetWrite Command with + EpochKey1 having 17 bytes value (> 16 bytes)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedfde", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 16b: Repeat step 16 by sending KeySetWrite Command with + EpochKey2 having 17 bytes value (> 16 bytes)" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedfde", + EpochStartTime2: 1, + } + response: + error: CONSTRAINT_ERROR + + - label: + "Step 17: TH sends KeySetWrite command in the GroupKeyManagement + cluster to DUT on EP0. Note: KeySetWrite command is sent with + different EpochKeys,EpochStartTime1 and EpochStartTime2 values" + PICS: GRPKEY.S.C00.Rsp + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d3d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d4d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "17446744073709551613", + EpochKey2: "hex:d5d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "17446744073709551614", + } + + - label: + "Step 18: TH sends KeySetRead command to GroupKeyManagement cluster + with GroupKeySetID as 0x01a" + PICS: GRPKEY.S.C01.Rsp + command: "KeySetRead" + arguments: + values: + - name: "GroupKeySetID" + value: 0x01a + response: + values: + - name: "GroupKeySet" + value: + { + GroupKeySetID: 0x01a, + GroupKeySecurityPolicy: 0, + EpochKey0: null, + EpochStartTime0: 1, + EpochKey1: null, + EpochStartTime1: "17446744073709551613", + EpochKey2: null, + EpochStartTime2: "17446744073709551614", + } + + - label: + "Step 19: TH sends KeySetRead command to GroupKeyManagement cluster + with GroupKeySetID as 0x01b that does not exist in the GroupKeyMap + attribute list." + PICS: GRPKEY.S.C01.Rsp + command: "KeySetRead" + arguments: + values: + - name: "GroupKeySetID" + value: 0x01b + response: + error: NOT_FOUND + + - label: + "Step 20: TH removes the Group key set that was added by sending a + KeySetRemove command to the GroupKeyManagement cluster with the + GroupKeySetID field set to 0x01a." + PICS: GRPKEY.S.C03.Rsp + command: "KeySetRemove" + arguments: + values: + - name: "GroupKeySetID" + value: 0x01a + + - label: + "Step 21: TH sends KeySetWrite command to DUT until size of list for + TH’s fabric in GroupKeyMap attribute contains Max_GrpKey entries, + starting with GroupKeySetID 1 and incrementing by 1 each time." + verification: | + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 1,"groupKeySecurityPolicy": 0, "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1,"epochKey1":"d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 18446744073709551613,"epochKey2":"d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 18446744073709551614 }' 1 0 + + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1692341708.962913][8072:8074] CHIP:DMG: InvokeResponseMessage = + [1692341708.962924][8072:8074] CHIP:DMG: { + [1692341708.962937][8072:8074] CHIP:DMG: suppressResponse = false, + [1692341708.962945][8072:8074] CHIP:DMG: InvokeResponseIBs = + [1692341708.962962][8072:8074] CHIP:DMG: [ + [1692341708.962973][8072:8074] CHIP:DMG: InvokeResponseIB = + [1692341708.963075][8072:8074] CHIP:DMG: { + [1692341708.963086][8072:8074] CHIP:DMG: CommandStatusIB = + [1692341708.963103][8072:8074] CHIP:DMG: { + [1692341708.963114][8072:8074] CHIP:DMG: CommandPathIB = + [1692341708.963128][8072:8074] CHIP:DMG: { + [1692341708.963143][8072:8074] CHIP:DMG: EndpointId = 0x0, + [1692341708.963173][8072:8074] CHIP:DMG: ClusterId = 0x3f, + [1692341708.963186][8072:8074] CHIP:DMG: CommandId = 0x3, + [1692341708.963199][8072:8074] CHIP:DMG: }, + [1692341708.963214][8072:8074] CHIP:DMG: + [1692341708.963253][8072:8074] CHIP:DMG: StatusIB = + [1692341708.963260][8072:8074] CHIP:DMG: { + [1692341708.963268][8072:8074] CHIP:DMG: status = 0x00 (SUCCESS), + [1692341708.963274][8072:8074] CHIP:DMG: }, + [1692341708.963281][8072:8074] CHIP:DMG: + [1692341708.963286][8072:8074] CHIP:DMG: }, + [1692341708.963294][8072:8074] CHIP:DMG: + [1692341708.963299][8072:8074] CHIP:DMG: }, + [1692341708.963308][8072:8074] CHIP:DMG: + [1692341708.963313][8072:8074] CHIP:DMG: ], + [1692341708.963323][8072:8074] CHIP:DMG: + [1692341708.963328][8072:8074] CHIP:DMG: InteractionModelRevision = 1 + [1692341708.963333][8072:8074] CHIP:DMG: }, + + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 2,"groupKeySecurityPolicy": 0, "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1,"epochKey1":"d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 18446744073709551613,"epochKey2":"d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 18446744073709551614 }' 1 0 + + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1692341838.536136][8091:8094] CHIP:DMG: InvokeResponseMessage = + [1692341838.536144][8091:8094] CHIP:DMG: { + [1692341838.536151][8091:8094] CHIP:DMG: suppressResponse = false, + [1692341838.536157][8091:8094] CHIP:DMG: InvokeResponseIBs = + [1692341838.536169][8091:8094] CHIP:DMG: [ + [1692341838.536175][8091:8094] CHIP:DMG: InvokeResponseIB = + [1692341838.536187][8091:8094] CHIP:DMG: { + [1692341838.536193][8091:8094] CHIP:DMG: CommandStatusIB = + [1692341838.536201][8091:8094] CHIP:DMG: { + [1692341838.536207][8091:8094] CHIP:DMG: CommandPathIB = + [1692341838.536215][8091:8094] CHIP:DMG: { + [1692341838.536227][8091:8094] CHIP:DMG: EndpointId = 0x0, + [1692341838.536238][8091:8094] CHIP:DMG: ClusterId = 0x3f, + [1692341838.536245][8091:8094] CHIP:DMG: CommandId = 0x0, + [1692341838.536252][8091:8094] CHIP:DMG: }, + [1692341838.536262][8091:8094] CHIP:DMG: + [1692341838.536269][8091:8094] CHIP:DMG: StatusIB = + [1692341838.536277][8091:8094] CHIP:DMG: { + [1692341838.536285][8091:8094] CHIP:DMG: status = 0x00 (SUCCESS), + [1692341838.536292][8091:8094] CHIP:DMG: }, + [1692341838.536300][8091:8094] CHIP:DMG: + [1692341838.536306][8091:8094] CHIP:DMG: }, + [1692341838.536316][8091:8094] CHIP:DMG: + [1692341838.536322][8091:8094] CHIP:DMG: }, + [1692341838.536331][8091:8094] CHIP:DMG: + [1692341838.536337][8091:8094] CHIP:DMG: ], + [1692341838.536348][8091:8094] CHIP:DMG: + [1692341838.536353][8091:8094] CHIP:DMG: InteractionModelRevision = 1 + [1692341838.536359][8091:8094] CHIP:DMG: } + PICS: GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 23: TH again sends KeySetWrite command to DUT with any other + GroupKeySetID not used yet." + PICS: GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 0x003, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 1, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: "18446744073709551613", + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: "18446744073709551614", + } + response: + error: RESOURCE_EXHAUSTED + + - label: "Step 24: TH sends KeySetReadAllIndices command to DUT." + verification: | + ./chip-tool groupkeymanagement key-set-read-all-indices 1 0 + + Verify that DUT sends KeySetReadAllIndicesResponse listing Max_GrpKey number of GroupKeySetID's on TH(chip-tool) Logs: + + [1692342735.277532][8297:8300] CHIP:TOO: KeySetReadAllIndicesResponse: { + [1692342735.277541][8297:8300] CHIP:TOO: groupKeySetIDs: 3 entries + [1692342735.277546][8297:8300] CHIP:TOO: [1]: 2 + [1692342735.277550][8297:8300] CHIP:TOO: [2]: 1 + [1692342735.277554][8297:8300] CHIP:TOO: [3]: 0 + [1692342735.277557][8297:8300] CHIP:TOO: } + PICS: GRPKEY.S.C05.Rsp && PICS_SKIP_SAMPLE_APP + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 22: TH removes the Group key set that was added by sending a + KeySetRemove command to the GroupKeyManagement cluster with the + GroupKeySetID field set to 0x0" + PICS: GRPKEY.S.C03.Rsp + command: "KeySetRemove" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0 + response: + error: INVALID_COMMAND + + - label: + "Step 23: TH removes the Group key set that was added by sending a + KeySetRemove command to the GroupKeyManagement cluster with the + GroupKeySetID field set to 0x01b that does not exist in the + GroupKeyMap attribute list." + PICS: GRPKEY.S.C03.Rsp + command: "KeySetRemove" + arguments: + values: + - name: "GroupKeySetID" + value: 0x01b + response: + error: NOT_FOUND diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml new file mode 100644 index 00000000000000..2dc8dbd544b233 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml @@ -0,0 +1,96 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 26.3.6. [TC-GRPKEY-5.4] Verification for KeySetReadResponse Command for + CacheAndSync + +PICS: + - GRPKEY.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: + "Step 1: Admin sends KeySetWrite command by setting + GroupKeySecurityPolicy to CacheAndSync to GroupKeyManagement cluster + on the DUT Note: KeySetWrite command is sent by setting the following + fields to the corresponding values. Values given below are for + reference purpose. groupKeySetID: 0x01a3 groupKeySecurityPolicy: + CacheAndSync (1) epochKey0: d0d1d2d3d4d5d6d7d8d9dadbdcdddedf + epochStartTime0: 0 epochKey1: d1d1d2d3d4d5d6d7d8d9dadbdcdddedf + epochStartTime1: 2220001 epochKey2: d2d1d2d3d4d5d6d7d8d9dadbdcdddedf + epochStartTime2: 2220002" + PICS: "!GRPKEY.S.F00 && GRPKEY.S.C00.Rsp " + verification: | + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 42, "groupKeySecurityPolicy": 1, "epochKey0": "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 0, "epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + + Verify DUT sends INVALID_COMMAND response on TH(chip-tool) Logs: + + [1689931711.125327][6681:6684] CHIP:DMG: InvokeResponseMessage = + [1689931711.125329][6681:6684] CHIP:DMG: { + [1689931711.125331][6681:6684] CHIP:DMG: suppressResponse = false, + [1689931711.125333][6681:6684] CHIP:DMG: InvokeResponseIBs = + [1689931711.125337][6681:6684] CHIP:DMG: [ + [1689931711.125339][6681:6684] CHIP:DMG: InvokeResponseIB = + [1689931711.125343][6681:6684] CHIP:DMG: { + [1689931711.125344][6681:6684] CHIP:DMG: CommandStatusIB = + [1689931711.125347][6681:6684] CHIP:DMG: { + [1689931711.125349][6681:6684] CHIP:DMG: CommandPathIB = + [1689931711.125353][6681:6684] CHIP:DMG: { + [1689931711.125355][6681:6684] CHIP:DMG: EndpointId = 0x0, + [1689931711.125357][6681:6684] CHIP:DMG: ClusterId = 0x3f, + [1689931711.125360][6681:6684] CHIP:DMG: CommandId = 0x0, + [1689931711.125362][6681:6684] CHIP:DMG: }, + [1689931711.125365][6681:6684] CHIP:DMG: + [1689931711.125367][6681:6684] CHIP:DMG: StatusIB = + [1689931711.125370][6681:6684] CHIP:DMG: { + [1689931711.125372][6681:6684] CHIP:DMG: status = 0x85 (INVALID_COMMAND), + [1689931711.125374][6681:6684] CHIP:DMG: }, + [1689931711.125376][6681:6684] CHIP:DMG: + [1689931711.125378][6681:6684] CHIP:DMG: }, + [1689931711.125381][6681:6684] CHIP:DMG: + [1689931711.125383][6681:6684] CHIP:DMG: }, + [1689931711.125386][6681:6684] CHIP:DMG: + [1689931711.125388][6681:6684] CHIP:DMG: ], + [1689931711.125391][6681:6684] CHIP:DMG: + [1689931711.125393][6681:6684] CHIP:DMG: InteractionModelRevision = 1 + [1689931711.125395][6681:6684] CHIP:DMG: }, + disabled: true + + - label: + "Step 2: Admin sends KeySetWrite command by setting the values as + given in Step 1" + PICS: GRPKEY.S.F00 && GRPKEY.S.C00.Rsp + verification: | + CacheAndSync feature bit not enabled in V1.2 + disabled: true + + - label: + "Step 3: Admin maps GroupId 0x0103 with GroupKeySetID 0x01a3 in the + GroupKeyMap attribute list on GroupKeyManagement cluster on the DUT" + PICS: GRPKEY.F00 && GRPKEY.S.A0000 + verification: | + CacheAndSync feature bit not enabled in V1.2 + disabled: true + + - label: "Step 4: Admin sends KeySetRead Command to DUT" + PICS: GRPKEY.S.F00 && GRPKEY.S.C01.Rsp + verification: | + CacheAndSync feature bit not enabled in V1.2 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_G_2_2.yaml b/src/app/tests/suites/certification/Test_TC_G_2_2.yaml index 5764f51594be54..f2f708f273f8d0 100644 --- a/src/app/tests/suites/certification/Test_TC_G_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_G_2_2.yaml @@ -34,11 +34,13 @@ tests: ./chip-tool groupkeymanagement read max-groups-per-fabric 1 0 - Verify the "MaxGroupsPerFabric" value is 12 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + Verify for the "MaxGroupsPerFabric" value on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - [1683797307.084182][38841:38843] CHIP:DMG: } - [1683797307.084220][38841:38843] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0002 DataVersion: 366443848 - [1683797307.084237][38841:38843] CHIP:TOO: MaxGroupsPerFabric: 12 + [1683802556.948465][41067:41069] CHIP:DMG: } + [1683802556.948507][41067:41069] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0002 DataVersion: 1698601848 + [1683802556.948520][41067:41069] CHIP:TOO: MaxGroupsPerFabric: 12 + + Note: MaxGroupsPerFabric has a value 12 on TH log. It can be any value between [min=4, max=65535]. disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_G_2_3.yaml b/src/app/tests/suites/certification/Test_TC_G_2_3.yaml index 316409e16ae96f..c4a35cad32dad2 100644 --- a/src/app/tests/suites/certification/Test_TC_G_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_G_2_3.yaml @@ -26,22 +26,21 @@ config: endpoint: 0 tests: - - label: "TH is commissioned with DUT" + - label: "Precondition" verification: | + TH is commissioned with DUT - disabled: true + TH reads the MaxGroupsPerFabric from Group key Management Cluster and saves it as maxgroups - - label: - "Pre-Conditions: TH reads the MaxGroupsPerFabric from Group key - Management Cluster and saves it as maxgroups" - verification: | ./chip-tool groupkeymanagement read max-groups-per-fabric 1 0 - Verify the "MaxGroupsPerFabric value" on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + Verify for the "MaxGroupsPerFabric" value on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1683802556.948465][41067:41069] CHIP:DMG: } [1683802556.948507][41067:41069] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0002 DataVersion: 1698601848 [1683802556.948520][41067:41069] CHIP:TOO: MaxGroupsPerFabric: 12 + + Note: MaxGroupsPerFabric has a value 12 on TH log. It can be any value between [min=4, max=65535]. disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_G_2_4.yaml b/src/app/tests/suites/certification/Test_TC_G_2_4.yaml index 22227d62333728..39647c2df3c00d 100644 --- a/src/app/tests/suites/certification/Test_TC_G_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_G_2_4.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 131.2.4. [TC-G-2.4] Commands - AddGroup Command with same GroupID on @@ -23,413 +22,271 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" + cluster: "Groups" endpoint: 0 -tests: - - label: "Pre-Conditions" - verification: | - 1 Note: This test case is applicable only when DUT supports Group Cluster at least on two end points: PIXIT.G.ENDPOINT,PIXIT.G.ENDPOINT2 + # Users should set endpoint value on the command line to PIXIT.G.ENDPOINT1 + Groups.Endpoint1: 1 + + # Users should set endpoint value on the command line to PIXIT.G.ENDPOINT2 + Groups.Endpoint2: 2 - 2 TH is commissioned with DUT - disabled: true +tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 1: Verify that PIXIT.G.ENDPOINT and PIXIT.G.ENDPOINT2 are different." - verification: | - Verify that PIXIT.G.ENDPOINT and PIXIT.G.ENDPOINT2 are different. - disabled: true + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: Groups.Endpoint1 + - name: "Value2" + value: Groups.Endpoint2 + response: + - values: + - name: "Equals" + value: false - label: "Step 2: TH sends KeySetWrite command in the GroupKeyManagement - cluster to DUT on EP0 using a key that is pre-installed on the TH. - GroupKeySet fields are as follows: GroupKeySetID: 1 - GroupKeySecurityPolicy: TrustFirst (0) EpochKey0: - d0d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime0: 2220000 EpochKey1: - d0d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime1: 2220001 EpochKey2: - d0d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime2: 2220002" - verification: | - ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 1, "groupKeySecurityPolicy": 0, "epochKey0": "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": - "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 - - Verify DUT responds with SUCCESS status response on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689928280.676270][5573:5576] CHIP:DMG: InvokeResponseMessage = - [1689928280.676273][5573:5576] CHIP:DMG: { - [1689928280.676275][5573:5576] CHIP:DMG: suppressResponse = false, - [1689928280.676277][5573:5576] CHIP:DMG: InvokeResponseIBs = - [1689928280.676280][5573:5576] CHIP:DMG: [ - [1689928280.676281][5573:5576] CHIP:DMG: InvokeResponseIB = - [1689928280.676285][5573:5576] CHIP:DMG: { - [1689928280.676287][5573:5576] CHIP:DMG: CommandStatusIB = - [1689928280.676289][5573:5576] CHIP:DMG: { - [1689928280.676291][5573:5576] CHIP:DMG: CommandPathIB = - [1689928280.676293][5573:5576] CHIP:DMG: { - [1689928280.676295][5573:5576] CHIP:DMG: EndpointId = 0x0, - [1689928280.676297][5573:5576] CHIP:DMG: ClusterId = 0x3f, - [1689928280.676300][5573:5576] CHIP:DMG: CommandId = 0x0, - [1689928280.676302][5573:5576] CHIP:DMG: }, - [1689928280.676304][5573:5576] CHIP:DMG: - [1689928280.676306][5573:5576] CHIP:DMG: StatusIB = - [1689928280.676309][5573:5576] CHIP:DMG: { - [1689928280.676311][5573:5576] CHIP:DMG: status = 0x00 (SUCCESS), - [1689928280.676313][5573:5576] CHIP:DMG: }, - [1689928280.676315][5573:5576] CHIP:DMG: - [1689928280.676317][5573:5576] CHIP:DMG: }, - [1689928280.676320][5573:5576] CHIP:DMG: - [1689928280.676321][5573:5576] CHIP:DMG: }, - [1689928280.676324][5573:5576] CHIP:DMG: - [1689928280.676326][5573:5576] CHIP:DMG: ], - [1689928280.676328][5573:5576] CHIP:DMG: - disabled: true + cluster to DUT." + PICS: GRPKEY.S.C00.Rsp + cluster: "Group Key Management" + command: "KeySetWrite" + arguments: + values: + - name: GroupKeySet + value: + { + GroupKeySetID: 1, + GroupKeySecurityPolicy: 0, + EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime0: 2220000, + EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime1: 2220001, + EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", + EpochStartTime2: 2220002, + } - label: "Step 3: TH writes the GroupKeyMap attribute in the GroupKeyManagement cluster on EP0 with one entry binding GroupId(0x0001) with GroupKeySetID 1" - verification: | - ./chip-tool groupkeymanagement write group-key-map '[{"groupId": 1, "groupKeySetID": 1, "fabricIndex": 1} ]' 1 0 - - Verify DUT responds with SUCCESS status response on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - 1689928416.859884][5757:5760] CHIP:DMG: WriteResponseMessage = - [1689928416.859894][5757:5760] CHIP:DMG: { - [1689928416.859903][5757:5760] CHIP:DMG: AttributeStatusIBs = - [1689928416.859921][5757:5760] CHIP:DMG: [ - [1689928416.859931][5757:5760] CHIP:DMG: AttributeStatusIB = - [1689928416.859943][5757:5760] CHIP:DMG: { - [1689928416.859953][5757:5760] CHIP:DMG: AttributePathIB = - [1689928416.859964][5757:5760] CHIP:DMG: { - [1689928416.859975][5757:5760] CHIP:DMG: Endpoint = 0x0, - [1689928416.859988][5757:5760] CHIP:DMG: Cluster = 0x3f, - [1689928416.859999][5757:5760] CHIP:DMG: Attribute = 0x0000_0000, - [1689928416.860009][5757:5760] CHIP:DMG: } - [1689928416.860025][5757:5760] CHIP:DMG: - [1689928416.860036][5757:5760] CHIP:DMG: StatusIB = - [1689928416.860050][5757:5760] CHIP:DMG: { - [1689928416.860062][5757:5760] CHIP:DMG: status = 0x00 (SUCCESS), - [1689928416.860071][5757:5760] CHIP:DMG: }, - [1689928416.860081][5757:5760] CHIP:DMG: - [1689928416.860088][5757:5760] CHIP:DMG: }, - [1689928416.860104][5757:5760] CHIP:DMG: - [1689928416.860113][5757:5760] CHIP:DMG: AttributeStatusIB = - [1689928416.860126][5757:5760] CHIP:DMG: { - [1689928416.860135][5757:5760] CHIP:DMG: AttributePathIB = - [1689928416.860145][5757:5760] CHIP:DMG: { - [1689928416.860156][5757:5760] CHIP:DMG: Endpoint = 0x0, - [1689928416.860167][5757:5760] CHIP:DMG: Cluster = 0x3f, - [1689928416.860177][5757:5760] CHIP:DMG: Attribute = 0x0000_0000, - [1689928416.860185][5757:5760] CHIP:DMG: ListIndex = Null, - [1689928416.860197][5757:5760] CHIP:DMG: } - [1689928416.860209][5757:5760] CHIP:DMG: - [1689928416.860216][5757:5760] CHIP:DMG: StatusIB = - [1689928416.860224][5757:5760] CHIP:DMG: { - [1689928416.860231][5757:5760] CHIP:DMG: status = 0x00 (SUCCESS), - [1689928416.860239][5757:5760] CHIP:DMG: }, - [1689928416.860251][5757:5760] CHIP:DMG: - [1689928416.860261][5757:5760] CHIP:DMG: }, - [1689928416.860277][5757:5760] CHIP:DMG: - [1689928416.860286][5757:5760] CHIP:DMG: ], - [1689928416.860307][5757:5760] CHIP:DMG: - [1689928416.860319][5757:5760] CHIP:DMG: InteractionModelRevision = 1 - [1689928416.860328][5757:5760] CHIP:DMG: } - disabled: true + PICS: GRPKEY.S.A0000 + cluster: "Group Key Management" + command: "writeAttribute" + attribute: "GroupKeyMap" + arguments: + value: [{ FabricIndex: 1, GroupId: 0x0001, GroupKeySetID: 1 }] - label: - "Step 4: TH cleans up the groups by sending the RemoveAllGroups - command to the DUT on PIXIT.G.ENDPOINT,PIXIT.G.ENDPOINT2" - verification: | - ./chip-tool groups remove-all-groups 1 1 - - Verify DUT responds with SUCCESS status response on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689928700.354515][5800:5803] CHIP:DMG: { - [1689928700.354516][5800:5803] CHIP:DMG: suppressResponse = false, - [1689928700.354518][5800:5803] CHIP:DMG: InvokeResponseIBs = - [1689928700.354522][5800:5803] CHIP:DMG: [ - [1689928700.354524][5800:5803] CHIP:DMG: InvokeResponseIB = - [1689928700.354527][5800:5803] CHIP:DMG: { - [1689928700.354528][5800:5803] CHIP:DMG: CommandStatusIB = - [1689928700.354531][5800:5803] CHIP:DMG: { - [1689928700.354533][5800:5803] CHIP:DMG: CommandPathIB = - [1689928700.354537][5800:5803] CHIP:DMG: { - [1689928700.354539][5800:5803] CHIP:DMG: EndpointId = 0x1, - [1689928700.354541][5800:5803] CHIP:DMG: ClusterId = 0x4, - [1689928700.354544][5800:5803] CHIP:DMG: CommandId = 0x4, - [1689928700.354546][5800:5803] CHIP:DMG: }, - [1689928700.354549][5800:5803] CHIP:DMG: - [1689928700.354551][5800:5803] CHIP:DMG: StatusIB = - [1689928700.354554][5800:5803] CHIP:DMG: { - [1689928700.354556][5800:5803] CHIP:DMG: status = 0x00 (SUCCESS), - [1689928700.354558][5800:5803] CHIP:DMG: }, - [1689928700.354560][5800:5803] CHIP:DMG: - [1689928700.354562][5800:5803] CHIP:DMG: }, - [1689928700.354565][5800:5803] CHIP:DMG: - [1689928700.354567][5800:5803] CHIP:DMG: }, - [1689928700.354569][5800:5803] CHIP:DMG: - [1689928700.354571][5800:5803] CHIP:DMG: ], - [1689928700.354574][5800:5803] CHIP:DMG: - + "Step 4a: TH cleans up the groups by sending the RemoveAllGroups + command to the DUT on PIXIT.G.ENDPOINT1" + endpoint: Groups.Endpoint1 + command: "RemoveAllGroups" - ./chip-tool groups remove-all-groups 1 2 - - Verify DUT responds with SUCCESS status response on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689928742.133296][5810:5813] CHIP:DMG: InvokeResponseMessage = - [1689928742.133303][5810:5813] CHIP:DMG: { - [1689928742.133311][5810:5813] CHIP:DMG: suppressResponse = false, - [1689928742.133317][5810:5813] CHIP:DMG: InvokeResponseIBs = - [1689928742.133329][5810:5813] CHIP:DMG: [ - [1689928742.133336][5810:5813] CHIP:DMG: InvokeResponseIB = - [1689928742.133348][5810:5813] CHIP:DMG: { - [1689928742.133355][5810:5813] CHIP:DMG: CommandStatusIB = - [1689928742.133364][5810:5813] CHIP:DMG: { - [1689928742.133371][5810:5813] CHIP:DMG: CommandPathIB = - [1689928742.133380][5810:5813] CHIP:DMG: { - [1689928742.133388][5810:5813] CHIP:DMG: EndpointId = 0x2, - [1689928742.133397][5810:5813] CHIP:DMG: ClusterId = 0x4, - [1689928742.133405][5810:5813] CHIP:DMG: CommandId = 0x4, - [1689928742.133413][5810:5813] CHIP:DMG: }, - [1689928742.133424][5810:5813] CHIP:DMG: - [1689928742.133435][5810:5813] CHIP:DMG: StatusIB = - [1689928742.133447][5810:5813] CHIP:DMG: { - [1689928742.133455][5810:5813] CHIP:DMG: status = 0x00 (SUCCESS), - [1689928742.133463][5810:5813] CHIP:DMG: }, - [1689928742.133472][5810:5813] CHIP:DMG: - [1689928742.133478][5810:5813] CHIP:DMG: }, - [1689928742.133490][5810:5813] CHIP:DMG: - [1689928742.133500][5810:5813] CHIP:DMG: }, - [1689928742.133508][5810:5813] CHIP:DMG: - [1689928742.133514][5810:5813] CHIP:DMG: ], - [1689928742.133526][5810:5813] CHIP:DMG: - disabled: true + - label: + "Step 4b: TH cleans up the groups by sending the RemoveAllGroups + command to the DUT on PIXIT.G.ENDPOINT2" + endpoint: Groups.Endpoint2 + command: "RemoveAllGroups" - label: "Step 5a: TH sends AddGroup command to DUT on PIXIT.G.ENDPOINT with - the following fields: GroupID as 0x0001 GroupName as 'Gp1'" + the following fields: GroupID as 0x0001,GroupName as 'Gp1'" PICS: G.S.C00.Rsp && G.S.C00.Tx - verification: | - ./chip-tool groups add-group 0x0001 Gp1 1 1 - - Verify the AddGroupResponse with following field: - Status is SUCCESS - GroupID is 0x0001 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689928877.256544][5836:5839] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0004 Command 0x0000_0000 - [1689928877.256740][5836:5839] CHIP:TOO: AddGroupResponse: { - [1689928877.256774][5836:5839] CHIP:TOO: status: 0 - [1689928877.256777][5836:5839] CHIP:TOO: groupID: 1 - [1689928877.256780][5836:5839] CHIP:TOO: } - disabled: true + endpoint: Groups.Endpoint1 + command: "AddGroup" + arguments: + values: + - name: GroupID + value: 0x0001 + - name: GroupName + value: "Gp1" + response: + values: + - name: "Status" + value: 0x00 + - name: "GroupID" + value: 0x0001 - label: "Step 5b: TH sends AddGroup command to DUT on PIXIT.G.ENDPOINT2 with - the following fields: GroupID as 0x0001 GroupName as 'Gp2'" + the following fields: GroupID as 0x0001,GroupName as 'Gp2'" PICS: G.S.C00.Rsp && G.S.C00.Tx - verification: | - ./chip-tool groups add-group 0x0001 Gp2 1 2 - - Verify the AddGroupResponse with following field: - Status is SUCCESS - GroupID is 0x0001 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689928983.569742][5852:5855] CHIP:DMG: Received Command Response Data, Endpoint=2 Cluster=0x0000_0004 Command=0x0000_0000 - [1689928983.569765][5852:5855] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0004 Command 0x0000_0000 - [1689928983.569795][5852:5855] CHIP:TOO: AddGroupResponse: { - [1689928983.569805][5852:5855] CHIP:TOO: status: 0 - [1689928983.569813][5852:5855] CHIP:TOO: groupID: 1 - [1689928983.569821][5852:5855] CHIP:TOO: } - disabled: true + endpoint: Groups.Endpoint2 + command: "AddGroup" + arguments: + values: + - name: GroupID + value: 0x0001 + - name: GroupName + value: "Gp2" + response: + values: + - name: "Status" + value: 0x00 + - name: "GroupID" + value: 0x0001 - label: "Step 6: TH reads GroupTable attribute from the GroupKeyManagement cluster from DUT on EP0" PICS: GRPKEY.S.A0001 - verification: | - ./chip-tool groupkeymanagement read group-table 1 0 - - Verify the GroupTable with the following entries - GroupID is 0x0001 - If G.S.F00(GN) is true then GroupName is Gp2 , Otherwise empty - Endpoints list contains a endpoints 1, 2 - on TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689929132.327353][5868:5871] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0001 DataVersion: 229830719 - [1689929132.327657][5868:5871] CHIP:TOO: GroupTable: 1 entries - [1689929132.327692][5868:5871] CHIP:TOO: [1]: { - [1689929132.327708][5868:5871] CHIP:TOO: GroupId: 1 - [1689929132.327724][5868:5871] CHIP:TOO: Endpoints: 2 entries - [1689929132.327736][5868:5871] CHIP:TOO: [1]: 1 - [1689929132.327744][5868:5871] CHIP:TOO: [2]: 2 - [1689929132.327754][5868:5871] CHIP:TOO: GroupName: Gp2 - [1689929132.327762][5868:5871] CHIP:TOO: FabricIndex: 1 - [1689929132.327769][5868:5871] CHIP:TOO: } - disabled: true + cluster: "Group Key Management" + command: "readAttribute" + attribute: "GroupTable" + response: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0001, + Endpoints: [Groups.Endpoint1, Groups.Endpoint2], + }, + ] - label: - "Step 7: Verify that the GroupTable contains an entry with the - GroupName as 'Gp2'" - PICS: G.S.F00 - verification: | - ./chip-tool groupkeymanagement read group-table 1 0 - - Verify the GroupTable with the following entries - GroupID is 0x0001 - If G.S.F00(GN) is true then GroupName is Gp2 , Otherwise empty - Endpoints list contains a endpoints 1, 2 - on TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689929132.327353][5868:5871] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0001 DataVersion: 229830719 - [1689929132.327657][5868:5871] CHIP:TOO: GroupTable: 1 entries - [1689929132.327692][5868:5871] CHIP:TOO: [1]: { - [1689929132.327708][5868:5871] CHIP:TOO: GroupId: 1 - [1689929132.327724][5868:5871] CHIP:TOO: Endpoints: 2 entries - [1689929132.327736][5868:5871] CHIP:TOO: [1]: 1 - [1689929132.327744][5868:5871] CHIP:TOO: [2]: 2 - [1689929132.327754][5868:5871] CHIP:TOO: GroupName: Gp2 - [1689929132.327762][5868:5871] CHIP:TOO: FabricIndex: 1 - [1689929132.327769][5868:5871] CHIP:TOO: } - disabled: true + "Step 7: TH reads GroupTable attribute from the GroupKeyManagement + cluster from DUT on EP0, Verify that the GroupTable contains an entry + with the GroupName as 'Gp2'" + PICS: GRPKEY.S.A0001 && G.S.F00 + cluster: "Group Key Management" + command: "readAttribute" + attribute: "GroupTable" + response: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0001, + Endpoints: [Groups.Endpoint1, Groups.Endpoint2], + GroupName: "Gp2", + }, + ] - label: "Step 8: TH sends ViewGroup command to DUT on PIXIT.G.ENDPOINT with the following fields: GroupID as 0x0001" PICS: G.S.C01.Rsp && G.S.C01.Tx - verification: | - ./chip-tool groups view-group 0x0001 1 1 - - Verify the ViewGroupResponse with following fields : - Status is SUCCESS - GroupID is 0x0001 - If G.S.F00(GN) is true then GroupName is Gp1, Otherwise empty - on TH(Chip-tool) Log , below is the sample log provided for the raspi platform: - - Note: GroupName for GroupID 0x0001 is same on ENDPOINT 1 and ENDPOINT 2 - - [1689929265.503341][5898:5901] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0004 Command 0x0000_0001 - [1689929265.503352][5898:5901] CHIP:TOO: ViewGroupResponse: { - [1689929265.503357][5898:5901] CHIP:TOO: status: 0 - [1689929265.503359][5898:5901] CHIP:TOO: groupID: 1 - [1689929265.503361][5898:5901] CHIP:TOO: groupName: Gp2 - [1689929265.503363][5898:5901] CHIP:TOO: } - disabled: true + endpoint: Groups.Endpoint1 + command: "ViewGroup" + arguments: + values: + - name: GroupID + value: 0x0001 + response: + values: + - name: Status + value: 0x00 + - name: GroupID + value: 0x0001 - label: - "Step 9: Verify that the ViewGroupResponse contains GroupName as - 'GP2'. Note: GroupName for GroupID 0x0001 is same on PIXIT.G.ENDPOINT - and PIXIT.G.ENDPOINT2" - PICS: G.S.F00 - verification: | - ./chip-tool groups view-group 0x0001 1 1 - - Verify the ViewGroupResponse with following fields : - Status is SUCCESS - GroupID is 0x0001 - If G.S.F00(GN) is true then GroupName is Gp1, Otherwise empty - on TH(Chip-tool) Log , below is the sample log provided for the raspi platform: - - Note: GroupName for GroupID 0x0001 is same on ENDPOINT 1 and ENDPOINT 2 - - [1689929265.503341][5898:5901] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0004 Command 0x0000_0001 - [1689929265.503352][5898:5901] CHIP:TOO: ViewGroupResponse: { - [1689929265.503357][5898:5901] CHIP:TOO: status: 0 - [1689929265.503359][5898:5901] CHIP:TOO: groupID: 1 - [1689929265.503361][5898:5901] CHIP:TOO: groupName: Gp2 - [1689929265.503363][5898:5901] CHIP:TOO: } - disabled: true + "Step 9: TH sends ViewGroup command to DUT on PIXIT.G.ENDPOINT with + the following fields: GroupID as 0x0001. Verify that the + ViewGroupResponse contains GroupName as 'GP2'" + PICS: G.S.C01.Rsp && G.S.C01.Tx && G.S.F00 + endpoint: Groups.Endpoint1 + command: "ViewGroup" + arguments: + values: + - name: GroupID + value: 0x0001 + response: + values: + - name: Status + value: 0x00 + - name: GroupID + value: 0x0001 + - name: GroupName + value: "Gp2" - label: "Step 10: TH sends RemoveGroup command to DUT on PIXIT.G.ENDPOINT as unicast with the following field: GroupID as 0x0001" PICS: G.S.C03.Rsp && G.S.C03.Tx - verification: | - ./chip-tool groups remove-group 0x0001 1 1 - - Verify the RemoveGroupResponse with Status as SUCCESS and GroupID is 0x0001 on the TH(Chip-tool) Log, below is the sample log provided for the raspi platform: - - [1689929333.591022][5912:5915] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0004 Command 0x0000_0003 - [1689929333.591032][5912:5915] CHIP:TOO: RemoveGroupResponse: { - [1689929333.591035][5912:5915] CHIP:TOO: status: 0 - [1689929333.591037][5912:5915] CHIP:TOO: groupID: 1 - [1689929333.591039][5912:5915] CHIP:TOO: } - disabled: true + endpoint: Groups.Endpoint1 + command: "RemoveGroup" + arguments: + values: + - name: "GroupID" + value: 0x0001 + response: + values: + - name: "Status" + value: 0x00 + - name: "GroupID" + value: 0x0001 - label: "Step 11: TH reads GroupTable attribute from the GroupKeyManagement cluster from DUT on EP0" - PICS: GRPKEY.S.A0001 - verification: | - ./chip-tool groupkeymanagement read group-table 1 0 - - Verify that Grouptable entry with GroupID 0x0001 is associated with the Endpoint 2 and no entry with GroupID 0x0001 associated with the Endpoint 1 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + PICS: GRPKEY.S.A0001 && !G.S.F00 + cluster: "Group Key Management" + command: "readAttribute" + attribute: "GroupTable" + response: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0001, + Endpoints: [Groups.Endpoint2], + GroupName: "", + }, + ] - [1689929376.037105][5924:5927] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0001 DataVersion: 229830719 - [1689929376.037147][5924:5927] CHIP:TOO: GroupTable: 1 entries - [1689929376.037191][5924:5927] CHIP:TOO: [1]: { - [1689929376.037204][5924:5927] CHIP:TOO: GroupId: 1 - [1689929376.037213][5924:5927] CHIP:TOO: Endpoints: 1 entries - [1689929376.037224][5924:5927] CHIP:TOO: [1]: 2 - [1689929376.037233][5924:5927] CHIP:TOO: GroupName: Gp2 - [1689929376.037241][5924:5927] CHIP:TOO: FabricIndex: 1 - [1689929376.037246][5924:5927] CHIP:TOO: } - disabled: true + - label: + "Step 11: TH reads GroupTable attribute from the GroupKeyManagement + cluster from DUT on EP0" + PICS: GRPKEY.S.A0001 && G.S.F00 + cluster: "Group Key Management" + command: "readAttribute" + attribute: "GroupTable" + response: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0001, + Endpoints: [Groups.Endpoint2], + GroupName: "Gp2", + }, + ] - label: "Step 12: TH sends RemoveGroup command to DUT on PIXIT.G.ENDPOINT2 as unicast with the following field: GroupID as 0x0001" PICS: G.S.C03.Rsp && G.S.C03.Tx - verification: | - ./chip-tool groups remove-group 0x0001 1 2 - - Verify DUT responds with SUCCESS status response on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689929465.586716][5960:5963] CHIP:DMG: }, - [1689929465.586745][5960:5963] CHIP:DMG: Received Command Response Data, Endpoint=2 Cluster=0x0000_0004 Command=0x0000_0003 - [1689929465.586771][5960:5963] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0004 Command 0x0000_0003 - [1689929465.586795][5960:5963] CHIP:TOO: RemoveGroupResponse: { - [1689929465.586813][5960:5963] CHIP:TOO: status: 0 - [1689929465.586818][5960:5963] CHIP:TOO: groupID: 1 - [1689929465.586826][5960:5963] CHIP:TOO: } - disabled: true + endpoint: Groups.Endpoint2 + command: "RemoveGroup" + arguments: + values: + - name: "GroupID" + value: 0x0001 + response: + values: + - name: "Status" + value: 0x00 + - name: "GroupID" + value: 0x0001 - label: "Step 13: TH reads GroupTable attribute from the GroupKeyManagement cluster from DUT on EP0" PICS: GRPKEY.S.A0001 - verification: | - ./chip-tool groupkeymanagement read group-table 1 0 - - Verify that there is no entry that has GroupID 0x0001 associated with the Endpoint 2 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689934348.530688][6829:6831] CHIP:DMG: ReportDataMessage = - [1689934348.530718][6829:6831] CHIP:DMG: { - [1689934348.530740][6829:6831] CHIP:DMG: AttributeReportIBs = - [1689934348.530775][6829:6831] CHIP:DMG: [ - [1689934348.530801][6829:6831] CHIP:DMG: AttributeReportIB = - [1689934348.530837][6829:6831] CHIP:DMG: { - [1689934348.530864][6829:6831] CHIP:DMG: AttributeDataIB = - [1689934348.530900][6829:6831] CHIP:DMG: { - [1689934348.530935][6829:6831] CHIP:DMG: DataVersion = 0xdc445868, - [1689934348.530968][6829:6831] CHIP:DMG: AttributePathIB = - [1689934348.531003][6829:6831] CHIP:DMG: { - [1689934348.531056][6829:6831] CHIP:DMG: Endpoint = 0x0, - [1689934348.531095][6829:6831] CHIP:DMG: Cluster = 0x3f, - [1689934348.531143][6829:6831] CHIP:DMG: Attribute = 0x0000_0001, - [1689934348.531178][6829:6831] CHIP:DMG: } - [1689934348.531225][6829:6831] CHIP:DMG: - [1689934348.531259][6829:6831] CHIP:DMG: Data = [ - [1689934348.531303][6829:6831] CHIP:DMG: - [1689934348.531340][6829:6831] CHIP:DMG: ], - [1689934348.531384][6829:6831] CHIP:DMG: }, - [1689934348.531421][6829:6831] CHIP:DMG: - [1689934348.531450][6829:6831] CHIP:DMG: }, - [1689934348.531496][6829:6831] CHIP:DMG: - [1689934348.531521][6829:6831] CHIP:DMG: ], - [1689934348.531566][6829:6831] CHIP:DMG: - [1689934348.531592][6829:6831] CHIP:DMG: SuppressResponse = true, - [1689934348.531619][6829:6831] CHIP:DMG: InteractionModelRevision = 1 - [1689934348.531655][6829:6831] CHIP:DMG: } - [1689934348.531858][6829:6831] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0001 DataVersion: 3695466600 - [1689934348.531940][6829:6831] CHIP:TOO: GroupTable: 0 entries - disabled: true + cluster: "Group Key Management" + command: "readAttribute" + attribute: "GroupTable" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_G_3_2.yaml b/src/app/tests/suites/certification/Test_TC_G_3_2.yaml index baecd65484d037..7c0428940d7992 100644 --- a/src/app/tests/suites/certification/Test_TC_G_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_G_3_2.yaml @@ -163,69 +163,64 @@ tests: [1686907301.834723][16351:16351] CHIP:DMG: InteractionModelRevision = 1 [1686907301.834728][16351:16351] CHIP:DMG: }, - ./chip-tool groups add-group 0x0002 gp2 1 1 + ./chip-tool groups add-group 0x0002 gp2 1 0 Verify the AddGroup Command on TH (all-Clusters-app) log and below is the sample log provided for the raspi platform: - [1686907598.850173][16351:16351] CHIP:DMG: InvokeRequestMessage = - [1686907598.850178][16351:16351] CHIP:DMG: { - [1686907598.850181][16351:16351] CHIP:DMG: suppressResponse = false, - [1686907598.850186][16351:16351] CHIP:DMG: timedRequest = false, - [1686907598.850191][16351:16351] CHIP:DMG: InvokeRequests = - [1686907598.850198][16351:16351] CHIP:DMG: [ - [1686907598.850200][16351:16351] CHIP:DMG: CommandDataIB = - [1686907598.850204][16351:16351] CHIP:DMG: { - [1686907598.850206][16351:16351] CHIP:DMG: CommandPathIB = - [1686907598.850210][16351:16351] CHIP:DMG: { - [1686907598.850213][16351:16351] CHIP:DMG: EndpointId = 0x1, - [1686907598.850217][16351:16351] CHIP:DMG: ClusterId = 0x4, - [1686907598.850220][16351:16351] CHIP:DMG: CommandId = 0x0, - [1686907598.850224][16351:16351] CHIP:DMG: }, - [1686907598.850228][16351:16351] CHIP:DMG: - [1686907598.850231][16351:16351] CHIP:DMG: CommandFields = - [1686907598.850234][16351:16351] CHIP:DMG: { - [1686907598.850238][16351:16351] CHIP:DMG: 0x0 = 2, - [1686907598.850242][16351:16351] CHIP:DMG: 0x1 = "gp2" (3 chars), - [1686907598.850245][16351:16351] CHIP:DMG: }, - [1686907598.850248][16351:16351] CHIP:DMG: }, - [1686907598.850252][16351:16351] CHIP:DMG: - [1686907598.850255][16351:16351] CHIP:DMG: ], - [1686907598.850260][16351:16351] CHIP:DMG: - [1686907598.850263][16351:16351] CHIP:DMG: InteractionModelRevision = 1 - [1686907598.850265][16351:16351] CHIP:DMG: }, - - ./chip-tool groups add-group 0x0003 gp3 1 1 + [1692699413.744145][17310:17310] CHIP:DMG: InvokeRequests = + [1692699413.744164][17310:17310] CHIP:DMG: [ + [1692699413.744174][17310:17310] CHIP:DMG: CommandDataIB = + [1692699413.744183][17310:17310] CHIP:DMG: { + [1692699413.744192][17310:17310] CHIP:DMG: CommandPathIB = + [1692699413.744204][17310:17310] CHIP:DMG: { + [1692699413.744216][17310:17310] CHIP:DMG: EndpointId = 0x0, + [1692699413.744228][17310:17310] CHIP:DMG: ClusterId = 0x4, + [1692699413.744239][17310:17310] CHIP:DMG: CommandId = 0x0, + [1692699413.744250][17310:17310] CHIP:DMG: }, + [1692699413.744263][17310:17310] CHIP:DMG: + [1692699413.744274][17310:17310] CHIP:DMG: CommandFields = + [1692699413.744285][17310:17310] CHIP:DMG: { + [1692699413.744299][17310:17310] CHIP:DMG: 0x0 = 2, + [1692699413.744313][17310:17310] CHIP:DMG: 0x1 = "gp2" (3 chars), + [1692699413.744325][17310:17310] CHIP:DMG: }, + [1692699413.744335][17310:17310] CHIP:DMG: }, + [1692699413.744351][17310:17310] CHIP:DMG: + [1692699413.744360][17310:17310] CHIP:DMG: ], + [1692699413.744377][17310:17310] CHIP:DMG: + [1692699413.744387][17310:17310] CHIP:DMG: InteractionModelRevision = 10 + [1692699413.744396][17310:17310] CHIP:DMG: }, + + + ./chip-tool groups add-group 0x0003 gp3 1 0 Verify the AddGroup Command in TH (all-Clusters-app) log and below is the sample log provided for the raspi platform: - [1666939441.007758][8101:8101] CHIP:DMG: InvokeResponseMessage = - [1666939441.007761][8101:8101] CHIP:DMG: { - [1666939441.007763][8101:8101] CHIP:DMG: suppressResponse = false, - [1666939441.007766][8101:8101] CHIP:DMG: InvokeResponseIBs = - [1666939441.007769][8101:8101] CHIP:DMG: [ - [1666939441.007771][8101:8101] CHIP:DMG: InvokeResponseIB = - [1666939441.007775][8101:8101] CHIP:DMG: { - [1666939441.007777][8101:8101] CHIP:DMG: CommandDataIB = - [1666939441.007780][8101:8101] CHIP:DMG: { - [1666939441.007782][8101:8101] CHIP:DMG: CommandPathIB = - [1666939441.007785][8101:8101] CHIP:DMG: { - [1666939441.007787][8101:8101] CHIP:DMG: EndpointId = 0x1, - [1666939441.007789][8101:8101] CHIP:DMG: ClusterId = 0x4, - [1666939441.007791][8101:8101] CHIP:DMG: CommandId = 0x0, - [1666939441.007794][8101:8101] CHIP:DMG: }, - [1666939441.007796][8101:8101] CHIP:DMG: - [1666939441.007799][8101:8101] CHIP:DMG: CommandFields = - [1666939441.007802][8101:8101] CHIP:DMG: { - [1666939441.007805][8101:8101] CHIP:DMG: 0x0 = 0, - [1666939441.007807][8101:8101] CHIP:DMG: 0x1 = 3, - [1666939441.007809][8101:8101] CHIP:DMG: }, - [1666939441.007811][8101:8101] CHIP:DMG: }, - [1666939441.007814][8101:8101] CHIP:DMG: - [1666939441.007817][8101:8101] CHIP:DMG: }, - [1666939441.007819][8101:8101] CHIP:DMG: - [1666939441.007821][8101:8101] CHIP:DMG: ], - [1666939441.007825][8101:8101] CHIP:DMG: - [1666939441.007827][8101:8101] CHIP:DMG: InteractionModelRevision = 1 + [1692699555.720509][17310:17310] CHIP:DMG: InvokeRequestMessage = + [1692699555.720526][17310:17310] CHIP:DMG: { + [1692699555.720542][17310:17310] CHIP:DMG: suppressResponse = false, + [1692699555.720554][17310:17310] CHIP:DMG: timedRequest = false, + [1692699555.720564][17310:17310] CHIP:DMG: InvokeRequests = + [1692699555.720584][17310:17310] CHIP:DMG: [ + [1692699555.720594][17310:17310] CHIP:DMG: CommandDataIB = + [1692699555.720606][17310:17310] CHIP:DMG: { + [1692699555.720615][17310:17310] CHIP:DMG: CommandPathIB = + [1692699555.720627][17310:17310] CHIP:DMG: { + [1692699555.720640][17310:17310] CHIP:DMG: EndpointId = 0x0, + [1692699555.720652][17310:17310] CHIP:DMG: ClusterId = 0x4, + [1692699555.720664][17310:17310] CHIP:DMG: CommandId = 0x0, + [1692699555.720674][17310:17310] CHIP:DMG: }, + [1692699555.720687][17310:17310] CHIP:DMG: + [1692699555.720697][17310:17310] CHIP:DMG: CommandFields = + [1692699555.720709][17310:17310] CHIP:DMG: { + [1692699555.720723][17310:17310] CHIP:DMG: 0x0 = 3, + [1692699555.720762][17310:17310] CHIP:DMG: 0x1 = "gp3" (3 chars), + [1692699555.720780][17310:17310] CHIP:DMG: }, + [1692699555.720790][17310:17310] CHIP:DMG: }, + [1692699555.720806][17310:17310] CHIP:DMG: + [1692699555.720815][17310:17310] CHIP:DMG: ], + [1692699555.720833][17310:17310] CHIP:DMG: + [1692699555.720843][17310:17310] CHIP:DMG: InteractionModelRevision = 10 + [1692699555.720852][17310:17310] CHIP:DMG: }, disabled: true - label: "Step 1: DUT sends GetGroupMembership command to TH" diff --git a/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml b/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml index 0901e2cdf77d77..2a32e97e4872e0 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,46 +38,44 @@ tests: Here the command to enter interactive mode:-- ./chip-tool interactive start disabled: true - - label: "Step 0a: TH reads from the DUT the IdleModeInterval attribute." + - label: "Step 0a: " PICS: " !ICDM.S " verification: | When the ICDM feature is not supported or enabled, the SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT is set to 60 minutes. disabled: true - - label: "Step 0b: TH reads from the DUT the IdleModeInterval attribute." + - label: "Step 0b: CR1 reads from the DUT the IdleModeInterval attribute." PICS: ICDM.S verification: | - TH reads from the DUT the IdleModeInterval attribute by sending below mentioned command + CR1 reads from the DUT the IdleModeInterval attribute by sending below mentioned command - icdmanagement read idle-mode-interval 1 0 - Please note down the value of IdleModeInterval as SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT for use in the next step validations. + icdmanagement read idle-mode-interval 1 0 + Please note down the value of IdleModeInterval as SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT for use in the next step validations. - [1690475024.398278][5675:5677] CHIP:DMG: SuppressResponse = true, - [1690475024.398282][5675:5677] CHIP:DMG: InteractionModelRevision = 1 - [1690475024.398285][5675:5677] CHIP:DMG: } - [1690475024.398735][5675:5677] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0000 DataVersion: 4216223957 - [1690475024.398921][5675:5677] CHIP:TOO: IdleModeInterval: 1 - [1690475024.399202][5675:5677] CHIP:EM: <<< [E:28320i S:44238 M:28503816 (Ack:266918637)] (S) Msg TX to 1:0000000000000001 [3C19] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690475024.399208][5675:5677] CHIP:IN: (S) Sending msg 28503816 on secure session with LSID: 44238 - [1690475024.399217][5675:5677] CHIP:EM: Flushed pending ack for MessageCounter:266918637 on exchange 28320i + [1692870543.225457][7160:7162] CHIP:DMG: SuppressResponse = true, + [1692870543.225495][7160:7162] CHIP:DMG: InteractionModelRevision = 10 + [1692870543.225528][7160:7162] CHIP:DMG: } + [1692870543.225723][7160:7162] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0000 DataVersion: 4022467249 + [1692870543.225795][7160:7162] CHIP:TOO: IdleModeInterval: 2000 + [1692870543.225992][7160:7162] CHIP:EM: <<< [E:52837i S:57653 M:52559591 (Ack:263018291)] (S) Msg TX to 1:0000000000000001 [853D] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: - "Step 1: TH sends a subscription message to the DUT with + "Step 1: CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value greater than SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT. DUT sends a report data - action to the TH. TH sends a success status response to the DUT. DUT - sends a Subscribe Response Message to the TH to activate the + action to the TH. CR1 sends a success status response to the DUT. DUT + sends a Subscribe Response Message to the CR1 to activate the subscription." verification: | Please run the following command on the TH to test the subscription feature and verify that the value of MaxIntervalCeiling is set correctly(set the value greater than SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT) - onoff subscribe on-off 100 600 1 1 --keepSubscriptions true + onoff subscribe on-off 100 600 1 1 --keepSubscriptions true - On the TH( chip-tool), verify a report data message is received and verify it contains the following data : + On the CR1( chip-tool), verify a report data message is received and verify it contains the following data : 1. Verify Report Data Message Received: - Check if a report data message is received on the TH. + Check if a report data message is received on the CR1. 2. Verify Report Data Contents: Confirm that the received report data message contains the data of the attribute/event that was previously requested. @@ -115,11 +113,11 @@ tests: disabled: true - label: - "Step 2: TH sends a subscription message to the DUT with + "Step 2: CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value less than SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT. DUT sends a report data - action to the TH. TH sends a success status response to the DUT. DUT - sends a Subscribe Response Message to the TH to activate the + action to the CR1. CR1 sends a success status response to the DUT. DUT + sends a Subscribe Response Message to the CR1 to activate the subscription." verification: | Please run the following command on the TH to test the subscription feature and verify that the value of MaxIntervalCeiling is set correctly( set the value less than SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT) @@ -127,9 +125,9 @@ tests: basicinformation subscribe location 10 400 1 0 --keepSubscriptions true - On the TH(chip-tool), verify a report data message is received and verify it contains the following data : + On the CR1(chip-tool), verify a report data message is received and verify it contains the following data : 1. Verify Report Data Message Received: - Check if a report data message is received on the TH (target hardware). + Check if a report data message is received on the CR1 (target hardware). 2. Verify Report Data Contents: Confirm that the received report data message contains the data of the attribute/event that was previously requested. @@ -166,13 +164,13 @@ tests: disabled: true - label: - "Step 3: Setup TH2 such that it does not have access to a specific - cluster. TH2 sends a subscription message to subscribe to an attribute + "Step 3: Setup CR2 such that it does not have access to a specific + cluster. CR2 sends a subscription message to subscribe to an attribute on that cluster for which it does not have access. AttributePath = [[Attribute = Attribute, Cluster = ClusterID, Endpoint = EndpointID ]]." verification: | - Please send the below mentioned command to configure TH2 without access to a specific cluster, we send the ACL command, allowing access only to the Level Control cluster (cluster ID: 8); any attempts to subscribe to or use commands from other clusters will result in a status of 'INVALID_ACTION + To ensure that CR1 and CR2 are on the same fabric and that CR1 grants access to CR2, Please send the below mentioned command, it will configure TH2 without access to a specific cluster, we send the ACL command, allowing access only to the Level Control cluster (cluster ID: 8); any attempts to subscribe to or use commands from other clusters will result in a status of 'INVALID_ACTION accesscontrol write acl '[{"privilege":5, "authMode":2, "subjects":[112233], "targets":null, "fabricIndex": 1},{"privilege":3, "authMode":2, "subjects":[4], "targets":[{"cluster":8, "endpoint":null, "deviceType":null}]}]' 1 0 @@ -240,7 +238,7 @@ tests: [1689933254.566916][48781:48783] CHIP:EM: <<< [E:6316i S:13964 M:156974240 (Ack:46397313)] (S) Msg TX to 1:0000000000000001 [B15F] --- Type 0000:10 (SecureChannel:StandaloneAck) [1689933254.566922][48781:48783] CHIP:IN: (S) Sending msg 156974240 on secure session with LSID: 13964 - If TH2 attempts to subscribe to an attribute on a cluster (ClusterID) for which it does not have access, the AttributePath used for the subscription would be in the form [[Attribute = AttributeName, Cluster = ClusterID, Endpoint = EndpointID]], but this action will be denied, and TH2 will not be able to access the attribute due to the restricted access. + If CR2 attempts to subscribe to an attribute on a cluster (ClusterID) for which it does not have access, the AttributePath used for the subscription would be in the form [[Attribute = AttributeName, Cluster = ClusterID, Endpoint = EndpointID]], but this action will be denied, and CR2 will not be able to access the attribute due to the restricted access. below provided the example command used to subscribe location attribute from basicinformation cluster from node id(4) that have access to the “levelcontrol” cluster @@ -261,12 +259,12 @@ tests: disabled: true - label: - "Step 4: Setup TH2 such that it does not have access to all attributes - on a specific cluster and endpoint. TH2 sends a subscription request + "Step 4: Setup CR2 such that it does not have access to all attributes + on a specific cluster and endpoint. CR2 sends a subscription request to subscribe to all attributes for which it does not have access. AttributePath = [[Cluster = ClusterID, Endpoint = EndpointID ]]." verification: | - Please send the below mentioned command to configure TH2 without access to a specific cluster on Specific endpoint, we send the ACL command, allowing access only to the Level Control cluster (cluster ID: 8) on endpoint 1 ; any attempts to subscribe to or use commands from other clusters will result in a status of 'INVALID_ACTION + To ensure that CR1 and CR2 are on the same fabric and that CR1 grants access to CR2, Please send the below mentioned command, it will configure CR2 without access to a specific cluster on Specific endpoint, we send the ACL command, allowing access only to the Level Control cluster (cluster ID: 8) on endpoint 1 ; any attempts to subscribe to or use commands from other clusters will result in a status of 'INVALID_ACTION accesscontrol write acl '[{"privilege":5, "authMode":2, "subjects":[112233], "targets":null, "fabricIndex": 1},{"privilege":3, "authMode":2, "subjects":[4], "targets":[{"cluster":8, "endpoint":1, "deviceType":null}]}]' 1 0 @@ -330,7 +328,7 @@ tests: [1687418564.590811][167960:167962] CHIP:DMG: } [1687418564.590882][167960:167962] CHIP:DMG: WriteClient moving to [AwaitingDe] - If TH2 attempts to subscribe to an attribute on a cluster (ClusterID) for which it does not have access, the AttributePath used for the subscription would be in the form AttributePath = [[Cluster = ClusterID, Endpoint = EndpointID ]]., but this action will be denied, and TH2 will not be able to access the attribute due to the restricted access. + If CR2 attempts to subscribe to an attribute on a cluster (ClusterID) for which it does not have access, the AttributePath used for the subscription would be in the form AttributePath = [[Cluster = ClusterID, Endpoint = EndpointID ]]., but this action will be denied, and CR2 will not be able to access the attribute due to the restricted access. below provided the example command to subscribe all attributes onto endpoint 1 for onoff cluster from node id(4) that have access to the “levelcontrol” cluster onto endpoint 1 @@ -354,12 +352,12 @@ tests: disabled: true - label: - "Step 5: Setup TH2 such that it does not have access to an Endpoint. - TH2 sends a subscription request to subscribe to all attributes on all + "Step 5: Setup CR2 such that it does not have access to an Endpoint. + CR2 sends a subscription request to subscribe to all attributes on all clusters on a specific Endpoint for which it does not have access. AttributePath = [[ Endpoint = EndpointID ]]." verification: | - Please send the below mentioned command to configure TH2 without access to a specific endpoint, we send the ACL command, allowing access only to the endpoint 1 ; any attempts to subscribe to or use commands from other clusters will result in a status of 'INVALID_ACTION + To ensure that CR1 and CR2 are on the same fabric and that CR1 grants access to CR2, Please send the below mentioned command, it will configure CR2 without access to a specific endpoint, we send the ACL command, allowing access only to the endpoint 1 ; any attempts to subscribe to or use commands from other clusters will result in a status of 'INVALID_ACTION accesscontrol write acl '[{"privilege":5, "authMode":2, "subjects":[112233], "targets":null, "fabricIndex": 1},{"privilege":3, "authMode":2, "subjects":[4], "targets":[{"cluster":null, "endpoint":1, "deviceType":null}]}]' 1 0 @@ -423,7 +421,7 @@ tests: [1687418943.853418][167960:167962] CHIP:DMG: } [1687418943.853488][167960:167962] CHIP:DMG: WriteClient moving to [AwaitingDe] - If TH2 attempts to subscribe to an attribute on a cluster (ClusterID) for which it does not have access, the AttributePath used for the subscription would be in the form AttributePath = [[ Endpoint = EndpointID ]], but this action will be denied, and TH2 will not be able to access the attribute due to the restricted access. + If CR2 attempts to subscribe to an attribute on a cluster (ClusterID) for which it does not have access, the AttributePath used for the subscription would be in the form AttributePath = [[ Endpoint = EndpointID ]], but this action will be denied, and CR2 will not be able to access the attribute due to the restricted access. below provided the example command to subscribe to all attributes onto endpoint 0 for cluster 6 from a node id that have access to everything onto endpoint 1 @@ -445,7 +443,7 @@ tests: disabled: true - label: - "Step 6: Setup TH2 such that it does not have access to the Node. TH2 + "Step 6: Setup CR2 such that it does not have access to the Node. CR2 sends a subscription request to subscribe to all attributes on all clusters on all endpoints on a Node for which it does not have access. AttributePath = [[ ]]." @@ -455,26 +453,27 @@ tests: disabled: true - label: - "Step 7: TH sends a subscription request action for an attribute with + "Step 7: CR1 sends a subscription request action for an attribute with an empty DataVersionFilters field. DUT sends a report data action with the data of the attribute along with the data version. Tear down the subscription for that attribute. Start another subscription with the DataVersionFilter field set to the data version received above." verification: | Chip-Tool support required to validate this step : SDK Issue - https://github.com/project-chip/connectedhomeip/issues/28363 + Not Testable disabled: true - label: - "Step 8: TH sends a subscription request action for an attribute and + "Step 8: CR1 sends a subscription request action for an attribute and sets the MinIntervalFloor value to be same as MaxIntervalCeiling. - Activate the Subscription between TH and DUT. Modify the attribute + Activate the Subscription between CR1 and DUT. Modify the attribute which has been subscribed to on the DUT." verification: | - Please send the following command from TH (the subscription requester) to DUT (the device under test) to activate the subscription for the "on-time" attribute, setting the MinIntervalFloor and MaxIntervalCeiling values to be the same (in this case, 100 seconds): + Please send the following command from CR1 (the subscription requester) to DUT (the device under test) to activate the subscription for the "on-time" attribute, setting the MinIntervalFloor and MaxIntervalCeiling values to be the same (in this case, 100 seconds): onoff subscribe on-time 100 100 1 1 --keepSubscriptions true - On the TH(all-clusters-app) verify the SubscribeResponse is received successfully + On the CR1(chip-tool) verify the SubscribeResponse is received successfully [1690540281.061350][9488:9490] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0006 Attribute 0x0000_4001 DataVersion: 3310786904 [1690540281.061363][9488:9490] CHIP:TOO: OnTime: 0 [1690540281.061379][9488:9490] CHIP:DMG: MoveToState ReadClient[0x7faef8013880]: Moving to [AwaitingSu] @@ -497,7 +496,7 @@ tests: After activating the subscription between TH and DUT, please send the following command to modify the 'on-time' attribute value: >>> onoff write on-time 1 1 1 - On TH(chip-tool), verify that the DUT sends a report data containing the current 'ontime' attribute value after the MinIntervalFloor time has elapsed + On CR1(chip-tool), verify that the DUT sends a report data containing the current 'ontime' attribute value after the MinIntervalFloor time has elapsed [1690540304.761997][9488:9488] CHIP:TOO: Command: onoff write on-time 1 1 1 [1690540304.762298][9488:9490] CHIP:TOO: Sending command to node 0x1 @@ -594,15 +593,15 @@ tests: disabled: true - label: - "Step 9: TH sends a subscription request action for an attribute and - set the MinIntervalFloor value to be greater than MaxIntervalCeiling. - +" + "Step 9: CR1 sends a subscription request action for an attribute and + set the MinIntervalFloor value to be greater than MaxIntervalCeiling." verification: | - Please send the following command from TH (the subscription requester) to DUT (the device under test) to activate the subscription for the "on-time" attribute, setting the MinIntervalFloor value to be greater than MaxIntervalCeiling: + Please send the following command from CR1 (the subscription requester) to DUT (the device under test) to activate the subscription for the "on-time" attribute, setting the MinIntervalFloor value to be greater than MaxIntervalCeiling: + - onoff subscribe on-time 500 100 1 1 --keepSubscriptions true + onoff subscribe on-time 500 100 1 1 --keepSubscriptions true - On TH (chip-tool), verify that the DUT sends an error message, confirming that the subscription is not established successfully + On CR1 (chip-tool), verify that the DUT sends an error message, confirming that the subscription is not established successfully [1661754615.089845][103654:103659] CHIP:DMG: StatusResponseMessage = [1661754615.089857][103654:103659] CHIP:DMG: { @@ -614,7 +613,7 @@ tests: disabled: true - label: - "Step 10: TH sends a subscription request to subscribe to a specific + "Step 10: CR1 sends a subscription request to subscribe to a specific global attribute from all clusters on all endpoints. AttributePath = [[Attribute = Global Attribute]]. +" verification: | @@ -656,7 +655,7 @@ tests: disabled: true - label: - "Step 11: TH sends a subscription request to subscribe to a global + "Step 11: CR1 sends a subscription request to subscribe to a global attribute on an endpoint on all clusters. AttributePath = [[Attribute = Global Attribute, Endpoint = EndpointID ]]. +" verification: | @@ -745,14 +744,14 @@ tests: disabled: true - label: - "Step 12: TH sends a subscription request to the DUT with both + "Step 12: CR1 sends a subscription request to the DUT with both AttributeRequests and EventRequests as empty" verification: | Please send the following command from TH (the subscription requester) to DUT (the device under test) to activate the subscription with both AttributeRequests and EventRequests as empty any subscribe-none 10 100 1 --keepSubscriptions 1 - On TH (chip-tool), verify that the DUT sends an error message, confirming that the subscription is not established successfully + On CR1 (chip-tool), verify that the DUT sends an error message, confirming that the subscription is not established successfully [1690884829.708780][84191:84193] CHIP:EM: Rxd Ack; Removing MessageCounter:136461510 from Retrans Table on exchange 23099i [1690884829.708861][84191:84193] CHIP:DMG: StatusResponseMessage = [1690884829.708907][84191:84193] CHIP:DMG: { diff --git a/src/app/tests/suites/certification/Test_TC_IDM_4_3.yaml b/src/app/tests/suites/certification/Test_TC_IDM_4_3.yaml index b0e91d442a3898..c3fc4ae9cc563f 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_4_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_4_3.yaml @@ -233,7 +233,7 @@ tests: should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation." - PICS: MCORE.IDM.S.Attribute.DataType_Bool + PICS: MCORE.IDM.S.Attribute_W.DataType_Bool verification: | basicinformation subscribe local-config-disabled 100 200 1 0 --keepSubscriptions true @@ -316,7 +316,7 @@ tests: should send the report data with the modified attribute value Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation." - PICS: MCORE.IDM.S.Attribute.DataType_String + PICS: MCORE.IDM.S.Attribute_W.DataType_String verification: | basicinformation subscribe node-label 10 100 1 0 --keepSubscriptions true @@ -398,7 +398,7 @@ tests: the DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation." - PICS: MCORE.IDM.S.Attribute.DataType_UnsignedInteger + PICS: MCORE.IDM.S.Attribute_W.DataType_UnsignedInteger verification: | any subscribe-by-id 0x0008 0x0010 10 100 1 1 --keepSubscriptions true @@ -481,7 +481,7 @@ tests: DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times)before the MaxInterval time specified during the subscription activation." - PICS: MCORE.IDM.S.Attribute.DataType_SignedInteger + PICS: MCORE.IDM.S.Attribute_W.DataType_SignedInteger verification: | Subscribe to an attribute of type signed integer to the Harness @@ -495,7 +495,7 @@ tests: DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation." - PICS: MCORE.IDM.S.Attribute.DataType_FloatingPoint + PICS: MCORE.IDM.S.Attribute_W.DataType_FloatingPoint verification: | Subscribe to an attribute of type floating point to the Harness @@ -509,7 +509,7 @@ tests: should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation." - PICS: MCORE.IDM.S.Attribute.DataType_List + PICS: MCORE.IDM.S.Attribute_W.DataType_List verification: | userlabel subscribe label-list 100 500 1 0 --keepSubscriptions true diff --git a/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml b/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml index 4933e39e14f70b..a65bf0daf41c1f 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml @@ -342,178 +342,214 @@ tests: disabled: true - label: - "Step 2: RD1, RD2, RD3, RD4, RD5 send 3 Subscribe Request Messages to + "Step 2a: Factory Reset the DUT and recommission it onto all fabrics. + RD1, RD2, RD3, RD4, RD5 should be on separate, distinct fabrics. RD1 + and RD1A should be on the same fabric." + verification: | + To perform Factory reset on DUT follow the below commands in RPI, And use equivalent command on the respective DUT sudo rm -rf /tmp/chip_* + + After performing a factory reset on the DUT, please follow the preconditioning steps to provision both the DUT and the RDs + disabled: true + + - label: + "Step 2b: RD1, RD2, RD3, RD4, RD5 send 3 Subscribe Request Messages to DUT.(Total - 15 active subscriptions) Each subscribe requests should contain 3 different paths. The subscription request from RD1 should contain 4 paths. +" verification: | - After provisioning again the values are been set to default values such as node label= " ". so in VS mentioned as node-label="", location=XX and local-config-disabled=FALSE but if your going to verify 3 steps contentiously you will get the attribute value as node-label="newlabel", location=in and local-config-disabled=TRUE. + RD1, RD2, RD3, RD4, RD5 send 3 Subscribe Request Messages to DUT.(Total - 15 active subscriptions) Each subscribe requests should contain 3 different paths and The subscription request from RD1 should contain 4 paths. #1. on the first reference device(RD1) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 1 '0,0,0' --keepSubscriptions true - [1684321430.691985][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684321430.691998][136393:136395] CHIP:TOO: LocalConfigDisabled: TRUE - [1684321430.692025][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684321430.692034][136393:136395] CHIP:TOO: Location: in - [1684321430.692062][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684321430.692069][136393:136395] CHIP:TOO: NodeLabel: "newnode" - [1684321430.692091][136393:136395] CHIP:DMG: MoveToState ReadClient[0x7fb510017ca0]: Moving to [AwaitingSu] - [1684321430.692138][136393:136395] CHIP:EM: <<< [E:41660i S:42488 M:180349712 (Ack:108042002)] (S) Msg TX to 1:0000000000000001 [E777] --- Type 0001:01 (IM:StatusResponse) - [1684321430.692153][136393:136395] CHIP:IN: (S) Sending msg 180349712 on secure session with LSID: 42488 - [1684321430.692466][136393:136395] CHIP:EM: >>> [E:41660i S:42488 M:108042003 (Ack:180349712)] (S) Msg RX from 1:0000000000000001 [E777] --- Type 0001:04 (IM:SubscribeResponse) - [1684321430.692478][136393:136395] CHIP:EM: Found matching exchange: 41660i, Delegate: 0x7fb510017cb0 - [1684321430.692492][136393:136395] CHIP:EM: Rxd Ack; Removing MessageCounter:180349712 from Retrans Table on exchange 41660i - [1684321430.692504][136393:136395] CHIP:DMG: SubscribeResponse is received - [1684321430.692519][136393:136395] CHIP:DMG: SubscribeResponseMessage = - [1684321430.692526][136393:136395] CHIP:DMG: { - [1684321430.692534][136393:136395] CHIP:DMG: SubscriptionId = 0x46bedde0, - [1684321430.692542][136393:136395] CHIP:DMG: MaxInterval = 0x3e8, - [1684321430.692547][136393:136395] CHIP:DMG: InteractionModelRevision = 1 - [1684321430.692552][136393:136395] CHIP:DMG: } - [1684321430.692564][136393:136395] CHIP:DMG: Subscription established with SubscriptionID = 0x46bedde0 MinInterval = 100s MaxInterval = 1000s Peer = 01:0000000000000001 - [1684321430.692575][136393:136395] CHIP:DMG: MoveToState ReadClient[0x7fb510017ca0]: Moving to [Subscripti] + [1692947895.936603][3660:3662] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3887771962 + [1692947895.936715][3660:3662] CHIP:TOO: LocalConfigDisabled: FALSE + [1692947895.938821][3660:3662] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3887771962 + [1692947895.938880][3660:3662] CHIP:TOO: Location: XX + [1692947895.938958][3660:3662] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3887771962 + [1692947895.938992][3660:3662] CHIP:TOO: NodeLabel: + [1692947895.939046][3660:3662] CHIP:DMG: MoveToState ReadClient[0xaaab1353f000]: Moving to [AwaitingSu] + [1692947895.939291][3660:3662] CHIP:EM: <<< [E:14761i S:58740 M:219359653 (Ack:56803011)] (S) Msg TX to 1:0000000000000001 [3E67] --- Type 0001:01 (IM:StatusResponse) + [1692947895.939345][3660:3662] CHIP:IN: (S) Sending msg 219359653 on secure session with LSID: 58740 + [1692947895.939585][3660:3662] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947895.939626][3660:3662] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947895.940625][3660:3662] CHIP:EM: >>> [E:14761i S:58740 M:56803012 (Ack:219359653)] (S) Msg RX from 1:0000000000000001 [3E67] --- Type 0001:04 (IM:SubscribeResponse) + [1692947895.940670][3660:3662] CHIP:EM: Found matching exchange: 14761i, Delegate: 0xaaab1353f010 + [1692947895.940726][3660:3662] CHIP:EM: Rxd Ack; Removing MessageCounter:219359653 from Retrans Table on exchange 14761i + [1692947895.940775][3660:3662] CHIP:DMG: SubscribeResponse is received + [1692947895.940828][3660:3662] CHIP:DMG: SubscribeResponseMessage = + [1692947895.940867][3660:3662] CHIP:DMG: { + [1692947895.940899][3660:3662] CHIP:DMG: SubscriptionId = 0x334c58be, + [1692947895.940933][3660:3662] CHIP:DMG: MaxInterval =0x64, + [1692947895.940982][3660:3662] CHIP:DMG: InteractionModelRevision = 10 + [1692947895.941010][3660:3662] CHIP:DMG: } + [1692947895.941055][3660:3662] CHIP:DMG: Subscription established with SubscriptionID = 0x334c58be MinInterval = 100s MaxInterval = 100s Peer = 01:0000000000000001 + [1692947895.941089][3660:3662] CHIP:DMG: MoveToState ReadClient[0xaaab1353f000]: Moving to [Subscripti] #2. on the 2nd reference device(RD2) send a Subscribe Request Messages to DUT.(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 2 '0,0,0' --commissioner-name beta --keepSubscriptions true - [1684321446.066373][136396:136398] CHIP:DMG: } - [1684321446.066395][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684321446.066400][136396:136398] CHIP:TOO: LocalConfigDisabled: TRUE - [1684321446.066409][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684321446.066412][136396:136398] CHIP:TOO: Location: in - [1684321446.066420][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684321446.066423][136396:136398] CHIP:TOO: NodeLabel: "newnode" - [1684321446.066429][136396:136398] CHIP:DMG: MoveToState ReadClient[0x7f6a0000aa80]: Moving to [AwaitingSu] - [1684321446.066443][136396:136398] CHIP:EM: <<< [E:35583i S:50848 M:252532045 (Ack:201846716)] (S) Msg TX to 2:0000000000000002 [8559] --- Type 0001:01 (IM:StatusResponse) - [1684321446.066447][136396:136398] CHIP:IN: (S) Sending msg 252532045 on secure session with LSID: 50848 - [1684321446.066549][136396:136398] CHIP:EM: >>> [E:35583i S:50848 M:201846717 (Ack:252532045)] (S) Msg RX from 2:0000000000000002 [8559] --- Type 0001:04 (IM:SubscribeResponse) - [1684321446.066553][136396:136398] CHIP:EM: Found matching exchange: 35583i, Delegate: 0x7f6a0000aa90 - [1684321446.066556][136396:136398] CHIP:EM: Rxd Ack; Removing MessageCounter:252532045 from Retrans Table on exchange 35583i - [1684321446.066559][136396:136398] CHIP:DMG: SubscribeResponse is received - [1684321446.066563][136396:136398] CHIP:DMG: SubscribeResponseMessage = - [1684321446.066565][136396:136398] CHIP:DMG: { - [1684321446.066567][136396:136398] CHIP:DMG: SubscriptionId = 0x9d9e9791, - [1684321446.066569][136396:136398] CHIP:DMG: MaxInterval = 0x3e8, - [1684321446.066571][136396:136398] CHIP:DMG: InteractionModelRevision = 1 - [1684321446.066573][136396:136398] CHIP:DMG: } - [1684321446.066576][136396:136398] CHIP:DMG: Subscription established with SubscriptionID = 0x9d9e9791 MinInterval = 100s MaxInterval = 1000s Peer = 02:0000000000000002 - [1684321446.066579][136396:136398] CHIP:DMG: MoveToState ReadClient[0x7f6a0000aa80]: Moving to [Subscripti] + [1692947905.050195][3664:3666] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3887771962 + [1692947905.050260][3664:3666] CHIP:TOO: LocalConfigDisabled: FALSE + [1692947905.050348][3664:3666] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3887771962 + [1692947905.050394][3664:3666] CHIP:TOO: Location: XX + [1692947905.050477][3664:3666] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3887771962 + [1692947905.050507][3664:3666] CHIP:TOO: NodeLabel: + [1692947905.050567][3664:3666] CHIP:DMG: MoveToState ReadClient[0xffff9c01c7e0]: Moving to [AwaitingSu] + [1692947905.050737][3664:3666] CHIP:EM: <<< [E:21944i S:55100 M:11845939 (Ack:24916694)] (S) Msg TX to 2:0000000000000002 [74F2] --- Type 0001:01 (IM:StatusResponse) + [1692947905.050784][3664:3666] CHIP:IN: (S) Sending msg 11845939 on secure session with LSID: 55100 + [1692947905.051031][3664:3666] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947905.051069][3664:3666] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947905.051915][3664:3666] CHIP:EM: >>> [E:21944i S:55100 M:24916695 (Ack:11845939)] (S) Msg RX from 2:0000000000000002 [74F2] --- Type 0001:04 (IM:SubscribeResponse) + [1692947905.051958][3664:3666] CHIP:EM: Found matching exchange: 21944i, Delegate: 0xffff9c01c7f0 + [1692947905.052004][3664:3666] CHIP:EM: Rxd Ack; Removing MessageCounter:11845939 from Retrans Table on exchange 21944i + [1692947905.052052][3664:3666] CHIP:DMG: SubscribeResponse is received + [1692947905.052097][3664:3666] CHIP:DMG: SubscribeResponseMessage = + [1692947905.052124][3664:3666] CHIP:DMG: { + [1692947905.052149][3664:3666] CHIP:DMG: SubscriptionId = 0xf382c6ba, + [1692947905.052184][3664:3666] CHIP:DMG: MaxInterval = 0x64, + [1692947905.052217][3664:3666] CHIP:DMG: InteractionModelRevision = 10 + [1692947905.052247][3664:3666] CHIP:DMG: } + [1692947905.052279][3664:3666] CHIP:DMG: Subscription established with SubscriptionID = 0xf382c6ba MinInterval = 100s MaxInterval = 100s Peer = 02:0000000000000002 + [1692947905.052311][3664:3666] CHIP:DMG: MoveToState ReadClient[0xffff9c01c7e0]: Moving to [Subscripti] + #3. on the 3rd reference device(RD3) send a Subscribe Request Messages to DUT..(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 3 '0,0,0' --commissioner-name gamma --keepSubscriptions true - 1684321460.706260][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684321460.706265][136409:136411] CHIP:TOO: LocalConfigDisabled: TRUE - [1684321460.706275][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684321460.706279][136409:136411] CHIP:TOO: Location: in - [1684321460.706289][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684321460.706292][136409:136411] CHIP:TOO: NodeLabel: "newnode" - [1684321460.706300][136409:136411] CHIP:DMG: MoveToState ReadClient[0x7f53dc00f140]: Moving to [AwaitingSu] - [1684321460.706312][136409:136411] CHIP:EM: <<< [E:42345i S:52489 M:199100311 (Ack:174085425)] (S) Msg TX to 3:0000000000000003 [5371] --- Type 0001:01 (IM:StatusResponse) - [1684321460.706317][136409:136411] CHIP:IN: (S) Sending msg 199100311 on secure session with LSID: 52489 - [1684321460.706424][136409:136411] CHIP:EM: >>> [E:42345i S:52489 M:174085426 (Ack:199100311)] (S) Msg RX from 3:0000000000000003 [5371] --- Type 0001:04 (IM:SubscribeResponse) - [1684321460.706428][136409:136411] CHIP:EM: Found matching exchange: 42345i, Delegate: 0x7f53dc00f150 - [1684321460.706432][136409:136411] CHIP:EM: Rxd Ack; Removing MessageCounter:199100311 from Retrans Table on exchange 42345i - [1684321460.706436][136409:136411] CHIP:DMG: SubscribeResponse is received - [1684321460.706441][136409:136411] CHIP:DMG: SubscribeResponseMessage = - [1684321460.706443][136409:136411] CHIP:DMG: { - [1684321460.706446][136409:136411] CHIP:DMG: SubscriptionId = 0x1387ade2, - [1684321460.706449][136409:136411] CHIP:DMG: MaxInterval = 0x3e8, - [1684321460.706452][136409:136411] CHIP:DMG: InteractionModelRevision = 1 - [1684321460.706455][136409:136411] CHIP:DMG: } - [1684321460.706458][136409:136411] CHIP:DMG: Subscription established with SubscriptionID = 0x1387ade2 MinInterval = 100s MaxInterval = 1000s Peer = 03:0000000000000003 - [1684321460.706462][136409:136411] CHIP:DMG: MoveToState ReadClient[0x7f53dc00f140]: Moving to [Subscripti] + [1692947914.490222][3667:3669] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3887771962 + [1692947914.490275][3667:3669] CHIP:TOO: LocalConfigDisabled: FALSE + [1692947914.490344][3667:3669] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3887771962 + [1692947914.490373][3667:3669] CHIP:TOO: Location: XX + [1692947914.490430][3667:3669] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3887771962 + [1692947914.490454][3667:3669] CHIP:TOO: NodeLabel: + [1692947914.490495][3667:3669] CHIP:DMG: MoveToState ReadClient[0xaaaafcb72000]: Moving to [AwaitingSu] + [1692947914.490639][3667:3669] CHIP:EM: <<< [E:55121i S:1001 M:174934504 (Ack:146433685)] (S) Msg TX to 3:0000000000000003 [CACB] --- Type 0001:01 (IM:StatusResponse) + [1692947914.490680][3667:3669] CHIP:IN: (S) Sending msg 174934504 on secure session with LSID: 1001 + [1692947914.490921][3667:3669] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947914.490955][3667:3669] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947914.491675][3667:3669] CHIP:EM: >>> [E:55121i S:1001 M:146433686 (Ack:174934504)] (S) Msg RX from 3:0000000000000003 [CACB] --- Type 0001:04 (IM:SubscribeResponse) + [1692947914.491712][3667:3669] CHIP:EM: Found matching exchange: 55121i, Delegate: 0xaaaafcb72010 + [1692947914.491761][3667:3669] CHIP:EM: Rxd Ack; Removing MessageCounter:174934504 from Retrans Table on exchange 55121i + [1692947914.491796][3667:3669] CHIP:DMG: SubscribeResponse is received + [1692947914.491838][3667:3669] CHIP:DMG: SubscribeResponseMessage = + [1692947914.491862][3667:3669] CHIP:DMG: { + [1692947914.491884][3667:3669] CHIP:DMG: SubscriptionId = 0xc14ac289, + [1692947914.491909][3667:3669] CHIP:DMG: MaxInterval = 0x64, + [1692947914.491931][3667:3669] CHIP:DMG: InteractionModelRevision = 10 + [1692947914.491953][3667:3669] CHIP:DMG: } + [1692947914.491978][3667:3669] CHIP:DMG: Subscription established with SubscriptionID = 0xc14ac289 MinInterval = 100s MaxInterval = 100s Peer = 03:0000000000000003 + [1692947914.492003][3667:3669] CHIP:DMG: MoveToState ReadClient[0xaaaafcb72000]: Moving to [Subscripti] + #4. on the 4th reference device(RD4) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 4 '0,0,0' --commissioner-name 4 --keepSubscriptions true - [1684321487.408563][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684321487.408572][136403:136405] CHIP:TOO: LocalConfigDisabled: TRUE - [1684321487.408590][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684321487.408595][136403:136405] CHIP:TOO: Location: in - [1684321487.408612][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684321487.408616][136403:136405] CHIP:TOO: NodeLabel: "newnode" - [1684321487.408631][136403:136405] CHIP:DMG: MoveToState ReadClient[0x7ff4cc015b50]: Moving to [AwaitingSu] - [1684321487.408657][136403:136405] CHIP:EM: <<< [E:28543i S:21311 M:202084353 (Ack:249111937)] (S) Msg TX to 4:0000000000000004 [8451] --- Type 0001:01 (IM:StatusResponse) - [1684321487.408665][136403:136405] CHIP:IN: (S) Sending msg 202084353 on secure session with LSID: 21311 - [1684321487.408861][136403:136405] CHIP:EM: >>> [E:28543i S:21311 M:249111938 (Ack:202084353)] (S) Msg RX from 4:0000000000000004 [8451] --- Type 0001:04 (IM:SubscribeResponse) - [1684321487.408868][136403:136405] CHIP:EM: Found matching exchange: 28543i, Delegate: 0x7ff4cc015b60 - [1684321487.408875][136403:136405] CHIP:EM: Rxd Ack; Removing MessageCounter:202084353 from Retrans Table on exchange 28543i - [1684321487.408881][136403:136405] CHIP:DMG: SubscribeResponse is received - [1684321487.408888][136403:136405] CHIP:DMG: SubscribeResponseMessage = - [1684321487.408891][136403:136405] CHIP:DMG: { - [1684321487.408895][136403:136405] CHIP:DMG: SubscriptionId = 0x54356760, - [1684321487.408899][136403:136405] CHIP:DMG: MaxInterval = 0x3e8, - [1684321487.408902][136403:136405] CHIP:DMG: InteractionModelRevision = 1 - [1684321487.408906][136403:136405] CHIP:DMG: } - [1684321487.408910][136403:136405] CHIP:DMG: Subscription established with SubscriptionID = 0x54356760 MinInterval = 100s MaxInterval = 1000s Peer = 04:0000000000000004 - [1684321487.408916][136403:136405] CHIP:DMG: MoveToState ReadClient[0x7ff4cc015b50]: Moving to [Subscripti] + [1692947922.587132][3670:3672] CHIP:DMG: } + [1692947922.587347][3670:3672] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3887771962 + [1692947922.587408][3670:3672] CHIP:TOO: LocalConfigDisabled: FALSE + [1692947922.587488][3670:3672] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3887771962 + [1692947922.587561][3670:3672] CHIP:TOO: Location: XX + [1692947922.587643][3670:3672] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3887771962 + [1692947922.587682][3670:3672] CHIP:TOO: NodeLabel: + [1692947922.587738][3670:3672] CHIP:DMG: MoveToState ReadClient[0xaaaaf8a11000]: Moving to [AwaitingSu] + [1692947922.587934][3670:3672] CHIP:EM: <<< [E:4602i S:44011 M:43975317 (Ack:79148204)] (S) Msg TX to 4:0000000000000004 [FF58] --- Type 0001:01 (IM:StatusResponse) + [1692947922.587980][3670:3672] CHIP:IN: (S) Sending msg 43975317 on secure session with LSID: 44011 + [1692947922.588211][3670:3672] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947922.588245][3670:3672] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947922.589071][3670:3672] CHIP:EM: >>> [E:4602i S:44011 M:79148205 (Ack:43975317)] (S) Msg RX from 4:0000000000000004 [FF58] --- Type 0001:04 (IM:SubscribeResponse) + [1692947922.589107][3670:3672] CHIP:EM: Found matching exchange: 4602i, Delegate: 0xaaaaf8a11010 + [1692947922.589155][3670:3672] CHIP:EM: Rxd Ack; Removing MessageCounter:43975317 from Retrans Table on exchange 4602i + [1692947922.589199][3670:3672] CHIP:DMG: SubscribeResponse is received + [1692947922.589246][3670:3672] CHIP:DMG: SubscribeResponseMessage = + [1692947922.589277][3670:3672] CHIP:DMG: { + [1692947922.589304][3670:3672] CHIP:DMG: SubscriptionId = 0xc9e797c6, + [1692947922.589334][3670:3672] CHIP:DMG: MaxInterval = 0x64, + [1692947922.589361][3670:3672] CHIP:DMG: InteractionModelRevision = 10 + [1692947922.589385][3670:3672] CHIP:DMG: } + [1692947922.589413][3670:3672] CHIP:DMG: Subscription established with SubscriptionID = 0xc9e797c6 MinInterval = 100s MaxInterval = 100s Peer = 04:0000000000000004 + [1692947922.589442][3670:3672] CHIP:DMG: MoveToState ReadClient[0xaaaaf8a11000]: Moving to [Subscripti] + #5. on the 5th reference device(RD5) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 5 '0,0,0' --commissioner-name 5 --keepSubscriptions true - [1684321505.359231][136414:136416] CHIP:DMG: } - [1684321505.359291][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684321505.359298][136414:136416] CHIP:TOO: LocalConfigDisabled: TRUE - [1684321505.359312][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684321505.359316][136414:136416] CHIP:TOO: Location: in - [1684321505.359331][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684321505.359334][136414:136416] CHIP:TOO: NodeLabel: "newnode" - [1684321505.359345][136414:136416] CHIP:DMG: MoveToState ReadClient[0x7f58a4009230]: Moving to [AwaitingSu] - [1684321505.359365][136414:136416] CHIP:EM: <<< [E:5170i S:40695 M:166661002 (Ack:81061549)] (S) Msg TX to 5:0000000000000005 [D311] --- Type 0001:01 (IM:StatusResponse) - [1684321505.359370][136414:136416] CHIP:IN: (S) Sending msg 166661002 on secure session with LSID: 40695 - [1684321505.359510][136414:136416] CHIP:EM: >>> [E:5170i S:40695 M:81061550 (Ack:166661002)] (S) Msg RX from 5:0000000000000005 [D311] --- Type 0001:04 (IM:SubscribeResponse) - [1684321505.359515][136414:136416] CHIP:EM: Found matching exchange: 5170i, Delegate: 0x7f58a4009240 - [1684321505.359519][136414:136416] CHIP:EM: Rxd Ack; Removing MessageCounter:166661002 from Retrans Table on exchange 5170i - [1684321505.359524][136414:136416] CHIP:DMG: SubscribeResponse is received - [1684321505.359530][136414:136416] CHIP:DMG: SubscribeResponseMessage = - [1684321505.359533][136414:136416] CHIP:DMG: { - [1684321505.359536][136414:136416] CHIP:DMG: SubscriptionId = 0xd52f8dad, - [1684321505.359539][136414:136416] CHIP:DMG: MaxInterval = 0x3e8, - [1684321505.359542][136414:136416] CHIP:DMG: InteractionModelRevision = 1 - [1684321505.359545][136414:136416] CHIP:DMG: } - [1684321505.359548][136414:136416] CHIP:DMG: Subscription established with SubscriptionID = 0xd52f8dad MinInterval = 100s MaxInterval = 1000s Peer = 05:0000000000000005 - [1684321505.359553][136414:136416] CHIP:DMG: MoveToState ReadClient[0x7f58a4009230]: Moving to [Subscripti] + [1692947931.880011][3673:3675] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3887771962 + [1692947931.880075][3673:3675] CHIP:TOO: LocalConfigDisabled: FALSE + [1692947931.880186][3673:3675] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3887771962 + [1692947931.880217][3673:3675] CHIP:TOO: Location: XX + [1692947931.880277][3673:3675] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3887771962 + [1692947931.880303][3673:3675] CHIP:TOO: NodeLabel: + [1692947931.880345][3673:3675] CHIP:DMG: MoveToState ReadClient[0xaaaac479e000]: Moving to [AwaitingSu] + [1692947931.880521][3673:3675] CHIP:EM: <<< [E:53665i S:45655 M:227315674 (Ack:12948537)] (S) Msg TX to 5:0000000000000005 [B2A3] --- Type 0001:01 (IM:StatusResponse) + [1692947931.880570][3673:3675] CHIP:IN: (S) Sending msg 227315674 on secure session with LSID: 45655 + [1692947931.880835][3673:3675] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947931.880872][3673:3675] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947931.881852][3673:3675] CHIP:EM: >>> [E:53665i S:45655 M:12948538 (Ack:227315674)] (S) Msg RX from 5:0000000000000005 [B2A3] --- Type 0001:04 (IM:SubscribeResponse) + [1692947931.881889][3673:3675] CHIP:EM: Found matching exchange: 53665i, Delegate: 0xaaaac479e010 + [1692947931.881965][3673:3675] CHIP:EM: Rxd Ack; Removing MessageCounter:227315674 from Retrans Table on exchange 53665i + [1692947931.882003][3673:3675] CHIP:DMG: SubscribeResponse is received + [1692947931.882045][3673:3675] CHIP:DMG: SubscribeResponseMessage = + [1692947931.882070][3673:3675] CHIP:DMG: { + [1692947931.882092][3673:3675] CHIP:DMG: SubscriptionId = 0x7963fdff, + [1692947931.882118][3673:3675] CHIP:DMG: MaxInterval = 0x64, + [1692947931.882141][3673:3675] CHIP:DMG: InteractionModelRevision = 10 + [1692947931.882239][3673:3675] CHIP:DMG: } + [1692947931.882284][3673:3675] CHIP:DMG: Subscription established with SubscriptionID = 0x7963fdff MinInterval = 100s MaxInterval = 100s Peer = 05:0000000000000005 + [1692947931.882310][3673:3675] CHIP:DMG: MoveToState ReadClient[0xaaaac479e000]: Moving to [Subscripti] Once all 15 subscriptions are active send one more subscriptiopn command in RD1 and Verify that the subscriptions from RD2, RD3, RD4 and RD5 are not affected. On the 1st reference device(RD1) send a Subscribe Request Messages to DUT. basicinformation subscribe product-id 100 1000 1 0 --keepSubscriptions true - [1684321545.164738][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0004 DataVersion: 3947588725 - [1684321545.164763][136393:136395] CHIP:TOO: ProductID: 32769 - [1684321545.164787][136393:136395] CHIP:DMG: MoveToState ReadClient[0x7fb51001bcc0]: Moving to [AwaitingSu] - [1684321545.164851][136393:136395] CHIP:EM: <<< [E:41661i S:42488 M:180349715 (Ack:108042004)] (S) Msg TX to 1:0000000000000001 [E777] --- Type 0001:01 (IM:StatusResponse) - [1684321545.164868][136393:136395] CHIP:IN: (S) Sending msg 180349715 on secure session with LSID: 42488 - [1684321545.165191][136393:136395] CHIP:EM: >>> [E:41661i S:42488 M:108042005 (Ack:180349715)] (S) Msg RX from 1:0000000000000001 [E777] --- Type 0001:04 (IM:SubscribeResponse) - [1684321545.165201][136393:136395] CHIP:EM: Found matching exchange: 41661i, Delegate: 0x7fb51001bcd0 - [1684321545.165210][136393:136395] CHIP:EM: Rxd Ack; Removing MessageCounter:180349715 from Retrans Table on exchange 41661i - [1684321545.165218][136393:136395] CHIP:DMG: SubscribeResponse is received - [1684321545.165229][136393:136395] CHIP:DMG: SubscribeResponseMessage = - [1684321545.165234][136393:136395] CHIP:DMG: { - [1684321545.165238][136393:136395] CHIP:DMG: SubscriptionId = 0xe9abeae7, - [1684321545.165253][136393:136395] CHIP:DMG: MaxInterval = 0x3e8, - [1684321545.165263][136393:136395] CHIP:DMG: InteractionModelRevision = 1 - [1684321545.165271][136393:136395] CHIP:DMG: } - [1684321545.165282][136393:136395] CHIP:DMG: Subscription established with SubscriptionID = 0xe9abeae7 MinInterval = 100s MaxInterval = 1000s Peer = 01:0000000000000001 - [1684321545.165295][136393:136395] CHIP:DMG: MoveToState ReadClient[0x7fb51001bcc0]: Moving to [Subscripti] + [1692947944.399278][3660:3662] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0004 DataVersion: 3887771962 + [1692947944.399322][3660:3662] CHIP:TOO: ProductID: 32769 + [1692947944.399364][3660:3662] CHIP:DMG: MoveToState ReadClient[0xffffb0011910]: Moving to [AwaitingSu] + [1692947944.399540][3660:3662] CHIP:EM: <<< [E:14762i S:58740 M:219359656 (Ack:56803013)] (S) Msg TX to 1:0000000000000001 [3E67] --- Type 0001:01 (IM:StatusResponse) + [1692947944.399597][3660:3662] CHIP:IN: (S) Sending msg 219359656 on secure session with LSID: 58740 + [1692947944.399821][3660:3662] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947944.399858][3660:3662] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692947944.400702][3660:3662] CHIP:EM: >>> [E:14762i S:58740 M:56803014 (Ack:219359656)] (S) Msg RX from 1:0000000000000001 [3E67] --- Type 0001:04 (IM:SubscribeResponse) + [1692947944.400745][3660:3662] CHIP:EM: Found matching exchange: 14762i, Delegate: 0xffffb0011920 + [1692947944.400797][3660:3662] CHIP:EM: Rxd Ack; Removing MessageCounter:219359656 from Retrans Table on exchange 14762i + [1692947944.400844][3660:3662] CHIP:DMG: SubscribeResponse is received + [1692947944.400895][3660:3662] CHIP:DMG: SubscribeResponseMessage = + [1692947944.400927][3660:3662] CHIP:DMG: { + [1692947944.400958][3660:3662] CHIP:DMG: SubscriptionId = 0xf148f53c, + [1692947944.400991][3660:3662] CHIP:DMG: MaxInterval = 0x64, + [1692947944.401022][3660:3662] CHIP:DMG: InteractionModelRevision = 10 + [1692947944.401050][3660:3662] CHIP:DMG: } + [1692947944.401081][3660:3662] CHIP:DMG: Subscription established with SubscriptionID = 0xf148f53c MinInterval = 100s MaxInterval = 100s Peer = 01:0000000000000001 + [1692947944.401112][3660:3662] CHIP:DMG: MoveToState ReadClient[0xffffb0011910]: Moving to [Subscripti] + disabled: true + + - label: + "Step 3a: Factory Reset the DUT and recommission it onto all fabrics. + RD1, RD2, RD3, RD4, RD5 should be on separate, distinct fabrics. RD1 + and RD1A should be on the same fabric." + verification: | + To perform Factory reset on DUT follow the below commands in RPI, And use equivalent command on the respective DUT sudo rm -rf /tmp/chip_* + + After performing a factory reset on the DUT, please follow the preconditioning steps to provision both the DUT and the RDs disabled: true - label: - "Step 3: RD2, RD3, RD4, RD5 send 3 Subscribe request messages each + "Step 3b: RD2, RD3, RD4, RD5 send 3 Subscribe request messages each with each of them having 3 different paths. Verify that the subscription request messages from all reference devices succeed. Once all the Subscription Requests are activated, RD1 sends 6 subscription request messages with each of them having 3 different paths." verification: | + RD2, RD3, RD4, RD5 send 3 Subscribe request messages each with each of them having 3 different paths. Verify that the subscription request messages from all reference devices succeed. Once all the Subscription Requests are activated, RD1 sends 6 subscription request messages with each of them having 3 different paths. + #1. on the 2nd reference device(RD2) send a Subscribe Request Messages to DUT.(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 2 '0,0,0' --commissioner-name beta --keepSubscriptions true [1684322787.342206][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322787.342219][136396:136398] CHIP:TOO: LocalConfigDisabled: TRUE + [1684322787.342219][136396:136398] CHIP:TOO: LocalConfigDisabled: FALSE [1684322787.342246][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322787.342255][136396:136398] CHIP:TOO: Location: in + [1684322787.342255][136396:136398] CHIP:TOO: Location: XX [1684322787.342282][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322787.342289][136396:136398] CHIP:TOO: NodeLabel: "newnode" + [1684322787.342289][136396:136398] CHIP:TOO: NodeLabel: [1684322787.342308][136396:136398] CHIP:DMG: MoveToState ReadClient[0x7f6a0001a460]: Moving to [AwaitingSu] [1684322787.342351][136396:136398] CHIP:EM: <<< [E:35584i S:50848 M:252532050 (Ack:201846722)] (S) Msg TX to 2:0000000000000002 [8559] --- Type 0001:01 (IM:StatusResponse) [1684322787.342363][136396:136398] CHIP:IN: (S) Sending msg 252532050 on secure session with LSID: 50848 @@ -536,11 +572,11 @@ tests: #2. on the 3rd reference device(RD3) send a Subscribe Request Messages to DUT..(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 3 '0,0,0' --commissioner-name gamma --keepSubscriptions true [1684322803.467486][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322803.467490][136409:136411] CHIP:TOO: LocalConfigDisabled: TRUE + [1684322803.467490][136409:136411] CHIP:TOO: LocalConfigDisabled: FALSE [1684322803.467499][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322803.467502][136409:136411] CHIP:TOO: Location: in + [1684322803.467502][136409:136411] CHIP:TOO: Location: XX [1684322803.467511][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322803.467513][136409:136411] CHIP:TOO: NodeLabel: "newnode" + [1684322803.467513][136409:136411] CHIP:TOO: NodeLabel: [1684322803.467520][136409:136411] CHIP:DMG: MoveToState ReadClient[0x7f53dc01bb90]: Moving to [AwaitingSu] [1684322803.467531][136409:136411] CHIP:EM: <<< [E:42346i S:52489 M:199100316 (Ack:174085431)] (S) Msg TX to 3:0000000000000003 [5371] --- Type 0001:01 (IM:StatusResponse) [1684322803.467535][136409:136411] CHIP:IN: (S) Sending msg 199100316 on secure session with LSID: 52489 @@ -562,11 +598,11 @@ tests: #3. on the 4th reference device(RD4) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 4 '0,0,0' --commissioner-name 4 --keepSubscriptions true [1684322837.225922][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322837.225930][136403:136405] CHIP:TOO: LocalConfigDisabled: TRUE + [1684322837.225930][136403:136405] CHIP:TOO: LocalConfigDisabled: FALSE [1684322837.225940][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322837.225943][136403:136405] CHIP:TOO: Location: in + [1684322837.225943][136403:136405] CHIP:TOO: Location: XX [1684322837.225952][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322837.225955][136403:136405] CHIP:TOO: NodeLabel: "newnode" + [1684322837.225955][136403:136405] CHIP:TOO: NodeLabel: [1684322837.225961][136403:136405] CHIP:DMG: MoveToState ReadClient[0x7ff4cc019c70]: Moving to [AwaitingSu] [1684322837.225980][136403:136405] CHIP:EM: <<< [E:28544i S:21311 M:202084358 (Ack:249111943)] (S) Msg TX to 4:0000000000000004 [8451] --- Type 0001:01 (IM:StatusResponse) [1684322837.225984][136403:136405] CHIP:IN: (S) Sending msg 202084358 on secure session with LSID: 21311 @@ -588,11 +624,11 @@ tests: #4. on the 5th reference device(RD5) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 5 '0,0,0' --commissioner-name 5 --keepSubscriptions true [1684322852.957519][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322852.957525][136414:136416] CHIP:TOO: LocalConfigDisabled: TRUE + [1684322852.957525][136414:136416] CHIP:TOO: LocalConfigDisabled: FALSE [1684322852.957537][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322852.957541][136414:136416] CHIP:TOO: Location: in + [1684322852.957541][136414:136416] CHIP:TOO: Location: XX [1684322852.957552][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322852.957556][136414:136416] CHIP:TOO: NodeLabel: "newnode" + [1684322852.957556][136414:136416] CHIP:TOO: NodeLabel: [1684322852.957564][136414:136416] CHIP:DMG: MoveToState ReadClient[0x7f58a400e880]: Moving to [AwaitingSu] [1684322852.957585][136414:136416] CHIP:EM: <<< [E:5171i S:40695 M:166661007 (Ack:81061555)] (S) Msg TX to 5:0000000000000005 [D311] --- Type 0001:01 (IM:StatusResponse) [1684322852.957590][136414:136416] CHIP:IN: (S) Sending msg 166661007 on secure session with LSID: 40695 @@ -645,20 +681,34 @@ tests: disabled: true - label: - "Step 4: RD1, RD2, RD3, RD4, RD5 send 3 Subscribe request messages + "Step 4a: Factory Reset the DUT and recommission it onto all fabrics. + RD1, RD2, RD3, RD4, RD5 should be on separate, distinct fabrics. RD1 + and RD1A should be on the same fabric." + verification: | + To perform Factory reset on DUT follow the below commands in RPI, And use equivalent command on the respective DUT sudo rm -rf /tmp/chip_* + + After performing a factory reset on the DUT, please follow the preconditioning steps to provision both the DUT and the RDs + disabled: true + + - label: + "Step 4b: RD1, RD2, RD3, RD4, RD5 send 3 Subscribe request messages each with each of them having 3 different paths. Verify that the subscription request messages from RD1, RD2, RD3, RD4 and RD5 succeed. Once all the Subscription Requests are activated, send a Subscribe request messages having 3 different paths from RD1A to the DUT." verification: | + RD1, RD2, RD3, RD4, RD5 send 3 Subscribe request messages each with each of them having 3 different paths. + Verify that the subscription request messages from RD1, RD2, RD3, RD4 and RD5 succeed. + Once all the Subscription Requests are activated, send a Subscribe request messages having 3 different paths from RD1A to the DUT + #1. on the first reference device(RD1) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 1 '0,0,0' --keepSubscriptions true [1684323009.937251][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323009.937257][136393:136395] CHIP:TOO: LocalConfigDisabled: TRUE + [1684323009.937257][136393:136395] CHIP:TOO: LocalConfigDisabled: FALSE [1684323009.937274][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323009.937279][136393:136395] CHIP:TOO: Location: in + [1684323009.937279][136393:136395] CHIP:TOO: Location: XX [1684323009.937293][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323009.937298][136393:136395] CHIP:TOO: NodeLabel: "newnode" + [1684323009.937298][136393:136395] CHIP:TOO: NodeLabel: [1684323009.937308][136393:136395] CHIP:DMG: MoveToState ReadClient[0x7fb510002110]: Moving to [AwaitingSu] [1684323009.937334][136393:136395] CHIP:EM: <<< [E:41663i S:42488 M:180349725 (Ack:108042016)] (S) Msg TX to 1:0000000000000001 [E777] --- Type 0001:01 (IM:StatusResponse) [1684323009.937339][136393:136395] CHIP:IN: (S) Sending msg 180349725 on secure session with LSID: 42488 @@ -679,11 +729,11 @@ tests: #2. on the 2nd reference device(RD2) send a Subscribe Request Messages to DUT.(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 2 '0,0,0' --commissioner-name beta --keepSubscriptions true [1684323023.679481][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323023.679488][136396:136398] CHIP:TOO: LocalConfigDisabled: TRUE + [1684323023.679488][136396:136398] CHIP:TOO: LocalConfigDisabled: FALSE [1684323023.679503][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323023.679508][136396:136398] CHIP:TOO: Location: in + [1684323023.679508][136396:136398] CHIP:TOO: Location: xx [1684323023.679521][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323023.679525][136396:136398] CHIP:TOO: NodeLabel: "newnode" + [1684323023.679525][136396:136398] CHIP:TOO: NodeLabel: [1684323023.679535][136396:136398] CHIP:DMG: MoveToState ReadClient[0x7f6a0000a890]: Moving to [AwaitingSu] [1684323023.679556][136396:136398] CHIP:EM: <<< [E:35585i S:50848 M:252532054 (Ack:201846726)] (S) Msg TX to 2:0000000000000002 [8559] --- Type 0001:01 (IM:StatusResponse) [1684323023.679563][136396:136398] CHIP:IN: (S) Sending msg 252532054 on secure session with LSID: 50848 @@ -705,11 +755,11 @@ tests: #3. on the 3rd reference device(RD3) send a Subscribe Request Messages to DUT..(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 3 '0,0,0' --commissioner-name gamma --keepSubscriptions true [1684323039.115907][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323039.115916][136409:136411] CHIP:TOO: LocalConfigDisabled: TRUE + [1684323039.115916][136409:136411] CHIP:TOO: LocalConfigDisabled: FALSE [1684323039.115943][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323039.115949][136409:136411] CHIP:TOO: Location: in + [1684323039.115949][136409:136411] CHIP:TOO: Location: XX [1684323039.115977][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323039.115981][136409:136411] CHIP:TOO: NodeLabel: "newnode" + [1684323039.115981][136409:136411] CHIP:TOO: NodeLabel: [1684323039.116000][136409:136411] CHIP:DMG: MoveToState ReadClient[0x7f53dc016c20]: Moving to [AwaitingSu] [1684323039.116030][136409:136411] CHIP:EM: <<< [E:42347i S:52489 M:199100320 (Ack:174085435)] (S) Msg TX to 3:0000000000000003 [5371] --- Type 0001:01 (IM:StatusResponse) [1684323039.116039][136409:136411] CHIP:IN: (S) Sending msg 199100320 on secure session with LSID: 52489 @@ -731,11 +781,11 @@ tests: #4. on the 4th reference device(RD4) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 4 '0,0,0' --commissioner-name 4 --keepSubscriptions true [1684323055.304162][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323055.304177][136403:136405] CHIP:TOO: LocalConfigDisabled: TRUE + [1684323055.304177][136403:136405] CHIP:TOO: LocalConfigDisabled: FALSE [1684323055.304206][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323055.304216][136403:136405] CHIP:TOO: Location: in + [1684323055.304216][136403:136405] CHIP:TOO: Location: XX [1684323055.304243][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323055.304250][136403:136405] CHIP:TOO: NodeLabel: "newnode" + [1684323055.304250][136403:136405] CHIP:TOO: NodeLabel: [1684323055.304274][136403:136405] CHIP:DMG: MoveToState ReadClient[0x7ff4cc010a60]: Moving to [AwaitingSu] [1684323055.304312][136403:136405] CHIP:EM: <<< [E:28545i S:21311 M:202084362 (Ack:249111947)] (S) Msg TX to 4:0000000000000004 [8451] --- Type 0001:01 (IM:StatusResponse) [1684323055.304324][136403:136405] CHIP:IN: (S) Sending msg 202084362 on secure session with LSID: 21311 @@ -756,11 +806,11 @@ tests: any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 5 '0,0,0' --commissioner-name 5 --keepSubscriptions true [1684323072.765216][136414:136416] CHIP:DMG: } [1684323072.765277][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323072.765290][136414:136416] CHIP:TOO: LocalConfigDisabled: TRUE + [1684323072.765290][136414:136416] CHIP:TOO: LocalConfigDisabled: FALSE [1684323072.765318][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323072.765327][136414:136416] CHIP:TOO: Location: in + [1684323072.765327][136414:136416] CHIP:TOO: Location: XX [1684323072.765352][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323072.765359][136414:136416] CHIP:TOO: NodeLabel: "newnode" + [1684323072.765359][136414:136416] CHIP:TOO: NodeLabel: [1684323072.765379][136414:136416] CHIP:DMG: MoveToState ReadClient[0x7f58a4014ee0]: Moving to [AwaitingSu] [1684323072.765426][136414:136416] CHIP:EM: <<< [E:5172i S:40695 M:166661011 (Ack:81061559)] (S) Msg TX to 5:0000000000000005 [D311] --- Type 0001:01 (IM:StatusResponse) [1684323072.765439][136414:136416] CHIP:IN: (S) Sending msg 166661011 on secure session with LSID: 40695 diff --git a/src/app/tests/suites/certification/Test_TC_I_2_2.yaml b/src/app/tests/suites/certification/Test_TC_I_2_2.yaml index d562f0fc42e218..726ec342a44c1d 100644 --- a/src/app/tests/suites/certification/Test_TC_I_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_2_2.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 58.2.2. [TC-I-2.2] Primary functionality with server as DUT @@ -24,7 +23,7 @@ config: endpoint: 1 tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" + - label: "Step 1a: Wait for the commissioned device to be retrieved" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -32,6 +31,17 @@ tests: - name: "nodeId" value: nodeId + - label: "Step 1b: TH reads the IdentifyType attribute from the DUT." + PICS: I.S.A0001 + command: "readAttribute" + attribute: "IdentifyType" + response: + saveAs: IdentifyTypeValue + constraints: + type: enum8 + minValue: 0 + maxValue: 5 + - label: "Step 2a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x003c (60s)." @@ -42,6 +52,24 @@ tests: - name: "IdentifyTime" value: 60 + - label: + "Verify that the device enters its identification state using the + IdentifyType from Step 1b, in order to indicate to an observer which + of several nodes and/or endpoints it is." + verification: | + Verify that the device enters its identification state using the IdentifyType from step1b, + Here the Identifytype is 2(VisibleIndicator) which can be a small led that indicates the device is in identification state. + This IdentifyType can vary to device ref: 1.2.5.1 in spec for the IdentifyTypeEnum of the particular DUT + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && I.S.A0001 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + - label: "Step 2b: TH reads immediately IdentifyTime attribute from DUT" PICS: I.S.A0000 command: "readAttribute" @@ -70,21 +98,21 @@ tests: minValue: 42 maxValue: 58 - - label: - "Step 3: TH sends IdentifyQuery command to DUT and Verify - IdentifyQueryResponse command to TH,with the Timeout field set to a - value in the range 0x0000 to 0x0032" - verification: | - IdentifyQuery is not supported by Matter - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + # - label: + # "Step 3: TH sends IdentifyQuery command to DUT and Verify + # IdentifyQueryResponse command to TH,with the Timeout field set to a + # value in the range 0x0000 to 0x0032" + # verification: | + # IdentifyQuery is not supported by Matter + # cluster: "LogCommands" + # command: "UserPrompt" + # PICS: PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx + # arguments: + # values: + # - name: "message" + # value: "Please enter 'y' for success" + # - name: "expectedValue" + # value: "y" - label: "Step 4a: TH sends Identify command to DUT, with the IdentifyTime @@ -126,6 +154,24 @@ tests: arguments: value: 15 + - label: + "Verify that the device enters its identification state using the + IdentifyType from Step 1b, in order to indicate to an observer which + of several nodes and/or endpoints it is." + verification: | + Verify that the device enters its identification state using the IdentifyType from step1b, + Here the Identifytype is 2(VisibleIndicator) which can be a small led that indicates the device is in identification state. + This IdentifyType can vary to device ref: 1.2.5.1 in spec for the IdentifyTypeEnum of the particular DUT + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && I.S.A0001 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + - label: "Wait 5000ms" cluster: "DelayCommands" command: "WaitForMs" diff --git a/src/app/tests/suites/certification/Test_TC_LCFG_2_1.yaml b/src/app/tests/suites/certification/Test_TC_LCFG_2_1.yaml index 7cb4361a301362..fac7434a5dd0f0 100644 --- a/src/app/tests/suites/certification/Test_TC_LCFG_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LCFG_2_1.yaml @@ -11,10 +11,9 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 10.2.1. [TC-LCFG-2.1] Localization Configuration Cluster + 102.2.1. [TC-LCFG-2.1] Localization Configuration Cluster Attributes[DUT-Server] PICS: @@ -22,125 +21,120 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" + cluster: "Localization Configuration" endpoint: 0 + #default value is assigned by the Vendor + Default.Vendor.ActiveLocaleValue: + type: char_string + defaultValue: "en-US" + #string not present in SupportedLocales + Value.NotPresentInSupportedLocales: + type: char_string + defaultValue: "fw-GB" + #string present in SupportedLocales + Value.PresentInSupportedLocales: + type: char_string + defaultValue: "es-ES" tests: - - label: "Step 1: TH reads SupportedLocales attribute from DUT" + - label: "Step 0: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 1a: TH reads SupportedLocales attribute from DUT" PICS: LCFG.S.A0001 - verification: | - ./chip-tool localizationconfiguration read supported-locales 1 0 - - On TH(chip-tool) log, Verify the SupportedLocales attribute values are not repeated, - - Maximum number of elements in the SupportedLocales list is 32 and maximum length is 35 bytes, below is the sample log provided for the raspi platform: - - [1661759583.481746][104665:104670] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002B Attribute 0x0000_0001 DataVersion: 3207653748 - [1661759583.482016][104665:104670] CHIP:TOO: SupportedLocales: 8 entries - [1661759583.482037][104665:104670] CHIP:TOO: [1]: en-US - [1661759583.482045][104665:104670] CHIP:TOO: [2]: de-DE - [1661759583.482052][104665:104670] CHIP:TOO: [3]: fr-FR - [1661759583.482059][104665:104670] CHIP:TOO: [4]: en-GB - [1661759583.482069][104665:104670] CHIP:TOO: [5]: es-ES - [1661759583.482080][104665:104670] CHIP:TOO: [6]: zh-CN - [1661759583.482089][104665:104670] CHIP:TOO: [7]: it-IT - [1661759583.482097][104665:104670] CHIP:TOO: [8]: ja-JP - [1661759583.482158][104665:104670] CHIP:EM: Sending Standalone Ack for MessageCounter:46420218 on exchange 20687i - disabled: true - - - label: "Step 2: TH writes 'xx-XX' to SupportedLocales attribute" - verification: | - ./chip-tool any write-by-id 0x002B 1 '"xx-XX"' 1 0 - - Verify that DUT responds with UNSUPPORTED_WRITE on TH(chip-tool) log and below is the sample log provided for the raspi platform: + command: "readAttribute" + attribute: "SupportedLocales" + response: + saveAs: SupportedLocalesValues + constraints: + type: list + maxLength: 35 - [1653996674.832226][7281:7286] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1653996674.832300][7281:7286] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - [1653996674.832411][7281:7286] CHIP:EM: Sending Standalone Ack for MessageCounter:12567655 on exchange 10797i - disabled: true - - - label: "Step 3: TH reads SupportedLocales attribute" + - label: + "Step 1b: Verify that the values in the SupportedLocales attribute are + not repeated" verification: | - ./chip-tool localizationconfiguration read supported-locales 1 0 + Verify that the values in the SupportedLocales attribute are not repeated + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && LCFG.S.A0001 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - Verify that SupportedLocales atrribute entries are same as step 1 on TH(chip-tool) log and below is the sample log provided for the raspi platform: - - [1645772065.848431][3762:3767] CHIP:TOO: SupportedLocales: 8 entries - [1645772065.850249][3762:3767] CHIP:TOO: [1]: en-US - [1645772065.850298][3762:3767] CHIP:TOO: [2]: de-DE - [1645772065.850333][3762:3767] CHIP:TOO: [3]: fr-FR - [1645772065.850368][3762:3767] CHIP:TOO: [4]: en-GB - [1645772065.850402][3762:3767] CHIP:TOO: [5]: es-ES - [1645772065.850435][3762:3767] CHIP:TOO: [6]: zh-CN - [1645772065.850469][3762:3767] CHIP:TOO: [7]: it-IT - [1645772065.850502][3762:3767] CHIP:TOO: [8]: ja-JP - [1645772065.851668][3762:3767] CHIP:EM: Sending Standalone Ack for MessageCounter:4927804 on exchange 64827i - disabled: true + - label: "Step 2: TH writes 'xx-XX' to SupportedLocales attribute" + command: "writeAttribute" + attribute: "SupportedLocales" + arguments: + value: [xx-XX] + response: + error: UNSUPPORTED_WRITE + + - label: "Step 3: TH reads SupportedLocales attribute from DUT" + PICS: LCFG.S.A0001 + command: "readAttribute" + attribute: "SupportedLocales" + response: + value: SupportedLocalesValues - - label: "Step 4: TH reads ActiveLocale Attribute from the DUT" + - label: "Step 4a: TH reads ActiveLocale Attribute from the DUT" PICS: LCFG.S.A0000 - verification: | - ./chip-tool localizationconfiguration read active-locale 1 0 - - Verify that ActiveLocale Attribute value is a Language Tag as defined by BCP47, - - Maximum length is 35 bytes and it should be present in SupportedLocales attribute - - If the value of ActiveLocale is not one among supportedLocales value, then default value is assigned by the Vendor on TH(chip-tool)log and below is the sample log provided for the raspi platform: + command: "readAttribute" + attribute: "ActiveLocale" + response: + value: Default.Vendor.ActiveLocaleValue + constraints: + type: char_string + maxLength: 35 - [1661759849.744419][104758:104763] CHIP:DMG: } - [1661759849.744488][104758:104763] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002B Attribute 0x0000_0000 DataVersion: 3207653748 - [1661759849.744509][104758:104763] CHIP:TOO: ActiveLocale: en-US - [1661759849.744553][104758:104763] CHIP:EM: Sending Standalone Ack for MessageCounter:93577923 on exchange 47198i - disabled: true + - label: + "Step 4b: Verify that the ActiveLocale attribute is Language Tag as + defined by BCP47. Verify that the ActiveLocale Attribute value is + present in the SupportedLocales attribute list" + verification: | + 1. Verify that the ActiveLocale attribute is Language Tag as defined by BCP47 + 2. Verify that the ActiveLocale Attribute value is present in the SupportedLocales attribute list + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && LCFG.S.A0000 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 5: TH writes new string not present in SupportedLocales attribute to ActiveLocale Attribute." - verification: | - ./chip-tool localizationconfiguration write active-locale fw-GB 1 0 - - Verify that DUT responds as CONSTRAINT_ERROR On TH(chip-tool) log and below is the sample log provided for the raspi platform: - - [1651130076.882877][174458:174463] CHIP:DMG: - [1651130076.882881][174458:174463] CHIP:DMG: StatusIB = - [1651130076.882885][174458:174463] CHIP:DMG: { - [1651130076.882889][174458:174463] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1651130076.882893][174458:174463] CHIP:DMG: }, - [1651130076.882899][174458:174463] CHIP:DMG: - [1651130076.882903][174458:174463] CHIP:DMG: }, - [1651130076.882908][174458:174463] CHIP:DMG: - [1651130076.882911][174458:174463] CHIP:DMG: ], - [1651130076.882916][174458:174463] CHIP:DMG: - [1651130076.882920][174458:174463] CHIP:DMG: InteractionModelRevision = 1 - [1651130076.882923][174458:174463] CHIP:DMG: } - [1651130076.882938][174458:174463] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + PICS: LCFG.S.A0000 + command: "writeAttribute" + attribute: "ActiveLocale" + arguments: + value: Value.NotPresentInSupportedLocales + response: + error: CONSTRAINT_ERROR - label: "Step 6: TH writes new string present in SupportedLocales attribute to ActiveLocale Attribute" - verification: | - ./chip-tool localizationconfiguration write active-locale fr-FR 1 0 - - Verify that DUT responds as SUCCESS on TH(chip-tool) log and below is the sample log provided for the raspi platform: - - [1661759978.806852][104802:104807] CHIP:DMG: } - [1661759978.806866][104802:104807] CHIP:DMG: - [1661759978.806875][104802:104807] CHIP:DMG: StatusIB = - [1661759978.806887][104802:104807] CHIP:DMG: { - [1661759978.806897][104802:104807] CHIP:DMG: status = 0x00 (SUCCESS), - [1661759978.806909][104802:104807] CHIP:DMG: }, - [1661759978.806921][104802:104807] CHIP:DMG: - [1661759978.806929][104802:104807] CHIP:DMG: }, - [1661759978.806944][104802:104807] CHIP:DMG: - disabled: true + PICS: LCFG.S.A0000 + command: "writeAttribute" + attribute: "ActiveLocale" + arguments: + value: Value.PresentInSupportedLocales - label: "Step 7: TH Reads ActiveLocale" - verification: | - ./chip-tool localizationconfiguration read active-locale 1 0 - - Verify that ActiveLocale attribute value is changed to "fr-FR" on TH(chip-tool) log and below is the sample log provided for the raspi platform: - - [1661760013.634782][104820:104825] CHIP:DMG: } - [1661760013.634848][104820:104825] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002B Attribute 0x0000_0000 DataVersion: 3207653749 - [1661760013.634861][104820:104825] CHIP:TOO: ActiveLocale: fr-FR - [1661760013.634901][104820:104825] CHIP:EM: Sending Standalone Ack for MessageCounter:230450777 on exchange 24487i - disabled: true + PICS: LCFG.S.A0000 + command: "readAttribute" + attribute: "ActiveLocale" + response: + value: Value.PresentInSupportedLocales diff --git a/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml index 47affb98c57d0c..0af218e0a83173 100644 --- a/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml @@ -11,10 +11,9 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 117.3.1. [TC-LTIME-3.1] Read and Write Time Format Localization Cluster + 120.2.1. [TC-LTIME-3.1] Read and Write Time Format Localization Cluster Attributes [DUT as Server] PICS: @@ -22,150 +21,77 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" + cluster: "Time Format Localization" endpoint: 0 tests: + - label: "Step 0: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "Step 1: TH reads HourFormat attribute from DUT" PICS: LTIME.S.A0000 - verification: | - ./chip-tool timeformatlocalization read hour-format 1 0 - - Verify that HourFormat attribute value is of Enum8(0, 1) datatype on TH(chip-tool) log and below is the sample log provided for raspi platform, here "HourFormat" value is 0. - - [1651191944157] [13649:182326] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002C Attribute 0x0000_0000 DataVersion: 3316530441 - [1651191944158] [13649:182326] CHIP: [TOO] HourFormat: 0 - disabled: true + command: "readAttribute" + attribute: "HourFormat" + response: + constraints: + type: enum8 - label: "Step 2: If (LTIME.S.A0000.12HR) TH writes 0 to HourFormat attribute" PICS: LTIME.S.A0000.12HR - verification: | - ./chip-tool timeformatlocalization write hour-format 0 1 0 - - Verify that DUT sends a success response TH(chip-tool) log and below is the sample log provided for raspi platform: - - [1651192743588] [14026:192208] CHIP: [DMG] WriteResponseMessage = - [1651192743588] [14026:192208] CHIP: [DMG] { - [1651192743588] [14026:192208] CHIP: [DMG] AttributeStatusIBs = - [1651192743588] [14026:192208] CHIP: [DMG] [ - [1651192743588] [14026:192208] CHIP: [DMG] AttributeStatusIB = - [1651192743588] [14026:192208] CHIP: [DMG] { - [1651192743588] [14026:192208] CHIP: [DMG] AttributePathIB = - [1651192743588] [14026:192208] CHIP: [DMG] { - [1651192743588] [14026:192208] CHIP: [DMG] Endpoint = 0x0, - [1651192743588] [14026:192208] CHIP: [DMG] Cluster = 0x2c, - [1651192743588] [14026:192208] CHIP: [DMG] Attribute = 0x0000_0000, - [1651192743588] [14026:192208] CHIP: [DMG] } - [1651192743588] [14026:192208] CHIP: [DMG] - [1651192743588] [14026:192208] CHIP: [DMG] StatusIB = - [1651192743588] [14026:192208] CHIP: [DMG] { - [1651192743588] [14026:192208] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651192743588] [14026:192208] CHIP: [DMG] }, - [1651192743588] [14026:192208] CHIP: [DMG] - [1651192743588] [14026:192208] CHIP: [DMG] }, - [1651192743588] [14026:192208] CHIP: [DMG] - [1651192743588] [14026:192208] CHIP: [DMG] ], - [1651192743588] [14026:192208] CHIP: [DMG] - [1651192743588] [14026:192208] CHIP: [DMG] InteractionModelRevision = 1 - [1651192743588] [14026:192208] CHIP: [DMG] } - disabled: true - - - label: "TH reads HourFormat attribute" - PICS: LTIME.S.A0000 - verification: | - ./chip-tool timeformatlocalization read hour-format 1 0 - - Verify that HourFormat attribute value is changed to 0 on TH(chip-tool) log and below is the sample log provided for raspi platform: + command: "writeAttribute" + attribute: "HourFormat" + arguments: + value: 0 - [1651193120969] [14169:196901] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002C Attribute 0x0000_0000 DataVersion: 3316530443 - [1651193120969] [14169:196901] CHIP: [TOO] HourFormat: 0 - disabled: true + - label: "Step 3: TH reads HourFormat attribute" + PICS: LTIME.S.A0000 + command: "readAttribute" + attribute: "HourFormat" + response: + value: 0 - label: "Step 4: If (LTIME.S.A0000.24HR) TH writes 1 to HourFormat attribute" PICS: LTIME.S.A0000.24HR - verification: | - ./chip-tool timeformatlocalization write hour-format 1 1 0 - - Verify that DUT sends a success response on TH(chip-tool) log and and below is the sample log provided for raspi platform: - - [1651193043035] [14140:195730] CHIP: [DMG] WriteResponseMessage = - [1651193043035] [14140:195730] CHIP: [DMG] { - [1651193043035] [14140:195730] CHIP: [DMG] AttributeStatusIBs = - [1651193043035] [14140:195730] CHIP: [DMG] [ - [1651193043035] [14140:195730] CHIP: [DMG] AttributeStatusIB = - [1651193043035] [14140:195730] CHIP: [DMG] { - [1651193043035] [14140:195730] CHIP: [DMG] AttributePathIB = - [1651193043035] [14140:195730] CHIP: [DMG] { - [1651193043035] [14140:195730] CHIP: [DMG] Endpoint = 0x0, - [1651193043035] [14140:195730] CHIP: [DMG] Cluster = 0x2c, - [1651193043035] [14140:195730] CHIP: [DMG] Attribute = 0x0000_0000, - [1651193043035] [14140:195730] CHIP: [DMG] } - [1651193043035] [14140:195730] CHIP: [DMG] - [1651193043035] [14140:195730] CHIP: [DMG] StatusIB = - [1651193043035] [14140:195730] CHIP: [DMG] { - [1651193043035] [14140:195730] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651193043035] [14140:195730] CHIP: [DMG] }, - [1651193043035] [14140:195730] CHIP: [DMG] - [1651193043035] [14140:195730] CHIP: [DMG] }, - [1651193043035] [14140:195730] CHIP: [DMG] - [1651193043035] [14140:195730] CHIP: [DMG] ], - [1651193043035] [14140:195730] CHIP: [DMG] - [1651193043036] [14140:195730] CHIP: [DMG] InteractionModelRevision = 1 - [1651193043036] [14140:195730] CHIP: [DMG] } - [1651193043036] [14140:195730] CHIP: [DMG] WriteClient moving to [AwaitingDe] - disabled: true + command: "writeAttribute" + attribute: "HourFormat" + arguments: + value: 1 - label: "Step 5: TH reads HourFormat attribute" PICS: LTIME.S.A0000 - verification: | - ./chip-tool timeformatlocalization read hour-format 1 0 - - Verify that HourFormat attribute read request is successful and value is changed to 1 on TH(chip-tool) log and below is the sample log provided for raspi platform: - - [1651193120969] [14169:196901] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002C Attribute 0x0000_0000 DataVersion: 3316530443 - [1651193120969] [14169:196901] CHIP: [TOO] HourFormat: 1 - disabled: true + command: "readAttribute" + attribute: "HourFormat" + response: + value: 1 - label: "Step 6: TH reads ActiveCalendarType attribute from DUT" PICS: LTIME.S.A0001 - verification: | - ./chip-tool timeformatlocalization read active-calendar-type 1 0 - - Verify that ActiveCalendarType attribute read request is successful and value is in between 0 to 11 on TH(chip-tool) log and below is the sample log provided for raspi platform: - - [1651193250602] [14215:198406] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002C Attribute 0x0000_0001 DataVersion: 3316530443 - [1651193250602] [14215:198406] CHIP: [TOO] ActiveCalendarType: 0 - disabled: true + command: "readAttribute" + attribute: "ActiveCalendarType" + response: + constraints: + minValue: 0 + maxValue: 11 - label: "Step 7: TH reads SupportedCalendarTypes attribute from DUT" PICS: LTIME.S.A0002 - verification: | - ./chip-tool timeformatlocalization read supported-calendar-types 1 0 - - Verify that SupportedCalendarTypes attribute read request is successful and value is in between 0 to 11 on TH(chip-tool) log and below is the sample log provided for raspi platform: - - [1651194334793] [14653:210647] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002C Attribute 0x0000_0002 DataVersion: 3316530443 - [1651194334794] [14653:210647] CHIP: [TOO] SupportedCalendarTypes: 12 entries - [1651194334794] [14653:210647] CHIP: [TOO] [1]: 0 - [1651194334794] [14653:210647] CHIP: [TOO] [2]: 1 - [1651194334794] [14653:210647] CHIP: [TOO] [3]: 2 - [1651194334794] [14653:210647] CHIP: [TOO] [4]: 3 - [1651194334794] [14653:210647] CHIP: [TOO] [5]: 4 - [1651194334794] [14653:210647] CHIP: [TOO] [6]: 5 - [1651194334794] [14653:210647] CHIP: [TOO] [7]: 6 - [1651194334794] [14653:210647] CHIP: [TOO] [8]: 7 - [1651194334794] [14653:210647] CHIP: [TOO] [9]: 8 - [1651194334794] [14653:210647] CHIP: [TOO] [10]: 9 - [1651194334794] [14653:210647] CHIP: [TOO] [11]: 10 - [1651194334794] [14653:210647] CHIP: [TOO] [12]: 11 - disabled: true + command: "readAttribute" + attribute: "SupportedCalendarTypes" + response: + constraints: + maxLength: 12 - label: "Step 8: TH writes value in PIXIT.LTIME.SCT to ActiveCalendarType attribute, followed by reading the ActiveCalendarType attribute value" - PICS: LTIME.S.A0001 + PICS: LTIME.S.A0001 && PICS_SKIP_SAMPLE_APP verification: | ./chip-tool timeformatlocalization write active-calendar-type 0 1 0 @@ -204,10 +130,17 @@ tests: [1658149303.936185][9227:9232] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002C Attribute 0x0000_0001 DataVersion: 2364893025 [1658149303.936302][9227:9232] CHIP:TOO: ActiveCalendarType: 0 [1658149303.936385][9227:9232] CHIP:EM: Sending Standalone Ack for MessageCounter:70392442 on exchange 10288i - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 9: Repeat step 8 for all the values in PIXIT.LTIME.SCT" - PICS: LTIME.S.A0001 + PICS: LTIME.S.A0001 && PICS_SKIP_SAMPLE_APP verification: | Repeat the test step 8 for below mentioned values 1, 2,3, 4, 5, 6,7, 8, 9,10 and 11 and verify that TH receives the write command and updates the respective value. Verify that TH reads ActiveCalendarType attribute value and it is the same as the value that was set before @@ -387,56 +320,29 @@ tests: [1685531928.300701][17790:17790] CHIP:DMG: [1685531928.300705][17790:17790] CHIP:DMG: Data = 11, [1685531928.300709][17790:17790] CHIP:DMG: }, - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 10: TH writes 50 to ActiveCalendarType attribute" PICS: LTIME.S.A0001 - verification: | - ./chip-tool timeformatlocalization write active-calendar-type 50 1 0 - - Verify that DUT sends a CONSTRAINT_ERROR response On TH(chip-tool) log and below is the sample log provided for raspi platform: - - [1658742658.653019][3572:3577] CHIP:DMG: ], - [1658742658.653047][3572:3577] CHIP:DMG: - [1658742658.653071][3572:3577] CHIP:DMG: InteractionModelRevision = 1 - [1658742658.653098][3572:3577] CHIP:DMG: } - [1658742658.653166][3572:3577] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1658742658.653198][3572:3577] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1658742658.653254][3572:3577] CHIP:EM: Sending Standalone Ack for MessageCounter:51762667 on exchange 55831i - disabled: true + command: "writeAttribute" + attribute: "ActiveCalendarType" + arguments: + value: 50 + response: + error: CONSTRAINT_ERROR - label: "Step 11: TH writes 5 to HourFormat attribute" PICS: LTIME.S.A0000 - verification: | - ./chip-tool timeformatlocalization write hour-format 5 1 0 - - Verify that DUT sends a CONSTRAINT_ERROR response On TH(chip-tool) log and below is the sample log provided for raspi platform: - - [1656934321.910991][6387:6392] CHIP:DMG: WriteResponseMessage = - [1656934321.911025][6387:6392] CHIP:DMG: { - [1656934321.911054][6387:6392] CHIP:DMG: AttributeStatusIBs = - [1656934321.911096][6387:6392] CHIP:DMG: [ - [1656934321.911129][6387:6392] CHIP:DMG: AttributeStatusIB = - [1656934321.911165][6387:6392] CHIP:DMG: { - [1656934321.911200][6387:6392] CHIP:DMG: AttributePathIB = - [1656934321.911242][6387:6392] CHIP:DMG: { - [1656934321.911285][6387:6392] CHIP:DMG: Endpoint = 0x0, - [1656934321.911330][6387:6392] CHIP:DMG: Cluster = 0x2c, - [1656934321.911375][6387:6392] CHIP:DMG: Attribute = 0x0000_0000, - [1656934321.911417][6387:6392] CHIP:DMG: } - [1656934321.911463][6387:6392] CHIP:DMG: - [1656934321.911503][6387:6392] CHIP:DMG: StatusIB = - [1656934321.911574][6387:6392] CHIP:DMG: { - [1656934321.911618][6387:6392] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1656934321.911658][6387:6392] CHIP:DMG: }, - [1656934321.911699][6387:6392] CHIP:DMG: - [1656934321.911733][6387:6392] CHIP:DMG: }, - [1656934321.911772][6387:6392] CHIP:DMG: - [1656934321.911804][6387:6392] CHIP:DMG: ], - [1656934321.911842][6387:6392] CHIP:DMG: - [1656934321.911875][6387:6392] CHIP:DMG: InteractionModelRevision = 1 - [1656934321.911906][6387:6392] CHIP:DMG: } - [1656934321.911992][6387:6392] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1656934321.912033][6387:6392] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1656934321.912104][6387:6392] CHIP:EM: Sending Standalone Ack for MessageCounter:9709501 on exchange 15031i - disabled: true + command: "writeAttribute" + attribute: "HourFormat" + arguments: + value: 5 + response: + error: CONSTRAINT_ERROR diff --git a/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml index e06d2b9761edd9..bf8bac9d558ef3 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml @@ -11,54 +11,111 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 253.1.1. [TC-LWM-1.1] Global attributes with DUT as Server +name: 183.1.2. [TC-LWM-1.1] Cluster attributes with DUT as Server PICS: - LWM.S config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Mode" + endpoint: 1 tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - verification: | - ./chip-tool laundrywashermode read cluster-revision 1 1 - - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 1 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - [1690184527.689706][15400:15402] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_FFFD DataVersion: 3075628268 - [1690184527.689762][15400:15402] CHIP:TOO: ClusterRevision: 1 - disabled: true + - label: + "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL + be 1 if and only if LWM.S.F00(DEPONOFF)" + command: "readAttribute" + attribute: "FeatureMap" + PICS: LWM.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - verification: | - ./chip-tool laundrywashermode read feature-map 1 1 + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !LWM.S.F00 " + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - On the TH(Chip-tool) Log, Verify featureMap value is 1 If TCCM.S.F00(DEPONOFF) true, Otherwise 0, and below is the sample log provided for the raspi platform: + - label: + "Step 4b: Read the optional attribute(StartUpMode) in AttributeList" + PICS: LWM.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] - [1690184539.350009][15403:15405] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_FFFC DataVersion: 3075628268 - [1690184539.350062][15403:15405] CHIP:TOO: FeatureMap: 1 - disabled: true + - label: + "Step 4c: Read the Feature dependent attribute(DEPONOFF) in + AttributeList" + PICS: LWM.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] - - label: "Step 4: TH reads from the DUT the AttributeList attribute." + - label: + "Step 4d: TH reads AttributeList attribute from DUT 1.The list SHALL + NOT contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - + 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the + allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool laundrywashermode read attribute-list 1 1 Verify the "AttributeList " should include the mandatory attributes (values 0, 1), - - global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and - - list may include optional attribute(value 0x0002), if MOD.S.A0004(StartUpMode) supports, - - list contains feature dependent attribute (values 0x0003), if MOD.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + - Global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and + - List may include optional attribute(value 0x0002), if LWM.S.A0002(StartUpMode) supports, + - List contains feature dependent attribute (values 0x0003), if LWM.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1690184549.210762][15408:15410] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_FFFB DataVersion: 3075628268 [1690184549.210786][15408:15410] CHIP:TOO: AttributeList: 10 entries @@ -72,34 +129,127 @@ tests: [1690184549.210823][15408:15410] CHIP:TOO: [8]: 65531 [1690184549.210827][15408:15410] CHIP:TOO: [9]: 65532 [1690184549.210831][15408:15410] CHIP:TOO: [10]: 65533 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 5a: TH reads from the DUT the EventList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list - - label: "Step 5: TH reads from the DUT the EventList attribute." + - label: + "Step 5b: TH reads EventList attribute from DUT 1.The list SHALL NOT + contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the + Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignore 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where + XXXX is the allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool laundrywashermode read event-list 1 1 - Verify "EventList" contains a list of supported events, for this cluster the list is emty(0 entries) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + + Verify " EventList attribute " consists the list may contain optional events(1) on the TH(Chip-tool) Log: + [1690184560.096147][15413:15415] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_FFFA DataVersion: 3075628268 [1690184560.096165][15413:15415] CHIP:TOO: EventList: 0 entries - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute." + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." + - label: + "Step 6b: TH reads AcceptedCommandList attribute from DUT.The list + SHALL NOT contain any additional values in the standard or scoped + range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in + the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignored 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where + XXXX is the allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool laundrywashermode read accepted-command-list 1 1 - Verify the "AcceptedCommandList" contains a list of mandatory commands (value 0) on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + Verify Successfully " AcceptedCommandList attribute " on the TH1(Chip-tool) Log: [1690184572.184880][15416:15418] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_FFF9 DataVersion: 3075628268 [1690184572.184896][15416:15418] CHIP:TOO: AcceptedCommandList: 1 entries [1690184572.184901][15416:15418] CHIP:TOO: [1]: 0 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Step 7a: TH reads from the DUT the GeneratedCommandList attribute." + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [1] - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." + - label: + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list + SHALL NOT contain any additional values in the standard or scoped + range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in + the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignored 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), + where[1688447564.178537][4220:4222] CHIP:TOO: Endpoint: 1 Cluster: + 0x0000_0057 Attribute 0x0000_FFF8 DataVersion: 1795162772 + [1688447564.178684][4220:4222] CHIP:TOO: GeneratedCommandList: 0 + entries [1688447564.178984][4220:4222] CHIP:EM: <<< [E:5540i S:25125 + M:256711779 (Ack:197472718)] (S) Msg TX to 1:0000000000000001 [10DB] + --- Type 0000:10 (SecureChannel:StandaloneAck) XXXX is the allowed MEI + range (0x0001 - 0xFFF1)" verification: | ./chip-tool laundrywashermode read generated-command-list 1 1 - Verify " GeneratedCommandList" contains a list of mandatory commands (value 1) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + Verify Successfully" GeneratedCommandList attribute " on the TH1(Chip-tool) Log: [1690184586.309954][15419:15421] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_FFF8 DataVersion: 3075628268 [1690184586.310020][15419:15421] CHIP:TOO: GeneratedCommandList: 1 entries [1690184586.310043][15419:15421] CHIP:TOO: [1]: 1 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_LWM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_LWM_1_2.yaml index d5ccf5a9d956ca..39c4a04ceb7163 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_1_2.yaml @@ -37,11 +37,11 @@ tests: ./chip-tool laundrywashermode read supported-modes 1 1 Verify that the DUT response contains list of ModeOptionsStruct entries. - - Verify that list should contain at least one entry + - Verify that the list has at least 2 and at most 255 entries - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value - - ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster alias tag value (RapidCool, RapidFreeze) or in the MfgTags (0x8000 to 0xBFFF) range + - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the mode tag value a defined common tag value ( Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster derived tag value ( Normal, Delicate, Heavy, Whites) or in the MfgTags (0x8000 to 0xBFFF) range - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 - - Verify that at least one ModeOptionsStruct entry includes either the RapidCool semantic tag or the RapidFreeze semantic tag in the SemanticTags field + - Verify that at least one ModeOptionsStruct entry includes the Normal mode tag - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: [1690184598.426478][15422:15424] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 3075628268 @@ -94,7 +94,7 @@ tests: verification: | ./chip-tool laundrywashermode read current-mode 1 1 - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer and the value is from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 [1690184642.211028][15428:15430] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3075628268 [1690184642.211042][15428:15430] CHIP:TOO: CurrentMode: 0 @@ -105,7 +105,7 @@ tests: verification: | ./chip-tool laundrywashermode read on-mode 1 1 - Verify on TH(chip-tool) logs, OnMode attribute value is an integer and the value is from supported_modes_dut (As per spec default value is null) , below is the sample log provided for the raspi platform, Here OnMode attribute value is Null + Verify on TH(chip-tool) logs, OnMode attribute value is an integer value from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here OnMode attribute value is Null [1690184668.519026][15432:15434] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0003 DataVersion: 3075628268 [1690184668.519041][15432:15434] CHIP:TOO: OnMode: null @@ -116,7 +116,7 @@ tests: verification: | ./chip-tool laundrywashermode read start-up-mode 1 1 - Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer(As per spec default value is null) and value is from supported_modes_dut, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null + Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer value from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null [1690184690.235037][15436:15438] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 3075628268 [1690184690.235048][15436:15438] CHIP:TOO: StartUpMode: null diff --git a/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml index 6ae4fce0d5d6f5..ebea6a0bbdbf94 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 183.2.1. [TC-LWM-2.1] Change to Mode functionality with DUT as Server @@ -20,123 +19,136 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Mode" + endpoint: 1 + + #PIXIT.LWM.MODE_CHANGE_OK + NewMode_CHANGE_OK: + type: int8u + defaultValue: 2 + #PIXIT.LWM.MODE_CHANGE_FAIL + NewMode_CHANGE_FAIL: + type: int8u + defaultValue: 10 + invalid_mode_th: + type: int8u + defaultValue: 5 tests: - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding + "Step 1:Commission DUT to TH (can be skipped if done in a preceding test)." - verification: | - - disabled: true + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the SupportedModes attribute." PICS: LWM.S.A0000 - verification: | - ./chip-tool laundrywashermode read supported-modes 1 1 - - Verify that the DUT response contains list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: - - [1690184703.795207][15439:15441] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 3075628268 - [1690184703.795262][15439:15441] CHIP:TOO: SupportedModes: 4 entries - [1690184703.795291][15439:15441] CHIP:TOO: [1]: { - [1690184703.795296][15439:15441] CHIP:TOO: Label: Normal - [1690184703.795309][15439:15441] CHIP:TOO: Mode: 0 - [1690184703.795314][15439:15441] CHIP:TOO: ModeTags: 1 entries - [1690184703.795331][15439:15441] CHIP:TOO: [1]: { - [1690184703.795335][15439:15441] CHIP:TOO: Value: 16384 - [1690184703.795338][15439:15441] CHIP:TOO: } - [1690184703.795342][15439:15441] CHIP:TOO: } - [1690184703.795350][15439:15441] CHIP:TOO: [2]: { - [1690184703.795353][15439:15441] CHIP:TOO: Label: Delicate - [1690184703.795355][15439:15441] CHIP:TOO: Mode: 1 - [1690184703.795360][15439:15441] CHIP:TOO: ModeTags: 3 entries - [1690184703.795364][15439:15441] CHIP:TOO: [1]: { - [1690184703.795366][15439:15441] CHIP:TOO: Value: 16385 - [1690184703.795369][15439:15441] CHIP:TOO: } - [1690184703.795373][15439:15441] CHIP:TOO: [2]: { - [1690184703.795376][15439:15441] CHIP:TOO: Value: 8 - [1690184703.795379][15439:15441] CHIP:TOO: } - [1690184703.795382][15439:15441] CHIP:TOO: [3]: { - [1690184703.795386][15439:15441] CHIP:TOO: Value: 2 - [1690184703.795389][15439:15441] CHIP:TOO: } - [1690184703.795391][15439:15441] CHIP:TOO: } - [1690184703.795397][15439:15441] CHIP:TOO: [3]: { - [1690184703.795399][15439:15441] CHIP:TOO: Label: Heavy - [1690184703.795402][15439:15441] CHIP:TOO: Mode: 2 - [1690184703.795406][15439:15441] CHIP:TOO: ModeTags: 2 entries - [1690184703.795410][15439:15441] CHIP:TOO: [1]: { - [1690184703.795412][15439:15441] CHIP:TOO: Value: 7 - [1690184703.795414][15439:15441] CHIP:TOO: } - [1690184703.795418][15439:15441] CHIP:TOO: [2]: { - [1690184703.795422][15439:15441] CHIP:TOO: Value: 16386 - [1690184703.795424][15439:15441] CHIP:TOO: } - [1690184703.795426][15439:15441] CHIP:TOO: } - [1690184703.795432][15439:15441] CHIP:TOO: [4]: { - [1690184703.795435][15439:15441] CHIP:TOO: Label: Whites - [1690184703.795437][15439:15441] CHIP:TOO: Mode: 3 - [1690184703.795441][15439:15441] CHIP:TOO: ModeTags: 1 entries - [1690184703.795444][15439:15441] CHIP:TOO: [1]: { - [1690184703.795447][15439:15441] CHIP:TOO: Value: 16387 - [1690184703.795449][15439:15441] CHIP:TOO: } - [1690184703.795452][15439:15441] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list + minLength: 2 - label: "Step 3: TH reads from the DUT the CurrentMode attribute." PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut - - Select a value which is NOT in supported_modes_dut and save it as invalid_mode_th, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690184717.887506][15442:15444] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3075628268 - [1690184717.887558][15442:15444] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - label: "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set - to old_current_mode_dut" + to new_mode_th" PICS: LWM.S.C00.Rsp - verification: | - ./chip-tool laundrywashermode change-to-mode 0 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690184772.736083][15449:15451] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Command 0x0000_0001 - [1690184772.736098][15449:15451] CHIP:TOO: ChangeToModeResponse: { - [1690184772.736102][15449:15451] CHIP:TOO: status: 0 - [1690184772.736105][15449:15451] CHIP:TOO: } - disabled: true + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: old_current_mode_dut + response: + values: + - name: "Status" + value: 0x00 - label: "Step 5: Manually put the device in a state from which it will FAIL to transition to PIXIT.LWM.MODE_CHANGE_FAIL" - PICS: PIXIT.LWM.CAN_TEST_MODE_FAILURE + PICS: LWM.S.M.CAN_TEST_MODE_FAILURE && PICS_SKIP_SAMPLE_APP verification: | Manual operation required - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 6: TH reads from the DUT the CurrentMode attribute." PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - Verify on TH(chip-tool), Current modes attribute value is an integer value. - - Save the mode values for usage in steps 3 and below is the sample log provided for the raspi platform - - [1690184717.887506][15442:15444] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3075628268 - [1690184717.887558][15442:15444] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step6_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 + + #SDK not enabled this failure response + # - label: + # "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + # to PIXIT.LWM.MODE_CHANGE_FAIL" + # PICS: LWM.S.M.CAN_TEST_MODE_FAILURE && LWM.S.C00.Rsp + # command: "ChangeToMode" + # arguments: + # values: + # - name: "NewMode" + # value: NewMode_CHANGE_FAIL + # response: + # values: + # - name: "Status" + # constraints: + # anyOf: + # [ + # 0x02, + # 0x80, + # 0x81, + # 0x82, + # 0x83, + # 0x84, + # 0x85, + # 0x86, + # 0x87, + # 0x88, + # 0x89, + # 0x8A, + # 0x8B, + # 0x8C, + # 0x8D, + # 0x8E, + # 0xBF, + # ] + # - name: "StatusText" + # constraints: + # minLength: 1 + # maxLength: 64 - label: "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set to PIXIT.LWM.MODE_CHANGE_FAIL" - PICS: PIXIT.LWM.CAN_TEST_MODE_FAILURE && LWM.S.C00.Rsp + PICS: + LWM.S.M.CAN_TEST_MODE_FAILURE && LWM.S.C00.Rsp && PICS_SKIP_SAMPLE_APP verification: | Note : Please skip this step as SDK is not enabled with this failure response @@ -149,86 +161,96 @@ tests: [1690270057.274915][31185:31187] CHIP:TOO: ChangeToModeResponse: { [1690270057.274921][31185:31187] CHIP:TOO: status: 0 [1690270057.274924][31185:31187] CHIP:TOO: } - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 8: TH reads from the DUT the CurrentMode attribute." PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - Verify on TH(chip-tool), CurrentMode attribute value is an integer value and equal to old_current_mode_dut below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690184717.887506][15442:15444] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3075628268 - [1690184717.887558][15442:15444] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: Step6_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - label: "Step 9: Manually put the device in a state from which it will SUCCESSFULLY transition to PIXIT.LWM.MODE_CHANGE_OK" + PICS: PICS_SKIP_SAMPLE_APP verification: | Manual operation required - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 10: TH reads from the DUT the CurrentMode attribute." PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690184717.887506][15442:15444] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3075628268 - [1690184717.887558][15442:15444] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step10_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - label: "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set to PIXIT.LWM.MODE_CHANGE_OK" PICS: LWM.S.C00.Rsp - verification: | - ./chip-tool laundrywashermode change-to-mode 3 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: NewMode_CHANGE_OK + response: + values: + - name: "Status" + value: 0x00 - [1690185119.954667][15519:15521] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Command 0x0000_0001 - [1690185119.954682][15519:15521] CHIP:TOO: ChangeToModeResponse: { - [1690185119.954686][15519:15521] CHIP:TOO: status: 0 - [1690185119.954689][15519:15521] CHIP:TOO: } - disabled: true - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." + - label: + "Step 12: TH reads from the DUT the CurrentMode attribute. Verify + that the DUT response contains an integer value equal to + PIXIT.LWM.MODE_CHANGE_OK" PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 11, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 3 - - [1690185143.611836][15523:15525] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3075628273 - [1690185143.611850][15523:15525] CHIP:TOO: CurrentMode: 3 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: NewMode_CHANGE_OK - label: "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set to invalid_mode_th" PICS: LWM.S.C00.Rsp - verification: | - ./chip-tool laundrywashermode change-to-mode 5 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a UnsupportedMode(0x01) status response and below is the sample log provided for the raspi platform: - - [1690185176.658256][15528:15530] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Command 0x0000_0001 - [1690185176.658275][15528:15530] CHIP:TOO: ChangeToModeResponse: { - [1690185176.658280][15528:15530] CHIP:TOO: status: 1 - [1690185176.658284][15528:15530] CHIP:TOO: } - disabled: true + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: invalid_mode_th + response: + values: + - name: "Status" + value: 0x01 - - label: "Step 14: TH reads from the DUT the CurrentMode attribute." + - label: + "Step 14: TH reads from the DUT the CurrentMode attribute. Verify + that the DUT response contains an integer value equal to + PIXIT.LWM.MODE_CHANGE_OK" PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 12, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 3 - - [1690185143.611836][15523:15525] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3075628273 - [1690185143.611850][15523:15525] CHIP:TOO: CurrentMode: 3 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: NewMode_CHANGE_OK diff --git a/src/app/tests/suites/certification/Test_TC_LWM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_1.yaml index 7ce1d6da60ce93..2c394033ef6b39 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_3_1.yaml @@ -11,178 +11,122 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 183.3.1. [TC-LWM-3.1] On Mode functionality with DUT as Server PICS: - - LWM.S + - LWM.S.A0003 + - LWM.S.F00 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Mode" + endpoint: 1 -tests: - - label: "Note" - verification: | - To execute this test case set onmode to any integer value because as default it value has null. - - ./chip-tool laundrywashermode write on-mode 0 1 1 - - On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690185319.728749][15566:15568] CHIP:DMG: StatusIB = - [1690185319.728752][15566:15568] CHIP:DMG: { - [1690185319.728755][15566:15568] CHIP:DMG: status = 0x00 (SUCCESS), - [1690185319.728758][15566:15568] CHIP:DMG: }, - disabled: true - - - label: "Precondition" - verification: | - 1. Laundry Washer Mode and OnOff clusters are available on the same endpoint - - 2. The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. - disabled: true + ConfigureOnMode: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 2 +tests: - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)." - verification: | + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - disabled: true + - label: + "Precondition: TH writes from the DUT the OnMode attribute.NOTE: To + execute this test case set onmode to any integer value because as + default it value has null." + PICS: LWM.S.A0003 && LWM.S.F00 + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: ConfigureOnMode - label: "Step 2: TH reads from the DUT the OnMode attribute." PICS: LWM.S.A0003 && LWM.S.F00 - verification: | - ./chip-tool laundrywashermode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer or Null - Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 - - [1690185340.696395][15570:15572] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0003 DataVersion: 3936986762 - [1690185340.696410][15570:15572] CHIP:TOO: OnMode: 0 - disabled: true + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - label: "Step 3: TH reads from the DUT the CurrentMode attribute." PICS: LWM.S.A0001 && LWM.S.F00 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute is an integer. - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 - - NOTE: If on_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - [1690185351.764944][15576:15578] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3936986762 - [1690185351.764982][15576:15578] CHIP:TOO: CurrentMode: 0 - disabled: true + - label: + "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. + Else proceed to step 6." + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: on_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue - label: "Step 4: TH reads from the DUT the SupportedModes attribute." + runIf: IsExpectedValue PICS: LWM.S.A0000 && LWM.S.F00 - verification: | - ./chip-tool laundrywashermode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from on_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690185380.248193][15579:15581] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 3936986762 - [1690185380.248223][15579:15581] CHIP:TOO: SupportedModes: 4 entries - [1690185380.248237][15579:15581] CHIP:TOO: [1]: { - [1690185380.248240][15579:15581] CHIP:TOO: Label: Normal - [1690185380.248246][15579:15581] CHIP:TOO: Mode: 0 - [1690185380.248250][15579:15581] CHIP:TOO: ModeTags: 1 entries - [1690185380.248255][15579:15581] CHIP:TOO: [1]: { - [1690185380.248258][15579:15581] CHIP:TOO: Value: 16384 - [1690185380.248261][15579:15581] CHIP:TOO: } - [1690185380.248264][15579:15581] CHIP:TOO: } - [1690185380.248271][15579:15581] CHIP:TOO: [2]: { - [1690185380.248273][15579:15581] CHIP:TOO: Label: Delicate - [1690185380.248276][15579:15581] CHIP:TOO: Mode: 1 - [1690185380.248281][15579:15581] CHIP:TOO: ModeTags: 3 entries - [1690185380.248285][15579:15581] CHIP:TOO: [1]: { - [1690185380.248288][15579:15581] CHIP:TOO: Value: 16385 - [1690185380.248290][15579:15581] CHIP:TOO: } - [1690185380.248294][15579:15581] CHIP:TOO: [2]: { - [1690185380.248296][15579:15581] CHIP:TOO: Value: 8 - [1690185380.248299][15579:15581] CHIP:TOO: } - [1690185380.248302][15579:15581] CHIP:TOO: [3]: { - [1690185380.248305][15579:15581] CHIP:TOO: Value: 2 - [1690185380.248307][15579:15581] CHIP:TOO: } - [1690185380.248310][15579:15581] CHIP:TOO: } - [1690185380.248315][15579:15581] CHIP:TOO: [3]: { - [1690185380.248318][15579:15581] CHIP:TOO: Label: Heavy - [1690185380.248320][15579:15581] CHIP:TOO: Mode: 2 - [1690185380.248324][15579:15581] CHIP:TOO: ModeTags: 2 entries - [1690185380.248328][15579:15581] CHIP:TOO: [1]: { - [1690185380.248330][15579:15581] CHIP:TOO: Value: 7 - [1690185380.248333][15579:15581] CHIP:TOO: } - [1690185380.248336][15579:15581] CHIP:TOO: [2]: { - [1690185380.248339][15579:15581] CHIP:TOO: Value: 16386 - [1690185380.248341][15579:15581] CHIP:TOO: } - [1690185380.248344][15579:15581] CHIP:TOO: } - [1690185380.248349][15579:15581] CHIP:TOO: [4]: { - [1690185380.248351][15579:15581] CHIP:TOO: Label: Whites - [1690185380.248354][15579:15581] CHIP:TOO: Mode: 3 - [1690185380.248357][15579:15581] CHIP:TOO: ModeTags: 1 entries - [1690185380.248361][15579:15581] CHIP:TOO: [1]: { - [1690185380.248363][15579:15581] CHIP:TOO: Value: 16387 - [1690185380.248366][15579:15581] CHIP:TOO: } - [1690185380.248368][15579:15581] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list + minLength: 2 - label: "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th" + runIf: IsExpectedValue PICS: LWM.S.C00.Rsp && LWM.S.F00 - verification: | - ./chip-tool laundrywashermode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931013.571019][20667:20669] CHIP:DMG: - [1684931013.571021][20667:20669] CHIP:DMG: StatusIB = - [1684931013.571024][20667:20669] CHIP:DMG: { - [1684931013.571027][20667:20669] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931013.571030][20667:20669] CHIP:DMG: }, - [1684931013.571034][20667:20669] CHIP:DMG: - disabled: true - - - label: "Step 6: TH sends a Off command to the DUT" + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 6:TH sends a Off command to the DUT" PICS: OO.S.C00.Rsp && LWM.S.F00 - verification: | - ./chip-tool onoff off 1 1 + cluster: "On/Off" + command: "Off" - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931101.118656][20709:20711] CHIP:DMG: StatusIB = - [1684931101.118659][20709:20711] CHIP:DMG: { - [1684931101.118663][20709:20711] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931101.118665][20709:20711] CHIP:DMG: }, - disabled: true - - - label: "Step 7: TH sends a On command to the DUT" + - label: "Step 7:TH sends a On command to the DUT" PICS: OO.S.C01.Rsp && LWM.S.F00 - verification: | - ./chip-tool onoff on 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931217.055514][20729:20731] CHIP:DMG: StatusIB = - [1684931217.055517][20729:20731] CHIP:DMG: { - [1684931217.055520][20729:20731] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931217.055523][20729:20731] CHIP:DMG: }, - disabled: true + cluster: "On/Off" + command: "On" - label: "Step 8: TH reads from the DUT the CurrentMode attribute." PICS: LWM.S.A0001 && LWM.S.F00 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and equal to on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 0 - - [1690185481.653384][15610:15612] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3936986766 - [1690185481.653431][15610:15612] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml index 2359c29402a4ff..285c99184c5521 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml @@ -16,7 +16,7 @@ name: 183.3.2. [TC-LWM-3.2] Startup Mode functionality with DUT as Server PICS: - - LWM.S + - LWM.S.A0002 config: nodeId: 0x12344321 @@ -24,6 +24,11 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + !LWM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL + disabled: true + - label: "Note" verification: | To Execute the TC-LWM-3.2 test case using reboot in raspi device we followed the below suggested way: @@ -52,6 +57,8 @@ tests: On TH(chip-tool), Verify StartUpMode attribute value is an integer or null - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is null + NOTE: if startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. + [1690185689.626227][15652:15654] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 869931348 [1690185689.626269][15652:15654] CHIP:TOO: StartUpMode: null disabled: true @@ -124,6 +131,13 @@ tests: [1690185636.156870][15647:15649] CHIP:DMG: { [1690185636.156881][15647:15649] CHIP:DMG: status = 0x00 (SUCCESS), [1690185636.156892][15647:15649] CHIP:DMG: }, + + ./chip-tool laundrywashermode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform + + [1692168304.773793][2920:2922] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 3179897959 + [1692168304.773865][2920:2922] CHIP:TOO: StartUpMode: 0 disabled: true - label: "Step 5: TH reads from the DUT the CurrentMode attribute." @@ -132,7 +146,7 @@ tests: ./chip-tool laundrywashermode read current-mode 1 1 On TH(chip-tool), Verify CurrentMode attribute value is an integer, - - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform: + - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8. diff --git a/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml new file mode 100644 index 00000000000000..302eb46f563404 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml @@ -0,0 +1,287 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 183.3.3. [TC-LWM-3.3] On Mode and Startup Mode functionality with DUT as + Server + +PICS: + - LWM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: "Note" + verification: | + To Execute the TC-LWM-3.3 test case using reboot in raspi device we followed the below suggested way: + + To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps + + step-1: create a file using touch command , something like touch mytest.txt + step-2: chmod 777 mytest.txt + step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt + + if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. + disabled: true + + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + verification: | + + disabled: true + + - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + PICS: LWM.S.A0002 + verification: | + ./chip-tool laundrywashermode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is an integer value or null + - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is null + + NOTE: if startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. + + [1690185689.626227][15652:15654] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 869931348 + [1690185689.626269][15652:15654] CHIP:TOO: StartUpMode: null + disabled: true + + - label: "Step 3: TH reads from the DUT the SupportedModes attribute." + PICS: LWM.S.A0000 + verification: | + ./chip-tool laundrywashermode read supported-modes 1 1 + + On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut + - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: + + [1690185724.484514][15658:15660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 869931348 + [1690185724.484543][15658:15660] CHIP:TOO: SupportedModes: 4 entries + [1690185724.484552][15658:15660] CHIP:TOO: [1]: { + [1690185724.484555][15658:15660] CHIP:TOO: Label: Normal + [1690185724.484561][15658:15660] CHIP:TOO: Mode: 0 + [1690185724.484565][15658:15660] CHIP:TOO: ModeTags: 1 entries + [1690185724.484570][15658:15660] CHIP:TOO: [1]: { + [1690185724.484573][15658:15660] CHIP:TOO: Value: 16384 + [1690185724.484576][15658:15660] CHIP:TOO: } + [1690185724.484579][15658:15660] CHIP:TOO: } + [1690185724.484585][15658:15660] CHIP:TOO: [2]: { + [1690185724.484588][15658:15660] CHIP:TOO: Label: Delicate + [1690185724.484590][15658:15660] CHIP:TOO: Mode: 1 + [1690185724.484595][15658:15660] CHIP:TOO: ModeTags: 3 entries + [1690185724.484598][15658:15660] CHIP:TOO: [1]: { + [1690185724.484601][15658:15660] CHIP:TOO: Value: 16385 + [1690185724.484603][15658:15660] CHIP:TOO: } + [1690185724.484607][15658:15660] CHIP:TOO: [2]: { + [1690185724.484609][15658:15660] CHIP:TOO: Value: 8 + [1690185724.484612][15658:15660] CHIP:TOO: } + [1690185724.484615][15658:15660] CHIP:TOO: [3]: { + [1690185724.484617][15658:15660] CHIP:TOO: Value: 2 + [1690185724.484620][15658:15660] CHIP:TOO: } + [1690185724.484622][15658:15660] CHIP:TOO: } + [1690185724.484627][15658:15660] CHIP:TOO: [3]: { + [1690185724.484630][15658:15660] CHIP:TOO: Label: Heavy + [1690185724.484632][15658:15660] CHIP:TOO: Mode: 2 + [1690185724.484636][15658:15660] CHIP:TOO: ModeTags: 2 entries + [1690185724.484639][15658:15660] CHIP:TOO: [1]: { + [1690185724.484642][15658:15660] CHIP:TOO: Value: 7 + [1690185724.484644][15658:15660] CHIP:TOO: } + [1690185724.484647][15658:15660] CHIP:TOO: [2]: { + [1690185724.484649][15658:15660] CHIP:TOO: Value: 16386 + [1690185724.484652][15658:15660] CHIP:TOO: } + [1690185724.484654][15658:15660] CHIP:TOO: } + [1690185724.484659][15658:15660] CHIP:TOO: [4]: { + [1690185724.484662][15658:15660] CHIP:TOO: Label: Whites + [1690185724.484664][15658:15660] CHIP:TOO: Mode: 3 + [1690185724.484667][15658:15660] CHIP:TOO: ModeTags: 1 entries + [1690185724.484670][15658:15660] CHIP:TOO: [1]: { + [1690185724.484673][15658:15660] CHIP:TOO: Value: 16387 + [1690185724.484675][15658:15660] CHIP:TOO: } + [1690185724.484678][15658:15660] CHIP:TOO: } + disabled: true + + - label: + "Step 4: TH writes to the DUT the StartUpMode attribute with the + new_start_up_mode_th value" + PICS: LWM.S.A0002 + verification: | + ./chip-tool laundrywashermode write start-up-mode 0 1 1 + + On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690185636.156858][15647:15649] CHIP:DMG: StatusIB = + [1690185636.156870][15647:15649] CHIP:DMG: { + [1690185636.156881][15647:15649] CHIP:DMG: status = 0x00 (SUCCESS), + [1690185636.156892][15647:15649] CHIP:DMG: }, + + ./chip-tool laundrywashermode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform, + + [1692165008.700475][2609:2611] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 1273636449 + [1692165008.700550][2609:2611] CHIP:TOO: StartUpMode: 0 + disabled: true + + - label: "Step 5: TH reads from the DUT the OnMode attribute." + PICS: LWM.S.A0003 && LWM.S.A0002 + verification: | + As default value of OnMode attribute is NULL. Set the OnMode to any mode value listed in the SupportedModes entries. + + ./chip-tool laundrywashermode write on-mode 0 1 1 + + On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1692164726.392055][2590:2592] CHIP:DMG: StatusIB = + [1692164726.392093][2590:2592] CHIP:DMG: { + [1692164726.392128][2590:2592] CHIP:DMG: status = 0x00 (SUCCESS), + [1692164726.392163][2590:2592] CHIP:DMG: }, + + + ./chip-tool laundrywashermode read on-mode 1 1 + + On TH(chip-tool), Verify that OnMode attribute value is an integer + - Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 + + NOTE: If startup_mode_dut is equal to old_on_mode_dut proceed to step 6. Else proceed to step 8. + + [1692164858.854889][2600:2602] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0003 DataVersion: 1273636449 + [1692164858.854947][2600:2602] CHIP:TOO: OnMode: 0 + disabled: true + + - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + PICS: LWM.S.A0000 && LWM.S.A0002 + verification: | + ./chip-tool laundrywashermode read supported-modes 1 1 + + On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut + - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th. below is the sample log provided for the raspi platform: + + [1690185724.484514][15658:15660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 869931348 + [1690185724.484543][15658:15660] CHIP:TOO: SupportedModes: 4 entries + [1690185724.484552][15658:15660] CHIP:TOO: [1]: { + [1690185724.484555][15658:15660] CHIP:TOO: Label: Normal + [1690185724.484561][15658:15660] CHIP:TOO: Mode: 0 + [1690185724.484565][15658:15660] CHIP:TOO: ModeTags: 1 entries + [1690185724.484570][15658:15660] CHIP:TOO: [1]: { + [1690185724.484573][15658:15660] CHIP:TOO: Value: 16384 + [1690185724.484576][15658:15660] CHIP:TOO: } + [1690185724.484579][15658:15660] CHIP:TOO: } + [1690185724.484585][15658:15660] CHIP:TOO: [2]: { + [1690185724.484588][15658:15660] CHIP:TOO: Label: Delicate + [1690185724.484590][15658:15660] CHIP:TOO: Mode: 1 + [1690185724.484595][15658:15660] CHIP:TOO: ModeTags: 3 entries + [1690185724.484598][15658:15660] CHIP:TOO: [1]: { + [1690185724.484601][15658:15660] CHIP:TOO: Value: 16385 + [1690185724.484603][15658:15660] CHIP:TOO: } + [1690185724.484607][15658:15660] CHIP:TOO: [2]: { + [1690185724.484609][15658:15660] CHIP:TOO: Value: 8 + [1690185724.484612][15658:15660] CHIP:TOO: } + [1690185724.484615][15658:15660] CHIP:TOO: [3]: { + [1690185724.484617][15658:15660] CHIP:TOO: Value: 2 + [1690185724.484620][15658:15660] CHIP:TOO: } + [1690185724.484622][15658:15660] CHIP:TOO: } + [1690185724.484627][15658:15660] CHIP:TOO: [3]: { + [1690185724.484630][15658:15660] CHIP:TOO: Label: Heavy + [1690185724.484632][15658:15660] CHIP:TOO: Mode: 2 + [1690185724.484636][15658:15660] CHIP:TOO: ModeTags: 2 entries + [1690185724.484639][15658:15660] CHIP:TOO: [1]: { + [1690185724.484642][15658:15660] CHIP:TOO: Value: 7 + [1690185724.484644][15658:15660] CHIP:TOO: } + [1690185724.484647][15658:15660] CHIP:TOO: [2]: { + [1690185724.484649][15658:15660] CHIP:TOO: Value: 16386 + [1690185724.484652][15658:15660] CHIP:TOO: } + [1690185724.484654][15658:15660] CHIP:TOO: } + [1690185724.484659][15658:15660] CHIP:TOO: [4]: { + [1690185724.484662][15658:15660] CHIP:TOO: Label: Whites + [1690185724.484664][15658:15660] CHIP:TOO: Mode: 3 + [1690185724.484667][15658:15660] CHIP:TOO: ModeTags: 1 entries + [1690185724.484670][15658:15660] CHIP:TOO: [1]: { + [1690185724.484673][15658:15660] CHIP:TOO: Value: 16387 + [1690185724.484675][15658:15660] CHIP:TOO: } + [1690185724.484678][15658:15660] CHIP:TOO: } + disabled: true + + - label: + "Step 7: TH writes to the DUT the OnMode attribute with the + new_mode_th value" + PICS: LWM.S.A0003 + verification: | + ./chip-tool laundrywashermode write on-mode 1 1 1 + + On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1692165331.674699][2630:2632] CHIP:DMG: StatusIB = + [1692165331.674760][2630:2632] CHIP:DMG: { + [1692165331.674829][2630:2632] CHIP:DMG: status = 0x00 (SUCCESS), + [1692165331.674891][2630:2632] CHIP:DMG: }, + disabled: true + + - label: "Step 8: TH reads from the DUT the OnMode attribute." + PICS: LWM.S.A0003 && LWM.S.F00 + verification: | + ./chip-tool laundrywashermode read on-mode 1 1 + + On TH(chip-tool), Verify that OnMode attribute value is an integer value + - Save the value as new_on_mode_dut and is equal to new_mode_th, below is the sample log provided for the raspi platform, here OnMode value is 1 + + [1692165455.305858][2637:2639] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0003 DataVersion: 1273636452 + [1692165455.305928][2637:2639] CHIP:TOO: OnMode: 1 + disabled: true + + - label: + "Step 9: TH writes to the DUT the StartUpOnOff attribute with the + value 1." + PICS: OO.S.A4003 + verification: | + ./chip-tool onoff write start-up-on-off 1 1 1 + + On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1651101661960] [90832:7598169] CHIP: [DMG] { + [1651101661960] [90832:7598169] CHIP: [DMG] status = 0x00 (SUCCESS), + [1651101661960] [90832:7598169] CHIP: [DMG] }, + disabled: true + + - label: "Step 10: Physically power cycle the device" + verification: | + Physically power cycle the device. + disabled: true + + - label: "Step 11: TH reads from the DUT the StartUpMode attribute." + PICS: LWM.S.A0002 + verification: | + ./chip-tool laundrywashermode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is an integer value and is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform, Here StartUpMode value is 0 + + [1692165692.521150][2715:2717] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 3179897958 + [1692165692.521214][2715:2717] CHIP:TOO: StartUpMode: 0 + disabled: true + + - label: "Step 12: TH reads from the DUT the CurrentMode attribute." + PICS: LWM.S.A0001 + verification: | + ./chip-tool laundrywashermode read current-mode 1 1 + + On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is new_on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 1 + + [1690185481.653384][15610:15612] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3936986766 + [1690185481.653431][15610:15612] CHIP:TOO: CurrentMode: 1 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_MOD_1_2.yaml b/src/app/tests/suites/certification/Test_TC_MOD_1_2.yaml index 7685f299a43a68..4fdbe9e2cfc7fc 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_1_2.yaml @@ -82,7 +82,7 @@ tests: verification: | ./chip-tool modeselect read current-mode 1 1 - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer and the value is from supported_modes_dut, below is the sample log provided for the raspi platform: + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer that is in the list of modes returned in step 1, below is the sample log provided for the raspi platform: [1645776767.611140][4667:4672] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0000DataVersion: 3781469718 [1645776767.611214][4667:4672] CHIP:TOO: CurrentMode: 0 @@ -93,7 +93,7 @@ tests: verification: | ./chip-tool modeselect read on-mode 1 1 - Verify on TH(chip-tool) logs, OnMode attribute value is an integer and the value is from supported_modes_dut (As per spec default value is null) , below is the sample log provided for the raspi platform: + Verify on TH(chip-tool) logs, OnMode attribute value is an integer that is in the list of modes returned in step 1(As per spec default value is null) , below is the sample log provided for the raspi platform: [1649676072.465968][10754:10759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0005 DataVersion: 4277065072 [1649676072.466094][10754:10759] CHIP:TOO: OnMode: null @@ -104,7 +104,7 @@ tests: verification: | ./chip-tool modeselect read start-up-mode 1 1 - Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer and value is from supported_modes_dut, below is the sample log provided for the raspi platform: + Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer that is in the list of modes returned in step 1, below is the sample log provided for the raspi platform: [1649677014.496348][10778:10784] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0004 DataVersion: 4277065072 [1649677014.496469][10778:10784] CHIP:TOO: StartUpMode: 0 @@ -126,7 +126,7 @@ tests: verification: | ./chip-tool modeselect read standard-namespace 1 1 - Verify on TH(chip-tool) logs, StandardNamespace attribute value is an enum16(null is also acceptable), below is the sample log provided for the raspi platform: + Verify on TH(chip-tool) logs, StandardNamespace attribute value is an enum16, below is the sample log provided for the raspi platform: [1689750113.807806][3472:3474] CHIP:DMG: } [1689750113.807960][3472:3474] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0001 DataVersion: 628878473 diff --git a/src/app/tests/suites/certification/Test_TC_MOD_2_1.yaml b/src/app/tests/suites/certification/Test_TC_MOD_2_1.yaml old mode 100644 new mode 100755 index 9fe156fc082adf..e0f173eea1c224 --- a/src/app/tests/suites/certification/Test_TC_MOD_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,145 +11,70 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 80.3.1. [TC-MOD-2.1] ChangeToMode verification with DUT as Server +name: 80.2.1. [TC-MOD-2.1] ChangeToMode Verification (DUT as Server) PICS: - MOD.S.C00.Rsp config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Mode Select" + endpoint: 1 + #Configure newmode value + NewMode: + type: int8u + defaultValue: 4 tests: - - label: "Preconditions" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 1: TH reads the SupportedModes attribute from the DUT" + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads the SupportedModes attribute from the DUT" PICS: MOD.S.A0002 - verification: | - ./chip-tool modeselect read supported-modes 1 1 + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list - On TH(chip-tool) log, Verify that the DUT response contains list of supported modes. - Save the Mode numbers for usage in steps 3 and 4 and below is the sample log provided for the raspi platform: - - [1654595268.854568][14400:14405] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0002 DataVersion: 366231602 - [1654595268.854678][14400:14405] CHIP:TOO: SupportedModes: 3 entries - [1654595268.854743][14400:14405] CHIP:TOO: [1]: { - [1654595268.854772][14400:14405] CHIP:TOO: Label: Black - [1654595268.854811][14400:14405] CHIP:TOO: Mode: 0 - [1654595268.854843][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.854891][14400:14405] CHIP:TOO: [1]: { - [1654595268.854918][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.854945][14400:14405] CHIP:TOO: Value: 0 - [1654595268.854971][14400:14405] CHIP:TOO: } - [1654595268.855000][14400:14405] CHIP:TOO: } - [1654595268.855038][14400:14405] CHIP:TOO: [2]: { - [1654595268.855064][14400:14405] CHIP:TOO: Label: Cappuccino - [1654595268.855089][14400:14405] CHIP:TOO: Mode: 4 - [1654595268.855117][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855149][14400:14405] CHIP:TOO: [1]: { - [1654595268.855175][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855199][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855223][14400:14405] CHIP:TOO: } - [1654595268.855249][14400:14405] CHIP:TOO: } - [1654595268.855284][14400:14405] CHIP:TOO: [3]: { - [1654595268.855310][14400:14405] CHIP:TOO: Label: Espresso - [1654595268.855332][14400:14405] CHIP:TOO: Mode: 7 - [1654595268.855360][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855390][14400:14405] CHIP:TOO: [1]: { - [1654595268.855416][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855440][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855464][14400:14405] CHIP:TOO: } - [1654595268.855490][14400:14405] CHIP:TOO: } - [1649677252.376226][10804:10809] CHIP:TOO: SemanticTag: 0 - [1649677252.376252][10804:10809] CHIP:TOO: } - disabled: true - - - label: "Step 2: TH reads the CurrentMode attribute from the DUT" + - label: "TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - Verify on TH(chip-tool), Current modes attribute value is an integer value. - - Save the mode values for usage in steps 3 and below is the sample log provided for the raspi platform - - [1649678800.298128][10854:10861] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003 DataVersion: 4277065073 - [1649678800.298279][10854:10861] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut - label: - "Step 3a: TH sends a ChangeToMode command to the DUT with a integer - from the list in step 1, but different from the integer from step 2" + "TH sends a ChangeToMode command to the DUT with a integer from the + list in step 1, but different from the integer from step 2" PICS: MOD.S.C00.Rsp - verification: | - ./chip-tool modeselect change-to-mode 4 1 1 - - Verify on TH(chip-tool) log, DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: NewMode - [1685017925.030090][16218:16220] CHIP:DMG: CommandStatusIB = - [1685017925.030093][16218:16220] CHIP:DMG: { - [1685017925.030096][16218:16220] CHIP:DMG: CommandPathIB = - [1685017925.030099][16218:16220] CHIP:DMG: { - [1685017925.030102][16218:16220] CHIP:DMG: EndpointId = 0x1, - [1685017925.030106][16218:16220] CHIP:DMG: ClusterId = 0x50, - [1685017925.030109][16218:16220] CHIP:DMG: CommandId = 0x0, - [1685017925.030112][16218:16220] CHIP:DMG: }, - [1685017925.030117][16218:16220] CHIP:DMG: - [1685017925.030121][16218:16220] CHIP:DMG: StatusIB = - [1685017925.030126][16218:16220] CHIP:DMG: { - [1685017925.030129][16218:16220] CHIP:DMG: status = 0x00 (SUCCESS), - [1685017925.030133][16218:16220] CHIP:DMG: }, - [1685017925.030138][16218:16220] CHIP:DMG: - disabled: true - - - label: "Step 3b: TH reads the CurrentMode attribute from the DUT" + - label: "TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - Verify on TH(chip-tool), CurrentMode attribute value is an integer provided in step 3a, not the integer from step 2, below is the sample log provided for the raspi platform: - - [1685017991.905343][16336:16338] CHIP:DMG: ], - [1685017991.905348][16336:16338] CHIP:DMG: - [1685017991.905351][16336:16338] CHIP:DMG: SuppressResponse = true, - [1685017991.905353][16336:16338] CHIP:DMG: InteractionModelRevision = 1 - [1685017991.905356][16336:16338] CHIP:DMG: } - [1685017991.905393][16336:16338] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003 DataVersion: 3673378954 - [1685017991.905407][16336:16338] CHIP:TOO: CurrentMode: 4 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: NewMode - label: - "Step 4: TH sends a ChangeToMode command to the DUT with a integer - that is not in the list in step 1." + "TH sends a ChangeToMode command to the DUT with a integer that is not + in the list in step 1." PICS: MOD.S.C00.Rsp - verification: | - ./chip-tool modeselect change-to-mode 5 1 1 - - Verify on TH(chip-tool) log, DUT responds with a INVALID_COMMAND (value 0x85) status response and below is the sample log provided for the raspi platform: - - [1685018023.768417][16341:16343] CHIP:DMG: StatusIB = - [1685018023.768429][16341:16343] CHIP:DMG: { - [1685018023.768441][16341:16343] CHIP:DMG: status = 0x85 (INVALID_COMMAND), - [1685018023.768452][16341:16343] CHIP:DMG: }, - [1685018023.768464][16341:16343] CHIP:DMG: - [1685018023.768474][16341:16343] CHIP:DMG: }, - [1685018023.768490][16341:16343] CHIP:DMG: - [1685018023.768499][16341:16343] CHIP:DMG: }, - [1685018023.768515][16341:16343] CHIP:DMG: - [1685018023.768523][16341:16343] CHIP:DMG: ], - [1685018023.768540][16341:16343] CHIP:DMG: - [1685018023.768549][16341:16343] CHIP:DMG: InteractionModelRevision = 1 - [1685018023.768558][16341:16343] CHIP:DMG: }, - disabled: true + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: 100 + response: + error: INVALID_COMMAND diff --git a/src/app/tests/suites/certification/Test_TC_MOD_2_3.yaml b/src/app/tests/suites/certification/Test_TC_MOD_2_3.yaml deleted file mode 100644 index c9ad295b254c7f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_MOD_2_3.yaml +++ /dev/null @@ -1,131 +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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 80.4.1.[TC-MOD-2.3] ChangeToModeWithStatus Verification DUT as Server - -PICS: - - MOD.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the SupportedModes attribute." - PICS: MOD.S.A0002 - verification: | - ./chip-tool modeselect read supported-modes 1 1 - - On TH(chip-tool) log, Verify SupportedModes attribute should contains two or more ModeOptionsStruct entries and - Save the Mode field values as supported_modes_dut, below is the sample log provided for the raspi platform: - - [1685018204.991818][16390:16392] CHIP:DMG: } - [1685018204.992182][16390:16392] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0002 DataVersion: 3673378954 - [1685018204.992279][16390:16392] CHIP:TOO: SupportedModes: 3 entries - [1685018204.992320][16390:16392] CHIP:TOO: [1]: { - [1685018204.992331][16390:16392] CHIP:TOO: Label: Black - [1685018204.992350][16390:16392] CHIP:TOO: Mode: 0 - [1685018204.992376][16390:16392] CHIP:TOO: SemanticTags: 1 entries - [1685018204.992408][16390:16392] CHIP:TOO: [1]: { - [1685018204.992420][16390:16392] CHIP:TOO: MfgCode: 0 - [1685018204.992430][16390:16392] CHIP:TOO: Value: 0 - [1685018204.992440][16390:16392] CHIP:TOO: } - [1685018204.992452][16390:16392] CHIP:TOO: } - [1685018204.992482][16390:16392] CHIP:TOO: [2]: { - [1685018204.992492][16390:16392] CHIP:TOO: Label: Cappuccino - [1685018204.992504][16390:16392] CHIP:TOO: Mode: 4 - [1685018204.992525][16390:16392] CHIP:TOO: SemanticTags: 1 entries - [1685018204.992547][16390:16392] CHIP:TOO: [1]: { - [1685018204.992558][16390:16392] CHIP:TOO: MfgCode: 0 - [1685018204.992567][16390:16392] CHIP:TOO: Value: 0 - [1685018204.992578][16390:16392] CHIP:TOO: } - [1685018204.992588][16390:16392] CHIP:TOO: } - [1685018204.992610][16390:16392] CHIP:TOO: [3]: { - [1685018204.992619][16390:16392] CHIP:TOO: Label: Espresso - [1685018204.992628][16390:16392] CHIP:TOO: Mode: 7 - [1685018204.992641][16390:16392] CHIP:TOO: SemanticTags: 1 entries - [1685018204.992657][16390:16392] CHIP:TOO: [1]: { - [1685018204.992666][16390:16392] CHIP:TOO: MfgCode: 0 - [1685018204.992678][16390:16392] CHIP:TOO: Value: 0 - [1685018204.992687][16390:16392] CHIP:TOO: } - [1685018204.992695][16390:16392] CHIP:TOO: } - disabled: true - - - label: "Step 2: TH reads from the DUT the CurrentMode attribute." - PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value - - Save the value as old_current_mode_dut - - Select a value from supported_modes_dut, different from old_current_mode_dut, and which corresponds to a mode the device can switch to, given its current state and save this value as new_mode_th - - Select a value which is NOT in supported_modes_dut and save it as invalid_mode_th, - below is the sample log provided for the raspi platform: - - [1685018283.726571][16418:16420] CHIP:DMG: SuppressResponse = true, - [1685018283.726581][16418:16420] CHIP:DMG: InteractionModelRevision = 1 - [1685018283.726589][16418:16420] CHIP:DMG: } - [1685018283.726667][16418:16420] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003 DataVersion: 3898153349 - [1685018283.726680][16418:16420] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 3: TH sends a ChangeToModeWithStatus command to the DUT with - NewMode set to old_current_mode_dut [Petru] note that currently this - constraint is not in the spec. The unapproved proposal is here: - https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/7096 - Until that's approved, please skip this step." - PICS: MOD.S.C01.Rsp - verification: | - ChangeToModeWithStatus Command is not impleented. - disabled: true - - - label: - "Step 4: TH sends a ChangeToModeWithStatus command to the DUT with - NewMode set to new_mode_th" - PICS: MOD.S.C01.Rsp - verification: | - ChangeToModeWithStatus Command is not implemented. - disabled: true - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and equal to the new_mode_th, below is the sample log provided for the raspi platform: - - [1685018283.726571][16418:16420] CHIP:DMG: SuppressResponse = true, - [1685018283.726581][16418:16420] CHIP:DMG: InteractionModelRevision = 1 - [1685018283.726589][16418:16420] CHIP:DMG: } - [1685018283.726667][16418:16420] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003 DataVersion: 3898153349 - [1685018283.726680][16418:16420] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 6: TH sends a ChangeToModeWithStatus command to the DUT with - NewMode set to invalid_mode_th" - PICS: MOD.S.C01.Rsp - verification: | - ChangeToModeWithStatus Command is not implemented. - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml old mode 100644 new mode 100755 index d49f4a9d47e143..9a30ae38134f45 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml @@ -16,159 +16,103 @@ name: 80.5.1. [TC-MOD-3.1] OnMode verification with DUT as Server PICS: - - MOD.S + - MOD.S.A0005 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Mode Select" + endpoint: 1 + #Configure newmode value + NewMode: + type: int8u + defaultValue: 7 + WaitTime: + type: int16u + defaultValue: 5000 tests: - - label: "Note" - verification: | - To execute this test case set onmode to any integer value because as default it value has null. - - ./chip-tool modeselect write on-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response. - - [1686556272.397529][44474:44476] CHIP:DMG: StatusIB = - [1686556272.397584][44474:44476] CHIP:DMG: { - [1686556272.397641][44474:44476] CHIP:DMG: status = 0x00 (SUCCESS), - [1686556272.397673][44474:44476] CHIP:DMG: }, - disabled: true - - - label: "Precondition" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true - - - label: "Step 1: TH reads the OnMode attribute from the DUT" + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads the OnMode attribute from the DUT" PICS: MOD.S.A0005 && MOD.S.F00 - verification: | - ./chip-tool modeselect read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer. - Save this value for usage in step 2b and below is the sample log provided for the raspi platform: + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut - [1649678983.679893][10871:10876] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0005 DataVersion: 4277065073 - [1649678983.680002][10871:10876] CHIP:TOO: OnMode: 0 - disabled: true - - - label: "Step 2a: TH reads the CurrentMode attribute from the DUT" + - label: "TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 && MOD.S.F00 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute is an integer. - Save the value for usage in step 2b and below is the sample log provided for the raspi platform: - - NOTE: If on_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. - - [1649679034.895848][10879:10884] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003 DataVersion: 4277065073 - [1649679034.895972][10879:10884] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut - label: - "Step 2b: If the OnMode and CurrentMode attributes have the same - value, proceed to step 2c, Otherwise proceed to step 3a." + "If the OnMode and CurrentMode attributes have the same value, proceed + to step 2c, Otherwise proceed to step 3a" PICS: MOD.S.A0003 && MOD.S.A0005 && MOD.S.F00 - verification: | - If the OnMode and CurrentMode attributes have the same value, proceed to step 2c, Otherwise proceed to step 3a. - disabled: true - - - label: "Step 2c: TH reads the SupportedModes attribute from the DUT" - PICS: MOD.S.A0002 && MOD.S.F00 - verification: | - ./chip-tool modeselect read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of supported modes. - Save the Mode values for usage in step 2d, below is the sample log provided for the raspi platform: - - [1654595268.854568][14400:14405] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0002 DataVersion: 366231602 - [1654595268.854678][14400:14405] CHIP:TOO: SupportedModes: 3 entries - [1654595268.854743][14400:14405] CHIP:TOO: [1]: { - [1654595268.854772][14400:14405] CHIP:TOO: Label: Black - [1654595268.854811][14400:14405] CHIP:TOO: Mode: 0 - [1654595268.854843][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.854891][14400:14405] CHIP:TOO: [1]: { - [1654595268.854918][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.854945][14400:14405] CHIP:TOO: Value: 0 - [1654595268.854971][14400:14405] CHIP:TOO: } - [1654595268.855000][14400:14405] CHIP:TOO: } - [1654595268.855038][14400:14405] CHIP:TOO: [2]: { - [1654595268.855064][14400:14405] CHIP:TOO: Label: Cappuccino - [1654595268.855089][14400:14405] CHIP:TOO: Mode: 4 - [1654595268.855117][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855149][14400:14405] CHIP:TOO: [1]: { - [1654595268.855175][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855199][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855223][14400:14405] CHIP:TOO: } - [1654595268.855249][14400:14405] CHIP:TOO: } - [1654595268.855284][14400:14405] CHIP:TOO: [3]: { - [1654595268.855310][14400:14405] CHIP:TOO: Label: Espresso - [1654595268.855332][14400:14405] CHIP:TOO: Mode: 7 - [1654595268.855360][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855390][14400:14405] CHIP:TOO: [1]: { - [1654595268.855416][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855440][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855464][14400:14405] CHIP:TOO: } - [1654595268.855490][14400:14405] CHIP:TOO: } - [1649677252.376226][10804:10809] CHIP:TOO: SemanticTag: 0 - [1649677252.376252][10804:10809] CHIP:TOO: } - disabled: true + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: on_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "TH reads the SupportedModes attribute from the DUT" + runIf: IsExpectedValue + PICS: MOD.S.A0005 && MOD.S.F00 + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list - label: - "Step 2d: Select a value from the list in step 2c with a different - value than the OnMode value read in step 1. TH sends a ChangeToMode - command to the DUT with the selected value." + "Select a value from the list in step 2c with a different value than + the onMode value read in step 1. TH sends a ChangeToMode command to + the TH with the selected value." + runIf: IsExpectedValue PICS: MOD.S.A0002 && MOD.S.C00.Rsp && MOD.S.F00 - verification: | - ./chip-tool modeselect change-to-mode 7 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: NewMode - [1684931013.571019][20667:20669] CHIP:DMG: - [1684931013.571021][20667:20669] CHIP:DMG: StatusIB = - [1684931013.571024][20667:20669] CHIP:DMG: { - [1684931013.571027][20667:20669] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931013.571030][20667:20669] CHIP:DMG: }, - [1684931013.571034][20667:20669] CHIP:DMG: - disabled: true - - - label: "Step 3a: TH sends an Off command to the DUT" + - label: "TH sends an Off command to the DUT" PICS: OO.S.C00.Rsp && MOD.S.F00 - verification: | - ./chip-tool onoff off 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931101.118656][20709:20711] CHIP:DMG: StatusIB = - [1684931101.118659][20709:20711] CHIP:DMG: { - [1684931101.118663][20709:20711] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931101.118665][20709:20711] CHIP:DMG: }, - disabled: true + cluster: "On/Off" + command: "Off" - - label: "Step 3b: TH sends an On command to the DUT" + - label: "TH sends an On command to the DUT" PICS: OO.S.C01.Rsp && MOD.S.F00 - verification: | - ./chip-tool onoff on 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931217.055514][20729:20731] CHIP:DMG: StatusIB = - [1684931217.055517][20729:20731] CHIP:DMG: { - [1684931217.055520][20729:20731] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931217.055523][20729:20731] CHIP:DMG: }, - disabled: true - - - label: "Step 3c: TH reads the CurrentMode attribute from the DUT" + cluster: "On/Off" + command: "On" + + - label: "Wait to turn on/Off light" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: WaitTime + + - label: "TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 && MOD.S.F00 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer recorded in step 1, below is the sample log provided for the raspi platform: - - [1649679202.069163][10899:10904] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003 DataVersion: 4277065073 - [1649679202.069278][10899:10904] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + constraints: + anyOf: [old_current_mode_dut, NewMode] diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml old mode 100644 new mode 100755 index c3f5e3541d55fe..09e48c70836e4d --- a/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml @@ -13,136 +13,105 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 80.5.2. [TC-MOD-3.2] StartUpMode Verification (DUT as Server) +name: 80.5.2. [TC-MOD-3.2] StartUpMode verification with DUT as Server PICS: - - MOD.S + - MOD.S.A0004 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Mode Select" + endpoint: 1 + #Configure newmode value + NewMode: + type: int8u + defaultValue: 7 tests: - - label: "Note" - verification: | - To Execute the TC-MOD-3.2 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps - - - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. - disabled: true - - - label: "Precondition" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true - - - label: "Step 1: TH reads the StartUpMode attribute from the DUT" + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads the StartUpMode attribute from the DUT" PICS: MOD.S.A0004 - verification: | - ./chip-tool modeselect read start-up-mode 1 1 - - On TH(chip-tool), Verify DUT response is an integer and Record this value for usage in step 2, below is the sample log provided for the raspi platform: - - [1645777708.406864][4841:4846] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003DataVersion: 3781469721 - [1645777708.406933][4841:4846] CHIP:TOO: StartUpMode: 0 - disabled: true + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut - - label: "Step 2a: TH reads the CurrentMode attribute from the DUT" + - label: "TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer, - save the value for usage in steps 2b and below is the sample log provided for the raspi platform: - - [1645778146.171510][4876:4881] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0000DataVersion: 3781469721 - [1645778146.171602][4876:4881] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut - label: - "Step 2b: If the StartUpMode and CurrentMode attributes have the same - value, proceed to step 2c, Otherwise proceed to step 3a." + "If startup_mode_dut is equal to old_current_mode_dut proceed to step + 4. Else proceed to step 6" PICS: MOD.S.A0003 && MOD.S.A0004 - verification: | - If the StartUpMode and CurrentMode attributes have the same value, proceed to step 2c, Otherwise proceed to step 3a. - disabled: true - - - label: "Step 2c: TH reads the SupportedModes attribute from the DUT" + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "TH reads the SupportedModes attribute from the DUT" + runIf: IsExpectedValue PICS: MOD.S.A0002 - verification: | - ./chip-tool modeselect read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of supported modes. - - Record the mode numbers for usage in step 2d, below is the sample log provided for the raspi platform: - - [1654595268.854568][14400:14405] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0002 DataVersion: 366231602 - [1654595268.854678][14400:14405] CHIP:TOO: SupportedModes: 3 entries - [1654595268.854743][14400:14405] CHIP:TOO: [1]: { - [1654595268.854772][14400:14405] CHIP:TOO: Label: Black - [1654595268.854811][14400:14405] CHIP:TOO: Mode: 0 - [1654595268.854843][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.854891][14400:14405] CHIP:TOO: [1]: { - [1654595268.854918][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.854945][14400:14405] CHIP:TOO: Value: 0 - [1654595268.854971][14400:14405] CHIP:TOO: } - [1654595268.855000][14400:14405] CHIP:TOO: } - [1654595268.855038][14400:14405] CHIP:TOO: [2]: { - [1654595268.855064][14400:14405] CHIP:TOO: Label: Cappuccino - [1654595268.855089][14400:14405] CHIP:TOO: Mode: 4 - [1654595268.855117][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855149][14400:14405] CHIP:TOO: [1]: { - [1654595268.855175][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855199][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855223][14400:14405] CHIP:TOO: } - [1654595268.855249][14400:14405] CHIP:TOO: } - [1654595268.855284][14400:14405] CHIP:TOO: [3]: { - [1654595268.855310][14400:14405] CHIP:TOO: Label: Espresso - [1654595268.855332][14400:14405] CHIP:TOO: Mode: 7 - [1654595268.855360][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855390][14400:14405] CHIP:TOO: [1]: { - [1654595268.855416][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855440][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855464][14400:14405] CHIP:TOO: } - [1654595268.855490][14400:14405] CHIP:TOO: } - [1649677252.376226][10804:10809] CHIP:TOO: SemanticTag: 0 - [1649677252.376252][10804:10809] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list - label: - "Step 2d: Select a value from the list in step 2c with a different - value than the StartUpMode value read in step 1. TH sends a - ChangeToMode command to the DUT with the selected value." + "Select a value from the list in step 2c with a different value than + the StartUpMode value read in step 1. TH sends a ChangeToMode command + to the DUT with the selected value." + runIf: IsExpectedValue PICS: MOD.S.A0002 && MOD.S.C00.Rsp - verification: | - ./chip-tool modeselect change-to-mode 4 1 1 - - On TH(chip-tool) , Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: NewMode - [1684931419.768138][20792:20794] CHIP:DMG: StatusIB = - [1684931419.768143][20792:20794] CHIP:DMG: { - [1684931419.768148][20792:20794] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931419.768152][20792:20794] CHIP:DMG: }, - disabled: true - - - label: "Step 3a: Physically power cycle the device." + - label: "Physically power cycle the device." verification: | Physically power cycle the device. - disabled: true - - - label: "Step 3b: TH reads the CurrentMode attribute from the DUT" - PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - on TH(chip-tool), Verify that CurrentMode attribute value is an integer recorded in step 1, below is the sample log provided for the raspi platform: - - [1645778146.171510][4876:4881] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0000DataVersion: 3781469721 - [1645778146.171602][4876:4881] CHIP:TOO: CurrentMode: 0 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Commission device after reboot" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads the CurrentMode attribute from the DUT" + PICS: MOD.S.A0003 && MOD.S.F00 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "CurrentMode" + response: + value: startup_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml index fe094d51573a4d..5553de105f9de3 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 81.3.3. [TC-MOD-3.3] OTA Mode Verification (DUT as Server) @@ -20,162 +19,105 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Mode Select" + endpoint: 1 + #Configure newmode value + NewMode: + type: int8u + defaultValue: 7 tests: - - label: "Note" - verification: | - 1.To run this test case build the OTA Provider app to be build in the nRF Environment setup . Follow this step to setup the nRF build environment using container. - https://github.com/project-chip/connectedhomeip/tree/master/examples/all-clusters-app/nrfconnect#using-docker-container-for-setup - - Once the build environmnet is ready , build teh OTA-Provider-App inside the container. Follow the below link to build the OTA-Provider app - https://github.com/project-chip/connectedhomeip/tree/master/examples/ota-provider-app/linux - - 2. Build all-cluster-app in docker or Flash the pre-built folder from the delivered image - - To build maually and flash follow steps explained in: - https://github.com/project-chip/connectedhomeip/tree/master/examples/all-clusters-app/nrfconnect#building - - west build -b nrf52840dk_nrf52840 -- -DCONF_FILE=prj_dfu.conf -DCONFIG_CHIP_LIB_SHELL=y - - - 3.Flash - west flash --erase - - 4.OTA Image needs to build on the docker environment as like in the first step inside the all-clusters-app folder. Refer the below link to build the OTA image with new version. - - https://github.com/project-chip/connectedhomeip/tree/master/examples/ota-requestor-app/linux#ota-requestor-app-linux - - To build the ota image with new version for nRF, use the following command inside the all-clusters-app folder , which will build matter.ota - - west build -b nrf52840dk_nrf52840 -d build2 -- -DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 -DCONF_FILE=prj_dfu.conf -DCONFIG_CHIP_LIB_SHELL=y - disabled: true - - - label: "Precondition" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 1: TH reads the StartUpMode attribute from the DUT" PICS: MOD.S.A0004 - verification: | - ./chip-tool modeselect read start-up-mode 1 1 - - on TH(chip-tool) log verify for StartUpMode. Record this value for usage in step 2b and below is the sample log provided for the raspi platform: - - [1645778279.693082][4898:4903] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003DataVersion: 3781469722 - [1645778279.693151][4898:4903] CHIP:TOO: StartUpMode: 0 - disabled: true + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: StartUpModeValue + constraints: + type: int8u - label: "Step 2a: TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - on TH(chip-tool) log verify for CurrentMode. Record this value for usage in step 2b and 3 and below is the sample log provided for the raspi platform: - - [1645778146.171510][4876:4881] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0000DataVersion: 3781469721 - [1645778146.171602][4876:4881] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: CurrentModeValue + constraints: + type: int8u - label: "Step 2b: If the StartUpMode and CurrentMode attributes have the same - value, proceed to step 2c, Otherwise proceed to step 3a." + value, proceed to step 2c, Otherwise proceed to step 3a" PICS: MOD.S.A0003 && MOD.S.A0004 - verification: | - NOTE: - If the StartUpMode and CurrentMode attributes have the same value, proceed to step 2c, Otherwise proceed to step 3a. - disabled: true + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: StartUpModeValue + - name: "Value2" + value: CurrentModeValue + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue - label: "Step 2c: TH reads the SupportedModes attribute from the DUT" + runIf: IsExpectedValue PICS: MOD.S.A0002 - verification: | - ./chip-tool modeselect read supported-modes 1 1 - - on TH(chip-tool) log verify for SupportedModes. Record the mode for usage in step 2b and below is the sample log provided for the raspi platform: - - [1654595268.854568][14400:14405] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0002 DataVersion: 366231602 - [1654595268.854678][14400:14405] CHIP:TOO: SupportedModes: 3 entries - [1654595268.854743][14400:14405] CHIP:TOO: [1]: { - [1654595268.854772][14400:14405] CHIP:TOO: Label: Black - [1654595268.854811][14400:14405] CHIP:TOO: Mode: 0 - [1654595268.854843][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.854891][14400:14405] CHIP:TOO: [1]: { - [1654595268.854918][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.854945][14400:14405] CHIP:TOO: Value: 0 - [1654595268.854971][14400:14405] CHIP:TOO: } - [1654595268.855000][14400:14405] CHIP:TOO: } - [1654595268.855038][14400:14405] CHIP:TOO: [2]: { - [1654595268.855064][14400:14405] CHIP:TOO: Label: Cappuccino - [1654595268.855089][14400:14405] CHIP:TOO: Mode: 4 - [1654595268.855117][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855149][14400:14405] CHIP:TOO: [1]: { - [1654595268.855175][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855199][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855223][14400:14405] CHIP:TOO: } - [1654595268.855249][14400:14405] CHIP:TOO: } - [1654595268.855284][14400:14405] CHIP:TOO: [3]: { - [1654595268.855310][14400:14405] CHIP:TOO: Label: Espresso - [1654595268.855332][14400:14405] CHIP:TOO: Mode: 7 - [1654595268.855360][14400:14405] CHIP:TOO: SemanticTags: 1 entries - [1654595268.855390][14400:14405] CHIP:TOO: [1]: { - [1654595268.855416][14400:14405] CHIP:TOO: MfgCode: 0 - [1654595268.855440][14400:14405] CHIP:TOO: Value: 0 - [1654595268.855464][14400:14405] CHIP:TOO: } - [1654595268.855490][14400:14405] CHIP:TOO: } - [1649677252.376226][10804:10809] CHIP:TOO: SemanticTag: 0 - [1649677252.376252][10804:10809] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list - label: "Step 2d: Select a value from the list in step 2c with a different value than the StartUpMode value read in step 1. TH sends a - ChangeToMode command to the DUT with the selected value." + ChangeToMode command to the DUT with the selected value" + runIf: IsExpectedValue PICS: MOD.S.A0002 && MOD.S.C00.Rsp - verification: | - ./chip-tool modeselect change-to-mode 4 1 1 - - on TH(chip-tool) log verify that status has a value 0x00 (success) and below is the sample log provided for the raspi platform: - - [1645778189.045030][4888:4893] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0050 Command=0x0000_0000 Status=0x0 - disabled: true + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: NewMode - label: "Step 3a: Perform an OTA update on the device that requires a reboot. Allow for the DUT to update and fully reboot." verification: | - To perform an OTA update on Thread device follow the cmmds below: - - Step-1 :Run the below command in the path, Where we built the OTA provider app . (In this example , the path is connectedhomeip/out/debug ./chip-ota-provider-app -f ) - - ./chip-ota-provider-app -f ~/chip_repos/connectedhomeip/examples/all-clusters-app/nrfconnect/build2/zephyr/matter.ota - - Execute the command using chip-tool and verify the response as below. - - Step-2: ./chip-tool pairing onnetwork 2 20202021 - - [1659104612.593187][62366:62371] CHIP:CTL: Successfully finished commissioning step 'ReadCommissioningInfo' - - Step-3 : ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": [{"cluster": 41, "endpoint": null, "deviceType": null}]}]' 2 0 - - [1651101661960] [90832:7598169] CHIP: [DMG] status = 0x00 (SUCCESS), - - - Step-4: ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 2, "endpoint": 0}]' 1 0 - - Step-5: ./chip-tool otasoftwareupdaterequestor announce-otaprovider 2 0 0 0 1 0 - - Make sure the OTA update is succesful. Refer OTA testcases for the command & its output. . - disabled: true + Perform an OTA update on the device that requires a reboot. Allow for the DUT to update and fully reboot.. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Commission device after reboot" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 3b: TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - After the OTA-update on TH(chip-tool) log verify that CurrentMode is same as value recorded in step 2d and below is the sample log provided for the raspi platform: - - [1645778146.171510][4876:4881] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0000DataVersion: 3781469721 - [1645778146.171602][4876:4881] CHIP:TOO: CurrentMode: 4 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + constraints: + anyOf: [NewMode, CurrentModeValue] diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml old mode 100644 new mode 100755 index 93049009e12ca1..887f9fb4ed4cbd --- a/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,9 +11,8 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 80.5.3. [TC-MOD-3.4] OnMode Overwriting StartUpMode with DUT as Server +name: 80.3.4. [TC-MOD-3.4] OnMode Overwriting StartUpMode (DUT as Server) PICS: - MOD.S.A0004 @@ -22,202 +21,113 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Mode Select" + endpoint: 1 + #Configure newmode value + Step2dOnModeValue: + type: int8u + defaultValue: 4 tests: - - label: "Note" - verification: | - To Execute the TC-MOD-3.4 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps - - - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. - - To execute this test case set onmode to any integer value because as default it value has null. - - ./chip-tool modeselect write on-mode 4 1 1 - disabled: true - - - label: "Preconditions" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true - - - label: "Step 1: TH reads the StartUpMode attribute from the DUT" + - label: "Step 0: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 1: TH reads from the DUT the StartUpMode attribute." PICS: MOD.S.A0004 - verification: | - ./chip-tool modeselect read start-up-mode 1 1 - - On TH(chip-tool) log, Verify DUT response is an integer. - - Record this value for usage in step 2, below is the sample log provided for the raspi platform: + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut - [1651099663211] [82177:7560652] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0004 DataVersion: 2609052118 - [1651099663212] [82177:7560652] CHIP: [TOO] StartUpMode: 0 - disabled: true - - - label: "Step 2a: TH reads the OnMode attribute from the DUT" + - label: "Step 2a: TH reads from the DUT the OnMode attribute." PICS: MOD.S.A0005 - verification: | - ./chip-tool modeselect read on-mode 1 1 - - On TH(chip-tool) log, Verify OnMode attribute value is an integer different from StartUpMode - Save the value for usage in step 2b and below is the sample log provided for the raspi platform: - - Note : If startup_mode_dut is equal to old_on_mode_dut proceed to step 4. Else proceed to step 6. - - [1654780979.979743][61542:61547] CHIP:DMG: } - [1654780979.980040][61542:61547] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0005 DataVersion: 235764160 - [1654780979.980202][61542:61547] CHIP:TOO: OnMode: 4 - disabled: true + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut - label: "Step 2b: If the StartUpMode and OnMode attributes have the same value, proceed to step 2c, Otherwise proceed to step 3." PICS: MOD.S.A0004 && MOD.S.A0005 - verification: | - If the StartUpMode and OnMode attributes have the same value, proceed to step 2c, Otherwise proceed to step 3. - disabled: true + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: on_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue - label: "Step 2c: TH reads the SupportedModes attribute from the DUT" + runIf: IsExpectedValue PICS: MOD.S.A0002 - verification: | - ./chip-tool modeselect read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of supported modes - Save the Mode values for usage in step 2d, below is the sample log provided for the raspi platform: - - [1685020074.437287][16950:16952] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0002 DataVersion: 3898153349 - [1685020074.437313][16950:16952] CHIP:TOO: SupportedModes: 3 entries - [1685020074.437620][16950:16952] CHIP:TOO: [1]: { - [1685020074.437632][16950:16952] CHIP:TOO: Label: Black - [1685020074.437635][16950:16952] CHIP:TOO: Mode: 0 - [1685020074.437823][16950:16952] CHIP:TOO: SemanticTags: 1 entries - [1685020074.437834][16950:16952] CHIP:TOO: [1]: { - [1685020074.437838][16950:16952] CHIP:TOO: MfgCode: 0 - [1685020074.437841][16950:16952] CHIP:TOO: Value: 0 - [1685020074.437843][16950:16952] CHIP:TOO: } - [1685020074.437846][16950:16952] CHIP:TOO: } - [1685020074.437852][16950:16952] CHIP:TOO: [2]: { - [1685020074.437854][16950:16952] CHIP:TOO: Label: Cappuccino - [1685020074.437857][16950:16952] CHIP:TOO: Mode: 4 - [1685020074.437861][16950:16952] CHIP:TOO: SemanticTags: 1 entries - [1685020074.437865][16950:16952] CHIP:TOO: [1]: { - [1685020074.437868][16950:16952] CHIP:TOO: MfgCode: 0 - [1685020074.437870][16950:16952] CHIP:TOO: Value: 0 - [1685020074.437873][16950:16952] CHIP:TOO: } - [1685020074.437876][16950:16952] CHIP:TOO: } - [1685020074.437881][16950:16952] CHIP:TOO: [3]: { - [1685020074.437883][16950:16952] CHIP:TOO: Label: Espresso - [1685020074.437885][16950:16952] CHIP:TOO: Mode: 7 - [1685020074.437889][16950:16952] CHIP:TOO: SemanticTags: 1 entries - [1685020074.437892][16950:16952] CHIP:TOO: [1]: { - [1685020074.437895][16950:16952] CHIP:TOO: MfgCode: 0 - [1685020074.437897][16950:16952] CHIP:TOO: Value: 0 - [1685020074.437900][16950:16952] CHIP:TOO: } - [1685020074.437902][16950:16952] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list - label: "Step 2d: Select a value from the list in step 2c with a different value than the StartUpMode value read in step 1. TH sends a write command for OnMode to the DUT with the selected value." PICS: MOD.S.A0002 && MOD.S.C00.Rsp - verification: | - ./chip-tool modeselect write on-mode 7 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1651099941884] [84269:7567211] CHIP: [DMG] WriteResponseMessage = - [1651099941884] [84269:7567211] CHIP: [DMG] { - [1651099941884] [84269:7567211] CHIP: [DMG] AttributeStatusIBs = - [1651099941884] [84269:7567211] CHIP: [DMG] [ - [1651099941884] [84269:7567211] CHIP: [DMG] AttributeStatusIB = - [1651099941884] [84269:7567211] CHIP: [DMG] { - [1651099941887] [84269:7567211] CHIP: [DMG] AttributePathIB = - [1651099941887] [84269:7567211] CHIP: [DMG] { - [1651099941887] [84269:7567211] CHIP: [DMG] Endpoint = 0x1, - [1651099941887] [84269:7567211] CHIP: [DMG] Cluster = 0x50, - [1651099941887] [84269:7567211] CHIP: [DMG] Attribute = 0x0000_0005, - [1651099941887] [84269:7567211] CHIP: [DMG] } - [1651099941887] [84269:7567211] CHIP: [DMG] - [1651099941887] [84269:7567211] CHIP: [DMG] StatusIB = - [1651099941887] [84269:7567211] CHIP: [DMG] { - [1651099941887] [84269:7567211] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651099941887] [84269:7567211] CHIP: [DMG] }, - [1651099941887] [84269:7567211] CHIP: [DMG] - [1651099941887] [84269:7567211] CHIP: [DMG] }, - [1651099941887] [84269:7567211] CHIP: [DMG] - [1651099941887] [84269:7567211] CHIP: [DMG] ], - [1651099941887] [84269:7567211] CHIP: [DMG] - [1651099941887] [84269:7567211] CHIP: [DMG] InteractionModelRevision = 1 - [1651099941887] [84269:7567211] CHIP: [DMG] } - disabled: true - - - label: "Step 3: TH reads the OnMode attribute from the DUT" - PICS: MOD.S.F00 && MOD.S.A0005 - verification: | - ./chip-tool modeselect read on-mode 1 1 - - On TH(chip-tool) log, Verify OnMode attribute value is an integer. - Save the value and below is the sample log provided for the raspi platform: - - [1669190858.739158][4187:4189] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0005 DataVersion: 4107771634 - [1669190858.739222][4187:4189] CHIP:TOO: OnMode: 7 - disabled: true + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: Step2dOnModeValue + + - label: "Step 3: TH reads from the DUT the OnMode attribute." + PICS: MOD.S.A0005 && MOD.S.F00 + command: "readAttribute" + attribute: "OnMode" + response: + value: Step2dOnModeValue - label: "Step 4: TH writes 1 to StartUpOnOff attribute of the OnOff Cluster of the DUT" PICS: OO.S.A4003 - verification: | - ./chip-tool onoff write start-up-on-off 1 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1651101661959] [90832:7598169] CHIP: [DMG] WriteResponseMessage = - [1651101661959] [90832:7598169] CHIP: [DMG] { - [1651101661959] [90832:7598169] CHIP: [DMG] AttributeStatusIBs = - [1651101661959] [90832:7598169] CHIP: [DMG] [ - [1651101661959] [90832:7598169] CHIP: [DMG] AttributeStatusIB = - [1651101661959] [90832:7598169] CHIP: [DMG] { - [1651101661960] [90832:7598169] CHIP: [DMG] AttributePathIB = - [1651101661960] [90832:7598169] CHIP: [DMG] { - [1651101661960] [90832:7598169] CHIP: [DMG] Endpoint = 0x1, - [1651101661960] [90832:7598169] CHIP: [DMG] Cluster = 0x6, - [1651101661960] [90832:7598169] CHIP: [DMG] Attribute = 0x0000_4003, - [1651101661960] [90832:7598169] CHIP: [DMG] } - [1651101661960] [90832:7598169] CHIP: [DMG] - [1651101661960] [90832:7598169] CHIP: [DMG] StatusIB = - [1651101661960] [90832:7598169] CHIP: [DMG] { - [1651101661960] [90832:7598169] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651101661960] [90832:7598169] CHIP: [DMG] }, - [1651101661960] [90832:7598169] CHIP: [DMG] - [1651101661960] [90832:7598169] CHIP: [DMG] }, - [1651101661960] [90832:7598169] CHIP: [DMG] - [1651101661960] [90832:7598169] CHIP: [DMG] ], - [1651101661960] [90832:7598169] CHIP: [DMG] - [1651101661960] [90832:7598169] CHIP: [DMG] InteractionModelRevision = 1 - [1651101661960] [90832:7598169] CHIP: [DMG] } - disabled: true + cluster: "On/Off" + command: "writeAttribute" + attribute: "StartUpOnOff" + arguments: + value: 1 - - label: "Step 5: Physically power cycle the device." + - label: "Step 5: Physically power cycle the device" verification: | Physically power cycle the device. - disabled: true - - - label: "Step 6: TH reads the CurrentMode attribute from the DUT" - PICS: MOD.S.A0003 - verification: | - ./chip-tool modeselect read current-mode 1 1 - - On TH(chip-tool), Verify CurrentMode attribute value is an integer and value is value recorded in step 3, below is the sample log provided for the raspi platform: - - [1669190936.869804][4194:4196] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0003 DataVersion: 3908583538 - [1669190936.869875][4194:4196] CHIP:TOO: CurrentMode: 7 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 6: TH reads from the DUT the CurrentMode attribute." + PICS: MOD.S.A0003 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "CurrentMode" + response: + value: Step2dOnModeValue diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml new file mode 100644 index 00000000000000..d8e3bb279c7402 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml @@ -0,0 +1,210 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 15.2.6. [TC-OPCREDS-3.7] Add Second Fabric over CASE [DUT-Server] + +PICS: + - OPCREDS.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: "Pre-Conditions" + verification: | + TH1 and TH2 are 2 clients that trust each other + disabled: true + + - label: + "Step 1: Factory Reset DUT (to ensure NOC list is empty at the + beginning of the following steps)" + PICS: OPCREDS.S.A0000 + verification: | + On both DUT and TH side, on Raspi we do factory reset with the below command. The DUT for cert should follow vendor specific procedure for factory reset + sudo rm -rf /tmp/chip_* + disabled: true + + - label: + "Step 2: Start the commissioning process of DUT by TH1 on the first + Fabric." + verification: | + On TH (chip-tool) side: + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + [1690193191.894851][13219:13221] CHIP:CTL: Received CommissioningComplete response, errorCode=0 + [1690193191.894879][13219:13221] CHIP:CTL: Successfully finished commissioning step 'SendComplete' + + + On DUT(all-clusters-app) side: + ./all-clusters-app + [1641381202.306840][4431:4431] CHIP:DL: NVS set: chip-config/regulatory-location = 0 (0x0) + disabled: true + + - label: + "Step 3: TH1 does a non-fabric-filtered read of the Fabrics attribute + from the Node Operational Credentials cluster. Save the FabricIndex + for TH1 as TH1_Fabric_Index for future use." + PICS: OPCREDS.S.A0001 + verification: | + ./chip-tool operationalcredentials read fabrics 1 0 + + Verify on the Th(chip-tool) that fabrics has only 1 entry and save the fabric index as TH1_Fabric_Index for using in the following steps + + + [1690193331.552693][13227:13229] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0001 DataVersion: 632277469 + [1690193331.552824][13227:13229] CHIP:TOO: Fabrics: 1 entries + [1690193331.552910][13227:13229] CHIP:TOO: [1]: { + [1690193331.552945][13227:13229] CHIP:TOO: RootPublicKey: 04AD3DD61741C7F8BB56C922BCAADF1A44BD7AB7A00BB3D3D9CDB6C5889C841AA59C62C5A504CA2DE33BFE0626B6E570DC1716ECA769295C0D6BBB0FA5B3A5E69C + [1690193331.552972][13227:13229] CHIP:TOO: VendorID: 65521 + [1690193331.552997][13227:13229] CHIP:TOO: FabricID: 1 + [1690193331.553020][13227:13229] CHIP:TOO: NodeID: 1 + [1690193331.553044][13227:13229] CHIP:TOO: Label: + [1690193331.553066][13227:13229] CHIP:TOO: FabricIndex: 1 + [1690193331.553088][13227:13229] CHIP:TOO: } + [1690193331.553268][13227:13229] CHIP:EM: <<< [E:60956i S:18401 M:33374407 (Ack:23211476)] (S) Msg TX to 1:0000000000000001 [C23D] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: + "Step 4: TH1 sends ArmFailSafe command to the DUT with the + ExpiryLengthSeconds field set to 60 seconds" + PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx + verification: | + ./chip-tool generalcommissioning arm-fail-safe 60 0 1 0 + + Verify on the Th(chip-tool) that DUT sends ArmFailSafeResponse command to TH1 with field ErrorCode as OK(0) + + [1690226811353] [19885:5418547] [DMG] Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 + [1690226811354] [19885:5418547] [TOO] Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0001 + [1690226811354] [19885:5418547] [TOO] ArmFailSafeResponse: { + [1690226811354] [19885:5418547] [TOO] errorCode: 0 + [1690226811354] [19885:5418547] [TOO] debugText: + [1690226811354] [19885:5418547] [TOO] } + disabled: true + + - label: "Step 5: TH1 Sends CSRRequest command with a random 32-byte nonce" + PICS: OPCREDS.S.C04.Rsp + verification: | + To get CSR Nonce give below command + echo hex:$(hexdump -vn32 -e'4/4 "%08X" ' /dev/urandom) + + ./chip-tool operationalcredentials csrrequest 1 0 + + ./chip-tool operationalcredentials csrrequest hex:A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F359902982717603 1 0 + + Verify the CSRResponse in TH Log + + [1658223679.580697][6136:6141] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0005 + [1658223679.580761][6136:6141] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0005 + [1658223679.580823][6136:6141] CHIP:TOO: CSRResponse: { + [1658223679.580875][6136:6141] CHIP:TOO: NOCSRElements: 153001CB3081C83070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200047DA16C714034D3B96716F64DC0E742D007233212025E305AF6CE56DFA057718E149E52B39584456C8F954A1596B64F8BBC02E501276B962D4AB2C0A607D983C9A000300A06082A8648CE3D040302034800304502206FB78A61A7B0F021C396FEC1CCD6802129AC3EE5EA2727ABCCB19DBAEA7DEE1A022100A5C81ADC5D8BFAA5DB84A1261D8BBCEA5C26B24D4405F0B978E19B17D8458C9E300220A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F35990298271760318 + [1658223679.580915][6136:6141] CHIP:TOO: attestationSignature: EB731B40B20501AF32C468AA522948F7848D3AEDFA24D9A879575B4A265886C97109EE0DE1ECEB969B1A7F98F127DB4C275292B986BF8DA56EF7B16DA8EC8ABE + [1658223679.580943][6136:6141] CHIP:TOO: } + disabled: true + + - label: + "Step 6: TH1 validates the Device Attestation Signature + (attestation_signature) field from CSRResponse command in Step 5" + PICS: OPCREDS.S.C04.Rsp + verification: | + To get CSR Nonce give below command + echo hex:$(hexdump -vn32 -e'4/4 "%08X" ' /dev/urandom) + + ./chip-tool operationalcredentials csrrequest 1 0 + + ./chip-tool operationalcredentials csrrequest hex:A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F359902982717603 1 0 + + Verify the CSRResponse in TH Log + + [1658223679.580697][6136:6141] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0005 + [1658223679.580761][6136:6141] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0005 + [1658223679.580823][6136:6141] CHIP:TOO: CSRResponse: { + [1658223679.580875][6136:6141] CHIP:TOO: NOCSRElements: 153001CB3081C83070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200047DA16C714034D3B96716F64DC0E742D007233212025E305AF6CE56DFA057718E149E52B39584456C8F954A1596B64F8BBC02E501276B962D4AB2C0A607D983C9A000300A06082A8648CE3D040302034800304502206FB78A61A7B0F021C396FEC1CCD6802129AC3EE5EA2727ABCCB19DBAEA7DEE1A022100A5C81ADC5D8BFAA5DB84A1261D8BBCEA5C26B24D4405F0B978E19B17D8458C9E300220A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F35990298271760318 + [1658223679.580915][6136:6141] CHIP:TOO: attestationSignature: EB731B40B20501AF32C468AA522948F7848D3AEDFA24D9A879575B4A265886C97109EE0DE1ECEB969B1A7F98F127DB4C275292B986BF8DA56EF7B16DA8EC8ABE + [1658223679.580943][6136:6141] CHIP:TOO: } + disabled: true + + - label: + "Step 7: TH2 generates the NOC, the Root CA Certificate and ICAC using + the CSR elements from Step 5 and selects an IPK, all for use by TH2. + The certificates shall have their subjects padded with additional data + such that they are each the maximum certificate size of 400 bytes when + encoded in the MatterCertificateEncoding. Save RCAC as + Root_CA_Certificate_TH2 Save ICAC as Intermediate_Certificate_TH2 Save + NOC as Node_Operational_Certificate_TH2 Save IPK as IPK_TH2 Extract + the RCAC public key and save as Root_Public_Key_TH2" + verification: | + + disabled: true + + - label: + "Step 8: TH1 sends AddTrustedRootCertificate command to DUT with + RootCACertificate set to Root_CA_Certificate_TH2" + PICS: OPCREDS.S.C0b.Rsp + verification: | + Verify that AddTrustedRootCertificate command succeeds by sending the status code as SUCCESS + disabled: true + + - label: + "Step 9: TH1 sends the AddNOC command to DUT with the following + fields: NOCValue as Node_Operational_Certificate_TH2 ICACValue as + Intermediate_Certificate_TH2 IpkValue as IPK_TH2 CaseAdminSubject as + the NodeID of TH2 AdminVendorId as the Vendor ID of TH2" + PICS: OPCREDS.S.C06.Rsp && OPCREDS.S.C08.Tx + verification: | + Verify that DUT responds with NOCResponse with status code OK + disabled: true + + - label: "Step 10: TH2 starts discovery of DUT using Operational Discovery" + verification: | + + disabled: true + + - label: + "Step 11: TH2 opens a CASE session with DUT over operational network" + verification: | + DUT is able to open the CASE session with TH2 + disabled: true + + - label: "Step 12: TH2 sends CommissioningComplete command" + PICS: CGEN.S.C05.Tx + verification: | + DUT respond with SUCCESS at CommissioningComplete command sent by TH2 + disabled: true + + - label: + "Step 13: TH1 does a non-fabric-filtered read of the Fabrics attribute + from the Node Operational Credentials cluster. Save the FabricIndex + for TH2s entry as TH2_Fabric_Index for future use." + PICS: OPCREDS.S.A0001 + verification: | + Verify that there are 2 entries in the list where one entry matches TH1_Fabric_Index and the other matches TH2_Fabric_Index. + disabled: true + + - label: + "Step 14: TH2 does a non-fabric-filtered read of the Fabrics attribute + from the Node Operational Credentials cluster" + PICS: OPCREDS.S.A0001 + verification: | + Verify that there are 2 entries in the list where one entry matches TH1_Fabric_Index and the other matches TH2_Fabric_Index. + disabled: true + + - label: + "Step 15: TH1 sends RemoveFabric command to DUT with the FabricIndex + field set to TH2_Fabric_Index." + PICS: OPCREDS.S.C0a.Rsp + verification: | + Verify that DUT sends NOCResponse command with status code OK + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_4.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_4.yaml index 7e225c5f789109..f8d07da34446a9 100644 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_4.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 202.2.4. [TC-OPSTATE-2.4] Mandatory Events with DUT as Server @@ -20,38 +19,76 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Operational State" + endpoint: 1 tests: - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: Set up a subscription to the OperationalError event" PICS: OPSTATE.S.E00 - verification: | - ./chip-tool operationalstate subscribe operational-error 5 15 1 1 - disabled: true + command: "subscribeEvent" + event: "OperationalError" + minInterval: 10 + maxInterval: 5000 - label: "Step 3: At the DUT take the vendor defined action to generate an OperationalError event" - PICS: OPSTATE.S.E00 + PICS: OPSTATE.S.E00 && PICS_SKIP_SAMPLE_APP verification: | After the subscription interval via the TH (chip-tool) verify: - reception of an OperationalError Event - ErrorStateID is a defined error - If the ErrorStateID is manufacturer specific, inclusion of an ErrorStateLabel, not present otherwise - Optionally an ErrorStateDetails - disabled: true - - label: "Step 4: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 - verification: | - ./chip-tool operationalstate read operational-state 1 1 + NOTE : There's a PIXIT value controlling the ability to execute that ({PIXIT_ERROREVENTGEN}), which as the test case notes, requires vendor specific actions to generated the error at the DUT. This is dependent on the vendor app supporting this. The SDK as it stands won't provide the error, this may be testable by some of the vendors depending on their implementations. + - Via the TH (chip-tool), verify: - - the response has an OperationalStateID field that is set to 0x03 (Error) - disabled: true + [1692859386.707176][6658:6660] CHIP:EM: Rxd Ack; Removing MessageCounter:212756536 from Retrans Table on exchange 36888i + [1692859386.707295][6658:6660] CHIP:DMG: ReportDataMessage = + [1692859386.707360][6658:6660] CHIP:DMG: { + [1692859386.707416][6658:6660] CHIP:DMG: SubscriptionId = 0x97bb846c, + [1692859386.707477][6658:6660] CHIP:DMG: InteractionModelRevision = 10 + [1692859386.707533][6658:6660] CHIP:DMG: } + [1692859386.707621][6658:6660] CHIP:DMG: MoveToState ReadClient[0xffff80011a90]: Moving to [AwaitingSu] + [1692859386.707815][6658:6660] CHIP:EM: <<< [E:36888i S:54523 M:212756537 (Ack:12760634)] (S) Msg TX to 1:0000000000000001 [853D] --- Type 0001:01 (IM:StatusResponse) + [1692859386.707901][6658:6660] CHIP:IN: (S) Sending msg 212756537 on secure session with LSID: 54523 + [1692859386.708167][6658:6660] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692859386.708237][6658:6660] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1692859386.749217][6658:6660] CHIP:EM: >>> [E:36888i S:54523 M:12760635 (Ack:212756537)] (S) Msg RX from 1:0000000000000001 [853D] --- Type 0001:04 (IM:SubscribeResponse) + [1692859386.749285][6658:6660] CHIP:EM: Found matching exchange: 36888i, Delegate: 0xffff80011aa0 + [1692859386.749350][6658:6660] CHIP:EM: Rxd Ack; Removing MessageCounter:212756537 from Retrans Table on exchange 36888i + [1692859386.749417][6658:6660] CHIP:DMG: SubscribeResponse is received + [1692859386.749489][6658:6660] CHIP:DMG: SubscribeResponseMessage = + [1692859386.749538][6658:6660] CHIP:DMG: { + [1692859386.749584][6658:6660] CHIP:DMG: SubscriptionId = 0x97bb846c, + [1692859386.749637][6658:6660] CHIP:DMG: MaxInterval = 0x6, + [1692859386.749687][6658:6660] CHIP:DMG: InteractionModelRevision = 10 + [1692859386.749734][6658:6660] CHIP:DMG: } + [1692859386.749787][6658:6660] CHIP:DMG: Subscription established with SubscriptionID = 0x97bb846c MinInterval = 5s MaxInterval = 6s Peer = 01:0000000000000001 + [1692859386.749843][6658:6660] CHIP:DMG: MoveToState ReadClient[0xffff80011a90]: Moving to [Subscripti] + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 4: TH reads from the DUT the OperationalState attribute" + PICS: OPSTATE.S.A0004 && PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "OperationalState" + response: + value: 0x03 + constraints: + type: enum8 diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml index a13b45da41082a..1ba5da15f59745 100644 --- a/src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 223.1.1. [TC-REFALM-1.1] Global attributes with DUT as Server @@ -20,46 +19,91 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator Alarm" + endpoint: 1 tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)" - verification: | - - disabled: true + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - verification: | - ./chip-tool refrigeratoralarm read cluster-revision 1 1 - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 1 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: - - [1688447208.697823][4176:4178] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFFD DataVersion: 1386394810 - [1688447208.701428][4176:4178] CHIP:TOO: ClusterRevision: 1 - [1688447208.701860][4176:4178] CHIP:EM: <<< [E:62008i S:18101 M:251225540 (Ack:117573954)] (S) Msg TX to 1:0000000000000001 [5AF3] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - label: "Step 3: TH reads from the DUT the FeatureMap attribute" - verification: | - ./chip-tool refrigeratoralarm read feature-map 1 1 - On TH(chip-tool), verify that DUT responds the Featuremap value as 0 and below is the sample log provided for the raspi platform: - - [1689677380.469073][18361:18363] CHIP:DMG: InteractionModelRevision = 1 - [1689677380.469079][18361:18363] CHIP:DMG: } - [1689677380.469148][18361:18363] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFFC DataVersion: 1517282962 - [1689677380.469174][18361:18363] CHIP:TOO: FeatureMap: 0 - [1689677380.469235][18361:18363] CHIP:EM: <<< [E:58398i S:27283 M:10886148 (Ack:14508298)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689677380.469247][18361:18363] CHIP:IN: (S) Sending msg 10886148 on secure session with LSID: 27283 - [1689677380.469272][18361:18363] CHIP:EM: Flushed pending ack for MessageCounter:14508298 on exchange 58398i - disabled: true - - - label: "Step 4: TH reads from the DUT the AttributeList attribute" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: + [ + 0x0000, + 0x0002, + 0x0003, + 0xfff8, + 0xfff9, + 0xfffa, + 0xfffb, + 0xfffc, + 0xfffd, + ] + excludes: [0x0001] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute" + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: + [ + 0x0000, + 0x0002, + 0x0003, + 0xfff8, + 0xfff9, + 0xfffb, + 0xfffc, + 0xfffd, + ] + excludes: [0x0001] + + - label: + "Step 4b: TH reads AttributeList attribute from DUT 1.The list SHALL + NOT contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - + 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the + allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool refrigeratoralarm read attribute-list 1 1 + Verify " AttributeList " value consists the list of mandatory attributes (0, 2, 3, 65533, 65532, 65531, 65529, 65528)on the TH(Chip-tool) Log: - Below is the sample log provided for the raspi platform: + [1689677267.384744][18335:18337] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFFB DataVersion: 1517282962 [1689677267.384781][18335:18337] CHIP:TOO: AttributeList: 9 entries [1689677267.384792][18335:18337] CHIP:TOO: [1]: 0 @@ -73,37 +117,122 @@ tests: [1689677267.384853][18335:18337] CHIP:TOO: [9]: 65533 [1689677267.384918][18335:18337] CHIP:EM: <<< [E:37908i S:49245 M:71138788 (Ack:86010986)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) [1689677267.384931][18335:18337] CHIP:IN: (S) Sending msg 71138788 on secure session with LSID: 49245 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 5a: TH reads from the DUT the EventList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list - - label: "Step 5: TH reads from the DUT the EventList attribute." + - label: + "Step 5b: TH reads EventList attribute from DUT. 1.The list SHALL NOT + contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the + Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignored. 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where + XXXX is the allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool refrigeratoralarm read event-list 1 1 + Verify " EventList attribute " consists the list may contain optional events(1) on the TH(Chip-tool) Log: - Below is the sample log provided for the raspi platform: + [1689677416.105596][18367:18369] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFFA DataVersion: 1517282962 [1689677416.105625][18367:18369] CHIP:TOO: EventList: 1 entries [1689677416.105635][18367:18369] CHIP:TOO: [1]: 0 [1689677416.105696][18367:18369] CHIP:EM: <<< [E:51484i S:36714 M:192916227 (Ack:1705890)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) [1689677416.105710][18367:18369] CHIP:IN: (S) Sending msg 192916227 on secure session with LSID: 36714 [1689677416.105737][18367:18369] CHIP:EM: Flushed pending ack for MessageCounter:1705890 on exchange 51484i - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute." + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." + - label: + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1. The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and + (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range + (0x0001 - 0xFFF1)" verification: | ./chip-tool refrigeratoralarm read accepted-command-list 1 1 - Verify " AcceptedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + + Verify Successfully " AcceptedCommandList attribute " on the TH1(Chip-tool) Log: [1688447421.513437][4196:4198] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFF9 DataVersion: 1386394810 [1688447421.513582][4196:4198] CHIP:TOO: AcceptedCommandList: 0 entries [1688447421.513880][4196:4198] CHIP:EM: <<< [E:43358i S:53509 M:77611862 (Ack:72266902)] (S) Msg TX to 1:0000000000000001 [5AF3] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 7a: TH reads from the DUT the AcceptedCommandList attribute." + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." + - label: + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and + (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range + (0x0001 - 0xFFF1)" verification: | ./chip-tool refrigeratoralarm read generated-command-list 1 1 - Verify " GeneratedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + + Verify Successfully" GeneratedCommandList attribute " on the TH1(Chip-tool) Log: [1688447564.178537][4220:4222] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFF8 DataVersion: 1795162772 [1688447564.178684][4220:4222] CHIP:TOO: GeneratedCommandList: 0 entries [1688447564.178984][4220:4222] CHIP:EM: <<< [E:5540i S:25125 M:256711779 (Ack:197472718)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml index b2944016faeebc..986c7c4100325c 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml @@ -126,9 +126,10 @@ tests: ./chip-tool rvccleanmode read attribute-list 1 1 Verify the "AttributeList " should include the mandatory attributes (values 0, 1), - - global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and - - list may include optional attribute(value 0x0002), if MOD.S.A0002(StartUpMode) supports, - - list contains feature dependent attribute (values 0x0003), if MOD.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + - Global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and + - List may include optional attribute(value 0x0002), if RVCCLEANM.S.A0002(StartUpMode) + supports, + - List contains feature dependent attribute (values 0x0003), if RVCCLEANM.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1690182240.730688][14970:14972] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_FFFB DataVersion: 3145953005 [1690182240.730708][14970:14972] CHIP:TOO: AttributeList: 10 entries @@ -252,7 +253,7 @@ tests: verification: | ./chip-tool rvccleanmode read generated-command-list 1 1 - Verify "GeneratedCommandList" contains a list of mandatory commands (value 1) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + Verify " GeneratedCommandList" contains a list of mandatory commands (value 1) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1690182346.463002][14993:14995] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_FFF8 DataVersion: 3145953005 [1690182346.463028][14993:14995] CHIP:TOO: GeneratedCommandList: 1 entries diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml new file mode 100644 index 00000000000000..bde5980061e3e5 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml @@ -0,0 +1,115 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 92.2.1. [TC-RVCCLEANM-1.2] Cluster attributes with DUT as Server + +PICS: + - RVCCLEANM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: "Preconditions" + verification: | + This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command + disabled: true + + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + verification: | + + disabled: true + + - label: "Step 2: TH reads from the DUT the SupportedModes attribute." + PICS: RVCCLEANM.S.A0000 + verification: | + ./chip-tool rvccleanmode read supported-modes 1 1 + + Verify that the DUT response contains list of ModeOptionsStruct entries. + - Verify that the list has at least 2 and at most 255 entries + - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value + - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined derived cluster tag value (DeepClean(0x4000), Vacuum(0x4001), Mop(0x4002)) or in the MfgTags (0x8000 to 0xBFFF) range. + - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 + - Verify that at least one ModeOptionsStruct entry includes either the Vacuum(0x4001) mode tag or the Mop(0x4002)mode tag in the ModeTags field + - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + + [1690182376.583260][14996:14998] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0000 DataVersion: 3145953005 + [1690182376.583288][14996:14998] CHIP:TOO: SupportedModes: 3 entries + [1690182376.583301][14996:14998] CHIP:TOO: [1]: { + [1690182376.583304][14996:14998] CHIP:TOO: Label: Vacuum + [1690182376.583307][14996:14998] CHIP:TOO: Mode: 0 + [1690182376.583311][14996:14998] CHIP:TOO: ModeTags: 1 entries + [1690182376.583316][14996:14998] CHIP:TOO: [1]: { + [1690182376.583319][14996:14998] CHIP:TOO: Value: 16385 + [1690182376.583322][14996:14998] CHIP:TOO: } + [1690182376.583325][14996:14998] CHIP:TOO: } + [1690182376.583331][14996:14998] CHIP:TOO: [2]: { + [1690182376.583333][14996:14998] CHIP:TOO: Label: Wash + [1690182376.583336][14996:14998] CHIP:TOO: Mode: 1 + [1690182376.583340][14996:14998] CHIP:TOO: ModeTags: 1 entries + [1690182376.583344][14996:14998] CHIP:TOO: [1]: { + [1690182376.583347][14996:14998] CHIP:TOO: Value: 16386 + [1690182376.583349][14996:14998] CHIP:TOO: } + [1690182376.583352][14996:14998] CHIP:TOO: } + [1690182376.583357][14996:14998] CHIP:TOO: [3]: { + [1690182376.583360][14996:14998] CHIP:TOO: Label: Deep clean + [1690182376.583362][14996:14998] CHIP:TOO: Mode: 2 + [1690182376.583366][14996:14998] CHIP:TOO: ModeTags: 2 entries + [1690182376.583369][14996:14998] CHIP:TOO: [1]: { + [1690182376.583372][14996:14998] CHIP:TOO: Value: 7 + [1690182376.583375][14996:14998] CHIP:TOO: } + [1690182376.583378][14996:14998] CHIP:TOO: [2]: { + [1690182376.583380][14996:14998] CHIP:TOO: Value: 16384 + [1690182376.583383][14996:14998] CHIP:TOO: } + [1690182376.583385][14996:14998] CHIP:TOO: } + disabled: true + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 + [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: "Step 4: TH reads from the DUT the OnMode attribute." + PICS: RVCCLEANM.S.A0003 + verification: | + ./chip-tool rvccleanmode read on-mode 1 1 + + Verify on TH(chip-tool) logs, OnMode attribute value is an integer from supported_modes_dut or Null, below is the sample log provided for the raspi platform, Here OnMode attribute value is Null + + [1690182436.721527][15012:15014] CHIP:DMG: } + [1690182436.721673][15012:15014] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0003 DataVersion: 3145953005 + [1690182436.721723][15012:15014] CHIP:TOO: OnMode: null + disabled: true + + - label: "Step 5: TH reads from the DUT the StartUpMode attribute." + PICS: RVCCLEANM.S.A0002 + verification: | + ./chip-tool rvccleanmode read start-up-mode 1 1 + + Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null + + [1690182475.587786][15022:15024] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0002 DataVersion: 3145953005 + [1690182475.587797][15022:15024] CHIP:TOO: StartUpMode: null + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml new file mode 100644 index 00000000000000..5f16be922706ba --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml @@ -0,0 +1,241 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 92.3.1. [TC-RVCCLEANM-2.1] Change to Mode functionality with DUT as Server + +PICS: + - RVCCLEANM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + verification: | + + disabled: true + + - label: "Step 2: TH reads from the DUT the SupportedModes attribute." + PICS: RVCCLEANM.S.A0000 + verification: | + ./chip-tool rvccleanmode read supported-modes 1 1 + + Verify that the DUT response contains list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + + [1690182376.583260][14996:14998] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0000 DataVersion: 3145953005 + [1690182376.583288][14996:14998] CHIP:TOO: SupportedModes: 3 entries + [1690182376.583301][14996:14998] CHIP:TOO: [1]: { + [1690182376.583304][14996:14998] CHIP:TOO: Label: Vacuum + [1690182376.583307][14996:14998] CHIP:TOO: Mode: 0 + [1690182376.583311][14996:14998] CHIP:TOO: ModeTags: 1 entries + [1690182376.583316][14996:14998] CHIP:TOO: [1]: { + [1690182376.583319][14996:14998] CHIP:TOO: Value: 16385 + [1690182376.583322][14996:14998] CHIP:TOO: } + [1690182376.583325][14996:14998] CHIP:TOO: } + [1690182376.583331][14996:14998] CHIP:TOO: [2]: { + [1690182376.583333][14996:14998] CHIP:TOO: Label: Wash + [1690182376.583336][14996:14998] CHIP:TOO: Mode: 1 + [1690182376.583340][14996:14998] CHIP:TOO: ModeTags: 1 entries + [1690182376.583344][14996:14998] CHIP:TOO: [1]: { + [1690182376.583347][14996:14998] CHIP:TOO: Value: 16386 + [1690182376.583349][14996:14998] CHIP:TOO: } + [1690182376.583352][14996:14998] CHIP:TOO: } + [1690182376.583357][14996:14998] CHIP:TOO: [3]: { + [1690182376.583360][14996:14998] CHIP:TOO: Label: Deep clean + [1690182376.583362][14996:14998] CHIP:TOO: Mode: 2 + [1690182376.583366][14996:14998] CHIP:TOO: ModeTags: 2 entries + [1690182376.583369][14996:14998] CHIP:TOO: [1]: { + [1690182376.583372][14996:14998] CHIP:TOO: Value: 7 + [1690182376.583375][14996:14998] CHIP:TOO: } + [1690182376.583378][14996:14998] CHIP:TOO: [2]: { + [1690182376.583380][14996:14998] CHIP:TOO: Value: 16384 + [1690182376.583383][14996:14998] CHIP:TOO: } + [1690182376.583385][14996:14998] CHIP:TOO: } + disabled: true + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, + - Save the value as old_current_mode_dut + - Select a value which is NOT in supported_modes_dut and save it as invalid_mode_th, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 + [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: + "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set + to old_current_mode_dut" + PICS: RVCCLEANM.S.C00.Rsp + verification: | + ./chip-tool rvccleanmode change-to-mode 0 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690182553.733326][15036:15038] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 + [1690182553.733341][15036:15038] CHIP:TOO: ChangeToModeResponse: { + [1690182553.733348][15036:15038] CHIP:TOO: status: 0 + [1690182553.733351][15036:15038] CHIP:TOO: } + disabled: true + + - label: + "Step 5: Manually put the device in a state from which it will FAIL to + transition to PIXIT.RVCCLEANM.MODE_CHANGE_FAIL" + PICS: RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE + verification: | + Manual operation required + disabled: true + + - label: "Step 6: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, + - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 + [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.RVCCLEANM.MODE_CHANGE_FAIL" + PICS: RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE && RVCCLEANM.S.C00.Rsp + verification: | + First change the mode to cleaning after that try to change the mode to any other modes (Deep clean, Wash ) + + ./chip-tool rvcrunmode change-to-mode 1 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690262143.410054][28190:28192] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 + [1690262143.410070][28190:28192] CHIP:TOO: ChangeToModeResponse: { + [1690262143.410076][28190:28192] CHIP:TOO: status: 0 + [1690262143.410079][28190:28192] CHIP:TOO: } + + ./chip-tool rvccleanmode change-to-mode 2 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a CleaningInProgress(0X40) status response and StatusText field has a length between 1 to 64, below is the sample log provided for the raspi platform: + + [1690262155.519185][28202:28204] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 + [1690262155.519202][28202:28204] CHIP:TOO: ChangeToModeResponse: { + [1690262155.519206][28202:28204] CHIP:TOO: status: 64 + [1690262155.519210][28202:28204] CHIP:TOO: statusText: Cannot change the cleaning mode during a clean + [1690262155.519213][28202:28204] CHIP:TOO: } + disabled: true + + - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + Verify on TH(chip-tool), CurrentMode attribute value is an integer value and equal to old_current_mode_dut below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 + [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: + "Step 9: Manually put the device in a state from which it will + SUCCESSFULLY transition to PIXIT.RVCCLEANM.MODE_CHANGE_OK" + verification: | + Manual operation required + disabled: true + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, + - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 + [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: + "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.RVCCLEANM.MODE_CHANGE_OK" + PICS: RVCCLEANM.S.C00.Rsp + verification: | + Change to mode is not allowed from cleaning to any other mode(Vaccum, Deep clean, Wash ), Please switch the mode to idle and then try to change to other modes + + ./chip-tool rvcrunmode change-to-mode 0 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690262367.604437][28315:28317] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 + [1690262367.604496][28315:28317] CHIP:TOO: ChangeToModeResponse: { + [1690262367.604517][28315:28317] CHIP:TOO: status: 0 + [1690262367.604529][28315:28317] CHIP:TOO: } + + + ./chip-tool rvccleanmode change-to-mode 2 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690262376.067598][28323:28325] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 + [1690262376.067612][28323:28325] CHIP:TOO: ChangeToModeResponse: { + [1690262376.067618][28323:28325] CHIP:TOO: status: 0 + [1690262376.067621][28323:28325] CHIP:TOO: } + disabled: true + + - label: "Step 12: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 11, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 2 + + [1690262464.326501][28342:28344] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 2064453499 + [1690262464.326542][28342:28344] CHIP:TOO: CurrentMode: 2 + disabled: true + + - label: + "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set + to invalid_mode_th" + PICS: RVCCLEANM.S.C00.Rsp + verification: | + ./chip-tool rvccleanmode change-to-mode 4 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a UnsupportedMode(0x01) status response and below is the sample log provided for the raspi platform: + + [1690262496.596029][28351:28353] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 + [1690262496.596080][28351:28353] CHIP:TOO: ChangeToModeResponse: { + [1690262496.596117][28351:28353] CHIP:TOO: status: 1 + [1690262496.596120][28351:28353] CHIP:TOO: } + disabled: true + + - label: "Step 14: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 12, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 2 + + [1690262464.326501][28342:28344] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 2064453499 + [1690262464.326542][28342:28344] CHIP:TOO: CurrentMode: 2 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml index 9806f6dd8b9fe6..3ffc3454e12766 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 92.4.1. [TC-RVCCLEANM-3.1] On Mode functionality with DUT as Server @@ -20,138 +19,88 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "RVC Clean Mode" + endpoint: 1 + new_mode_th: + type: int8u + defaultValue: 1 tests: - - label: "Precondition" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true - - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)." - verification: | - - disabled: true + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Precondition: TH writes from the DUT the OnMode attribute." + PICS: RVCCLEANM.S.A0003 && RVCCLEANM.S.F00 + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: 0 - label: "Step 2: TH reads from the DUT the OnMode attribute." PICS: RVCCLEANM.S.A0003 && RVCCLEANM.S.F00 - verification: | - ./chip-tool rvccleanmode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer or Null - Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 - - [1690183202.686514][15123:15125] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0003 DataVersion: 3145953012 - [1690183202.686550][15123:15125] CHIP:TOO: OnMode: 0 - disabled: true + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - label: "Step 3: TH reads from the DUT the CurrentMode attribute." PICS: RVCCLEANM.S.A0001 && RVCCLEANM.S.F00 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute is an integer. - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 - - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. - - [1690183300.914668][15159:15161] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 4196861832 - [1690183300.914716][15159:15161] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - label: "Step 4: TH reads from the DUT the SupportedModes attribute." PICS: RVCCLEANM.S.A0000 && RVCCLEANM.S.F00 - verification: | - ./chip-tool rvccleanmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from on_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690182376.583167][14996:14998] CHIP:DMG: } - [1690182376.583260][14996:14998] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0000 DataVersion: 3145953005 - [1690182376.583288][14996:14998] CHIP:TOO: SupportedModes: 3 entries - [1690182376.583301][14996:14998] CHIP:TOO: [1]: { - [1690182376.583304][14996:14998] CHIP:TOO: Label: Vacuum - [1690182376.583307][14996:14998] CHIP:TOO: Mode: 0 - [1690182376.583311][14996:14998] CHIP:TOO: ModeTags: 1 entries - [1690182376.583316][14996:14998] CHIP:TOO: [1]: { - [1690182376.583319][14996:14998] CHIP:TOO: Value: 16385 - [1690182376.583322][14996:14998] CHIP:TOO: } - [1690182376.583325][14996:14998] CHIP:TOO: } - [1690182376.583331][14996:14998] CHIP:TOO: [2]: { - [1690182376.583333][14996:14998] CHIP:TOO: Label: Wash - [1690182376.583336][14996:14998] CHIP:TOO: Mode: 1 - [1690182376.583340][14996:14998] CHIP:TOO: ModeTags: 1 entries - [1690182376.583344][14996:14998] CHIP:TOO: [1]: { - [1690182376.583347][14996:14998] CHIP:TOO: Value: 16386 - [1690182376.583349][14996:14998] CHIP:TOO: } - [1690182376.583352][14996:14998] CHIP:TOO: } - [1690182376.583357][14996:14998] CHIP:TOO: [3]: { - [1690182376.583360][14996:14998] CHIP:TOO: Label: Deep clean - [1690182376.583362][14996:14998] CHIP:TOO: Mode: 2 - [1690182376.583366][14996:14998] CHIP:TOO: ModeTags: 2 entries - [1690182376.583369][14996:14998] CHIP:TOO: [1]: { - [1690182376.583372][14996:14998] CHIP:TOO: Value: 7 - [1690182376.583375][14996:14998] CHIP:TOO: } - [1690182376.583378][14996:14998] CHIP:TOO: [2]: { - [1690182376.583380][14996:14998] CHIP:TOO: Value: 16384 - [1690182376.583383][14996:14998] CHIP:TOO: } - [1690182376.583385][14996:14998] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list + minLength: 2 - label: "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th" PICS: RVCCLEANM.S.C00.Rsp && RVCCLEANM.S.F00 - verification: | - ./chip-tool rvccleanmode change-to-mode 1 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - 1690183395.641002][15168:15170] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 - [1690183395.641020][15168:15170] CHIP:TOO: ChangeToModeResponse: { - [1690183395.641025][15168:15170] CHIP:TOO: status: 0 - [1690183395.641028][15168:15170] CHIP:TOO: } - disabled: true - - - label: "Step 6: TH sends a Off command to the DUT" + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 6:TH sends a Off command to the DUT" PICS: OO.S.C00.Rsp && RVCCLEANM.S.F00 - verification: | - ./chip-tool onoff off 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931101.118656][20709:20711] CHIP:DMG: StatusIB = - [1684931101.118659][20709:20711] CHIP:DMG: { - [1684931101.118663][20709:20711] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931101.118665][20709:20711] CHIP:DMG: }, - disabled: true + cluster: "On/Off" + command: "Off" - - label: "Step 7: TH sends a On command to the DUT" + - label: "Step 7:TH sends a On command to the DUT" PICS: OO.S.C01.Rsp && RVCCLEANM.S.F00 - verification: | - ./chip-tool onoff on 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931217.055514][20729:20731] CHIP:DMG: StatusIB = - [1684931217.055517][20729:20731] CHIP:DMG: { - [1684931217.055520][20729:20731] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931217.055523][20729:20731] CHIP:DMG: }, - disabled: true + cluster: "On/Off" + command: "On" - label: "Step 8: TH reads from the DUT the CurrentMode attribute." PICS: RVCCLEANM.S.A0001 && RVCCLEANM.S.F00 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and equal to on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 0 - - [1690183444.048684][15184:15186] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 4196861834 - [1690183444.048697][15184:15186] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml new file mode 100644 index 00000000000000..a878da5691c923 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml @@ -0,0 +1,203 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 92.4.2. [TC-RVCCLEANM-3.2] Startup Mode functionality with DUT as Server + +PICS: + - RVCCLEANM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: "Preconditions" + verification: | + !RVCCLEANM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL + disabled: true + + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + verification: | + + disabled: true + + - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + PICS: RVCCLEANM.S.A0002 + verification: | + ./chip-tool rvccleanmode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is an integer value or null + - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is null + + NOTE: if startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. + + [1690545840.189340][3104:3106] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0002 DataVersion: 3338736524 + [1690545840.189408][3104:3106] CHIP:TOO: StartUpMode: null + disabled: true + + - label: "Step 3: TH reads from the DUT the SupportedModes attribute." + PICS: RVCCLEANM.S.A0000 + verification: | + ./chip-tool rvccleanmode read supported-modes 1 1 + + On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut + - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: + + [1690183637.107558][15230:15232] CHIP:TOO: SupportedModes: 3 entries + [1690183637.107597][15230:15232] CHIP:TOO: [1]: { + [1690183637.107608][15230:15232] CHIP:TOO: Label: Vacuum + [1690183637.107618][15230:15232] CHIP:TOO: Mode: 0 + [1690183637.107633][15230:15232] CHIP:TOO: ModeTags: 1 entries + [1690183637.107651][15230:15232] CHIP:TOO: [1]: { + [1690183637.107662][15230:15232] CHIP:TOO: Value: 16385 + [1690183637.107670][15230:15232] CHIP:TOO: } + [1690183637.107679][15230:15232] CHIP:TOO: } + [1690183637.107700][15230:15232] CHIP:TOO: [2]: { + [1690183637.107708][15230:15232] CHIP:TOO: Label: Wash + [1690183637.107718][15230:15232] CHIP:TOO: Mode: 1 + [1690183637.107730][15230:15232] CHIP:TOO: ModeTags: 1 entries + [1690183637.107744][15230:15232] CHIP:TOO: [1]: { + [1690183637.107753][15230:15232] CHIP:TOO: Value: 16386 + [1690183637.107765][15230:15232] CHIP:TOO: } + [1690183637.107774][15230:15232] CHIP:TOO: } + [1690183637.107793][15230:15232] CHIP:TOO: [3]: { + [1690183637.107801][15230:15232] CHIP:TOO: Label: Deep clean + [1690183637.107811][15230:15232] CHIP:TOO: Mode: 2 + [1690183637.107823][15230:15232] CHIP:TOO: ModeTags: 2 entries + [1690183637.107837][15230:15232] CHIP:TOO: [1]: { + [1690183637.107846][15230:15232] CHIP:TOO: Value: 7 + [1690183637.107856][15230:15232] CHIP:TOO: } + [1690183637.107885][15230:15232] CHIP:TOO: [2]: { + [1690183637.107888][15230:15232] CHIP:TOO: Value: 16384 + [1690183637.107890][15230:15232] CHIP:TOO: } + [1690183637.107894][15230:15232] CHIP:TOO: } + disabled: true + + - label: + "Step 4: TH writes to the DUT the StartUpMode attribute with the + new_start_up_mode_th value" + PICS: RVCCLEANM.S.A0002 + verification: | + ./chip-tool rvccleanmode write start-up-mode 0 1 1 + + On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690183561.346360][15209:15211] CHIP:DMG: StatusIB = + [1690183561.346364][15209:15211] CHIP:DMG: { + [1690183561.346367][15209:15211] CHIP:DMG: status = 0x00 (SUCCESS), + [1690183561.346369][15209:15211] CHIP:DMG: }, + disabled: true + + - label: "Step 5: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + On TH(chip-tool), Verify CurrentMode attribute value is an integer value + - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 + + NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8. + + [1690183605.342520][15217:15219] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3992778259 + [1690183605.342539][15217:15219] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + PICS: RVCCLEANM.S.A0000 + verification: | + ./chip-tool rvccleanmode read supported-modes 1 1 + + On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut + - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th., below is the sample log provided for the raspi platform: + + [1690183637.107558][15230:15232] CHIP:TOO: SupportedModes: 3 entries + [1690183637.107597][15230:15232] CHIP:TOO: [1]: { + [1690183637.107608][15230:15232] CHIP:TOO: Label: Vacuum + [1690183637.107618][15230:15232] CHIP:TOO: Mode: 0 + [1690183637.107633][15230:15232] CHIP:TOO: ModeTags: 1 entries + [1690183637.107651][15230:15232] CHIP:TOO: [1]: { + [1690183637.107662][15230:15232] CHIP:TOO: Value: 16385 + [1690183637.107670][15230:15232] CHIP:TOO: } + [1690183637.107679][15230:15232] CHIP:TOO: } + [1690183637.107700][15230:15232] CHIP:TOO: [2]: { + [1690183637.107708][15230:15232] CHIP:TOO: Label: Wash + [1690183637.107718][15230:15232] CHIP:TOO: Mode: 1 + [1690183637.107730][15230:15232] CHIP:TOO: ModeTags: 1 entries + [1690183637.107744][15230:15232] CHIP:TOO: [1]: { + [1690183637.107753][15230:15232] CHIP:TOO: Value: 16386 + [1690183637.107765][15230:15232] CHIP:TOO: } + [1690183637.107774][15230:15232] CHIP:TOO: } + [1690183637.107793][15230:15232] CHIP:TOO: [3]: { + [1690183637.107801][15230:15232] CHIP:TOO: Label: Deep clean + [1690183637.107811][15230:15232] CHIP:TOO: Mode: 2 + [1690183637.107823][15230:15232] CHIP:TOO: ModeTags: 2 entries + [1690183637.107837][15230:15232] CHIP:TOO: [1]: { + [1690183637.107846][15230:15232] CHIP:TOO: Value: 7 + [1690183637.107856][15230:15232] CHIP:TOO: } + [1690183637.107885][15230:15232] CHIP:TOO: [2]: { + [1690183637.107888][15230:15232] CHIP:TOO: Value: 16384 + [1690183637.107890][15230:15232] CHIP:TOO: } + [1690183637.107894][15230:15232] CHIP:TOO: } + disabled: true + + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to new_mode_th" + PICS: RVCCLEANM.S.C00.Rsp + verification: | + ./chip-tool rvccleanmode change-to-mode 1 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690183675.346665][15234:15236] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 + [1690183675.346731][15234:15236] CHIP:TOO: ChangeToModeResponse: { + [1690183675.346753][15234:15236] CHIP:TOO: status: 0 + [1690183675.346768][15234:15236] CHIP:TOO: } + disabled: true + + - label: "Step 8: Physically power cycle the device" + verification: | + Physically power cycle the device. + disabled: true + + - label: "Step 9: TH reads from the DUT the StartUpMode attribute." + PICS: RVCCLEANM.S.A0002 + verification: | + ./chip-tool rvccleanmode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is an integer + - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is 0 + + [1690545840.189340][3104:3106] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0002 DataVersion: 3338736524 + [1690545840.189408][3104:3106] CHIP:TOO: StartUpMode: 0 + disabled: true + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: RVCCLEANM.S.A0001 + verification: | + ./chip-tool rvccleanmode read current-mode 1 1 + + On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is equal to new_start_up_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690347752.080278][43423:43425] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 1382495026 + [1690347752.080330][43423:43425] CHIP:TOO: CurrentMode: 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml index 642926e317d53c..3a50dca22d51a7 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml @@ -120,12 +120,19 @@ tests: [1690183885.227148][15298:15300] CHIP:DMG: { [1690183885.227152][15298:15300] CHIP:DMG: status = 0x00 (SUCCESS), [1690183885.227156][15298:15300] CHIP:DMG: }, + + ./chip-tool rvcrunmode read start-up-mode 1 1 + + On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform + + [1692178796.077748][3730:3732] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 1431406600 + [1692178796.077821][3730:3732] CHIP:TOO: StartUpMode: 0 disabled: true - label: "Step 5: TH reads from the DUT the OnMode attribute." - PICS: RVCCLEANM.S.A0000 && RVCCLEANM.S.A0002 + PICS: RVCCLEANM.S.A0003 && RVCCLEANM.S.A0002 verification: | - Set onmode to any integer value because as default it value has null. + As default value of OnMode attribute is NULL. Set the OnMode to any mode value listed in the SupportedModes entries. ./chip-tool rvccleanmode write on-mode 0 1 1 diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml index 376e2b661b6f83..b0390d5092f3c9 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml @@ -127,8 +127,8 @@ tests: Verify the "AttributeList " should include the mandatory attributes (values 0, 1), - global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and - - list may include optional attribute(value 0x0002), if MOD.S.A0002(StartUpMode) supports, - - list contains feature dependent attribute (values 0x0003), if MOD.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + - list may include optional attribute(value 0x0002), if RVCRUNM.S.A0002(StartUpMode) supports, + - list contains feature dependent attribute (values 0x0003), if RVCRUNM.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1690177332.943953][6264:6266] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_FFFB DataVersion: 551764487 [1690177332.944121][6264:6266] CHIP:TOO: AttributeList: 10 entries diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml new file mode 100644 index 00000000000000..5e699c00a4ce9b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml @@ -0,0 +1,113 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 87.2.1. [TC-RVCRUNM-1.2] Cluster attributes with DUT as Server + +PICS: + - RVCRUNM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: "Preconditions" + verification: | + This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command + disabled: true + + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + verification: | + + disabled: true + + - label: "Step 2: TH reads from the DUT the SupportedModes attribute." + PICS: RVCRUNM.S.A0000 + verification: | + ./chip-tool rvcrunmode read supported-modes 1 1 + + Verify that the DUT response contains list of ModeOptionsStruct entries. + - Verify that the list has at least 2 and at most 255 entries + - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value + - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) a defined cluster derived tag value (Idle(0x4000), Cleaning(0x4001)) or in the MfgTags (0x8000 to 0xBFFF) range + - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 + - Verify that at least one ModeOptionsStruct entry includes the Idle(0x4000) mode tag in the ModeTags field + - Verify that at least one ModeOptionsStruct entry includes the Cleaning(0x4001) mode tag in the ModeTags field + - Verify that none of the ModeOptionsStruct entries include both the Idle(0x4000) mode tag and the Cleaning(0x4001) mode tag in the ModeTags field + - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + + [1690177496.793840][6284:6286] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 551764487 + [1690177496.794090][6284:6286] CHIP:TOO: SupportedModes: 3 entries + [1690177496.794285][6284:6286] CHIP:TOO: [1]: { + [1690177496.794343][6284:6286] CHIP:TOO: Label: Idle + [1690177496.794396][6284:6286] CHIP:TOO: Mode: 0 + [1690177496.794457][6284:6286] CHIP:TOO: ModeTags: 1 entries + [1690177496.794573][6284:6286] CHIP:TOO: [1]: { + [1690177496.794631][6284:6286] CHIP:TOO: Value: 16384 + [1690177496.794682][6284:6286] CHIP:TOO: } + [1690177496.794737][6284:6286] CHIP:TOO: } + [1690177496.794809][6284:6286] CHIP:TOO: [2]: { + [1690177496.794861][6284:6286] CHIP:TOO: Label: Cleaning + [1690177496.794910][6284:6286] CHIP:TOO: Mode: 1 + [1690177496.794967][6284:6286] CHIP:TOO: ModeTags: 1 entries + [1690177496.795031][6284:6286] CHIP:TOO: [1]: { + [1690177496.795085][6284:6286] CHIP:TOO: Value: 16385 + [1690177496.795135][6284:6286] CHIP:TOO: } + [1690177496.795186][6284:6286] CHIP:TOO: } + [1690177496.795257][6284:6286] CHIP:TOO: [3]: { + [1690177496.795309][6284:6286] CHIP:TOO: Label: Mapping + [1690177496.795358][6284:6286] CHIP:TOO: Mode: 2 + [1690177496.795415][6284:6286] CHIP:TOO: ModeTags: 1 entries + [1690177496.795478][6284:6286] CHIP:TOO: [1]: { + [1690177496.795531][6284:6286] CHIP:TOO: Value: 16384 + [1690177496.795581][6284:6286] CHIP:TOO: } + [1690177496.795632][6284:6286] CHIP:TOO: } + disabled: true + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690177606.359517][6295:6297] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 551764487 + [1690177606.359639][6295:6297] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: "Step 4: TH reads from the DUT the OnMode attribute." + PICS: RVCRUNM.S.A0003 + verification: | + ./chip-tool rvcrunmode read on-mode 1 1 + + Verify on TH(chip-tool) logs, OnMode attribute value is an integer and the value is from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here OnMode attribute value is Null + + [1690177656.364979][6304:6306] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0003 DataVersion: 551764487 + [1690177656.365109][6304:6306] CHIP:TOO: OnMode: null + disabled: true + + - label: "Step 5: TH reads from the DUT the StartUpMode attribute." + PICS: RVCRUNM.S.A0002 + verification: | + ./chip-tool rvcrunmode read start-up-mode 1 1 + + Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer and value is from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null + + [1690177698.954736][6311:6313] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 551764487 + [1690177698.954865][6311:6313] CHIP:TOO: StartUpMode: null + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml new file mode 100644 index 00000000000000..3e96b215b81fa6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml @@ -0,0 +1,215 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 87.3.1. [TC-RVCRUNM-2.1] Change to Mode functionality with DUT as Server + +PICS: + - RVCRUNM.S + +config: + nodeId: "0x12344321" + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + verification: | + + disabled: true + + - label: "Step 2: TH reads from the DUT the SupportedModes attribute." + PICS: RVCRUNM.S.A0000 + verification: | + ./chip-tool rvcrunmode read supported-modes 1 1 + + Verify that the DUT response contains list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + + [1690177742.429087][6315:6317] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 551764487 + [1690177742.429341][6315:6317] CHIP:TOO: SupportedModes: 3 entries + [1690177742.429483][6315:6317] CHIP:TOO: [1]: { + [1690177742.429540][6315:6317] CHIP:TOO: Label: Idle + [1690177742.429595][6315:6317] CHIP:TOO: Mode: 0 + [1690177742.429658][6315:6317] CHIP:TOO: ModeTags: 1 entries + [1690177742.429732][6315:6317] CHIP:TOO: [1]: { + [1690177742.429791][6315:6317] CHIP:TOO: Value: 16384 + [1690177742.429842][6315:6317] CHIP:TOO: } + [1690177742.429892][6315:6317] CHIP:TOO: } + [1690177742.429967][6315:6317] CHIP:TOO: [2]: { + [1690177742.430020][6315:6317] CHIP:TOO: Label: Cleaning + [1690177742.430070][6315:6317] CHIP:TOO: Mode: 1 + [1690177742.430188][6315:6317] CHIP:TOO: ModeTags: 1 entries + [1690177742.430263][6315:6317] CHIP:TOO: [1]: { + [1690177742.430320][6315:6317] CHIP:TOO: Value: 16385 + [1690177742.430374][6315:6317] CHIP:TOO: } + [1690177742.430427][6315:6317] CHIP:TOO: } + [1690177742.430501][6315:6317] CHIP:TOO: [3]: { + [1690177742.430555][6315:6317] CHIP:TOO: Label: Mapping + [1690177742.430605][6315:6317] CHIP:TOO: Mode: 2 + [1690177742.430664][6315:6317] CHIP:TOO: ModeTags: 1 entries + [1690177742.430729][6315:6317] CHIP:TOO: [1]: { + [1690177742.430784][6315:6317] CHIP:TOO: Value: 16384 + [1690177742.430901][6315:6317] CHIP:TOO: } + [1690177742.430966][6315:6317] CHIP:TOO: } + disabled: true + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, + - Save the value as old_current_mode_dut + - Select a value which is NOT in supported_modes_dut and save it as invalid_mode_th, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690177776.069002][6321:6323] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 551764487 + [1690177776.069137][6321:6323] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: + "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set + to old_current_mode_dut" + PICS: RVCRUNM.S.C00.Rsp + verification: | + ./chip-tool rvcrunmode change-to-mode 1 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690177967.451381][6333:6335] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 + [1690177967.451491][6333:6335] CHIP:TOO: ChangeToModeResponse: { + [1690177967.451542][6333:6335] CHIP:TOO: status: 0 + [1690177967.451590][6333:6335] CHIP:TOO: } + disabled: true + + - label: + "Step 5: Manually put the device in a state from which it will FAIL to + transition to PIXIT.RVCRUNM.MODE_CHANGE_FAIL" + PICS: RVCRUNM.S.M.CAN_TEST_MODE_FAILURE + verification: | + Manual operation required + disabled: true + + - label: "Step 6: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, + - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 1 + + [1690202974.725219][18214:18216] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 2507484088 + [1690202974.725506][18214:18216] CHIP:TOO: CurrentMode: 1 + disabled: true + + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.RVCRUNM.MODE_CHANGE_FAIL" + PICS: RVCRUNM.S.M.CAN_TEST_MODE_FAILURE && RVCRUNM.S.C00.Rsp + verification: | + ./chip-tool rvcrunmode change-to-mode 2 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a GenericFailure(0x02) status response and StatusText field has a length between 1 to 64, below is the sample log provided for the raspi platform: + + [1690178461.944185][6368:6370] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 + [1690178461.944369][6368:6370] CHIP:TOO: ChangeToModeResponse: { + [1690178461.944457][6368:6370] CHIP:TOO: status: 2 + [1690178461.944517][6368:6370] CHIP:TOO: statusText: Change to the mapping mode is only allowed from idle + [1690178461.944578][6368:6370] CHIP:TOO: } + disabled: true + + - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + Verify on TH(chip-tool), CurrentMode attribute value is an integer value and equal to old_current_mode_dut below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 1 + + [1690203073.106487][18256:18258] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915104 + [1690203073.106525][18256:18258] CHIP:TOO: CurrentMode: 1 + disabled: true + + - label: + "Step 9: Manually put the device in a state from which it will + SUCCESSFULLY transition to PIXIT.RVCRUNM.MODE_CHANGE_OK" + verification: | + Manual operation required + disabled: true + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, + - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 1 + + [1690203090.571985][18263:18265] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915104 + [1690203090.571996][18263:18265] CHIP:TOO: CurrentMode: 1 + disabled: true + + - label: + "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.RVCRUNM.MODE_CHANGE_OK" + PICS: RVCRUNM.S.C00.Rsp + verification: | + ./chip-tool rvcrunmode change-to-mode 0 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690178355.021382][6358:6360] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 + [1690178355.021533][6358:6360] CHIP:TOO: ChangeToModeResponse: { + [1690178355.021692][6358:6360] CHIP:TOO: status: 0 + [1690178355.021750][6358:6360] CHIP:TOO: } + disabled: true + + - label: "Step 12: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 11, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690203144.862081][18275:18277] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915105 + [1690203144.862121][18275:18277] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: + "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set + to invalid_mode_th" + PICS: RVCRUNM.S.C00.Rsp + verification: | + ./chip-tool rvcrunmode change-to-mode 5 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a UnsupportedMode(0x01) status response and below is the sample log provided for the raspi platform: + + [1690178736.566529][6381:6383] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 + [1690178736.566677][6381:6383] CHIP:TOO: ChangeToModeResponse: { + [1690178736.566761][6381:6383] CHIP:TOO: status: 1 + [1690178736.566816][6381:6383] CHIP:TOO: } + disabled: true + + - label: "Step 14: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 12, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690203158.762178][18282:18284] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915105 + [1690203158.762194][18282:18284] CHIP:TOO: CurrentMode: 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml index 5279d6c054270a..bfd9e262eeabf2 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml @@ -57,7 +57,7 @@ tests: verification: | ./chip-tool rvcrunmode read on-mode 1 1 - On TH(chip-tool), Verify that OnMode attribute value is an integer or Null + On TH(chip-tool), Verify that OnMode attribute value is an integer Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 [1690265382.010747][30073:30075] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0003 DataVersion: 172461204 @@ -72,7 +72,7 @@ tests: On TH(chip-tool), Verify that CurrentMode attribute is an integer. Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. + NOTE: If on_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. [1690179152.516820][6454:6456] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 2795852718 [1690179152.516952][6454:6456] CHIP:TOO: CurrentMode: 0 @@ -86,7 +86,7 @@ tests: On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - Verify that the list has two or more entries - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from on_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: + - Select a value from supported_modes_dut different from on_mode_dut. Save the value as new_mode_th. below is the sample log provided for the raspi platform: [1690179211.761627][6462:6464] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 2795852718 [1690179211.761873][6462:6464] CHIP:TOO: SupportedModes: 3 entries @@ -162,7 +162,7 @@ tests: verification: | ./chip-tool rvcrunmode read current-mode 1 1 - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and equal to on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 0 + On TH(chip-tool), Verify that CurrentMode attribute value is an integer and equal to on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 0 [1690179336.313000][6489:6491] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 2795852720 [1690179336.313132][6489:6491] CHIP:TOO: CurrentMode: 0 diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml new file mode 100644 index 00000000000000..7ad4b2d59f0880 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml @@ -0,0 +1,223 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 87.4.2. [TC-RVCRUNM-3.2] Startup Mode functionality with DUT as Server + +PICS: + - RVCRUNM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: "Precondition" + verification: | + !RVCRUNM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL + disabled: true + + - label: "Note" + verification: | + To Execute the TC-RVCRUNM-3.2 test case using reboot in raspi device we followed the below suggested way: + + To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps + + step-1: create a file using touch command , something like touch mytest.txt + step-2: chmod 777 mytest.txt + step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt + + if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. + disabled: true + + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + verification: | + + disabled: true + + - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + PICS: RVCRUNM.S.A0002 + verification: | + ./chip-tool rvcrunmode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is an integer. + - Save the value as startup_mode_dut + - If startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. + and below is the sample log provided for the raspi platform: + - Here StartUpMode value is null proced to step3 + + [1690543468.611591][2895:2897] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 2245114918 + [1690543468.611648][2895:2897] CHIP:TOO: StartUpMode: null + disabled: true + + - label: "Step 3: TH reads from the DUT the SupportedModes attribute." + PICS: RVCRUNM.S.A0000 + verification: | + ./chip-tool rvcrunmode read supported-modes 1 1 + + On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut + - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: + + [1690179857.830697][14130:14132] CHIP:DMG: } + [1690179857.831035][14130:14132] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 290070852 + [1690179857.831058][14130:14132] CHIP:TOO: SupportedModes: 3 entries + [1690179857.831069][14130:14132] CHIP:TOO: [1]: { + [1690179857.831072][14130:14132] CHIP:TOO: Label: Idle + [1690179857.831077][14130:14132] CHIP:TOO: Mode: 0 + [1690179857.831082][14130:14132] CHIP:TOO: ModeTags: 1 entries + [1690179857.831090][14130:14132] CHIP:TOO: [1]: { + [1690179857.831093][14130:14132] CHIP:TOO: Value: 16384 + [1690179857.831096][14130:14132] CHIP:TOO: } + [1690179857.831099][14130:14132] CHIP:TOO: } + [1690179857.831104][14130:14132] CHIP:TOO: [2]: { + [1690179857.831107][14130:14132] CHIP:TOO: Label: Cleaning + [1690179857.831109][14130:14132] CHIP:TOO: Mode: 1 + [1690179857.831112][14130:14132] CHIP:TOO: ModeTags: 1 entries + [1690179857.831115][14130:14132] CHIP:TOO: [1]: { + [1690179857.831118][14130:14132] CHIP:TOO: Value: 16385 + [1690179857.831121][14130:14132] CHIP:TOO: } + [1690179857.831124][14130:14132] CHIP:TOO: } + [1690179857.831128][14130:14132] CHIP:TOO: [3]: { + [1690179857.831131][14130:14132] CHIP:TOO: Label: Mapping + [1690179857.831133][14130:14132] CHIP:TOO: Mode: 2 + [1690179857.831135][14130:14132] CHIP:TOO: ModeTags: 1 entries + [1690179857.831138][14130:14132] CHIP:TOO: [1]: { + [1690179857.831141][14130:14132] CHIP:TOO: Value: 16384 + [1690179857.831143][14130:14132] CHIP:TOO: } + [1690179857.831146][14130:14132] CHIP:TOO: } + disabled: true + + - label: + "Step 4: TH writes to the DUT the StartUpMode attribute with the + new_start_up_mode_th value" + PICS: RVCRUNM.S.A0002 + verification: | + ./chip-tool rvcrunmode write start-up-mode 0 1 1 + + On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690179737.189558][14110:14112] CHIP:DMG: StatusIB = + [1690179737.189576][14110:14112] CHIP:DMG: { + [1690179737.189592][14110:14112] CHIP:DMG: status = 0x00 (SUCCESS), + [1690179737.189607][14110:14112] CHIP:DMG: }, + + ./chip-tool rvcrunmode read start-up-mode 1 1 + + On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform + + [1692181154.909850][3899:3901] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 1431406601 + [1692181154.909907][3899:3901] CHIP:TOO: StartUpMode: 0 + disabled: true + + - label: "Step 5: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + On TH(chip-tool), Verify that CurrentMode attribute value is an integer value + - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8. + + [1690180034.919766][14170:14172] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 1228902958 + [1690180034.919778][14170:14172] CHIP:TOO: CurrentMode: 0 + disabled: true + + - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + PICS: RVCRUNM.S.A0000 + verification: | + ./chip-tool rvcrunmode read supported-modes 1 1 + + On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has two or more entries + - Save the Mode field values as supported_modes_dut + - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: + + [1690179857.830697][14130:14132] CHIP:DMG: } + [1690179857.831035][14130:14132] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 290070852 + [1690179857.831058][14130:14132] CHIP:TOO: SupportedModes: 3 entries + [1690179857.831069][14130:14132] CHIP:TOO: [1]: { + [1690179857.831072][14130:14132] CHIP:TOO: Label: Idle + [1690179857.831077][14130:14132] CHIP:TOO: Mode: 0 + [1690179857.831082][14130:14132] CHIP:TOO: ModeTags: 1 entries + [1690179857.831090][14130:14132] CHIP:TOO: [1]: { + [1690179857.831093][14130:14132] CHIP:TOO: Value: 16384 + [1690179857.831096][14130:14132] CHIP:TOO: } + [1690179857.831099][14130:14132] CHIP:TOO: } + [1690179857.831104][14130:14132] CHIP:TOO: [2]: { + [1690179857.831107][14130:14132] CHIP:TOO: Label: Cleaning + [1690179857.831109][14130:14132] CHIP:TOO: Mode: 1 + [1690179857.831112][14130:14132] CHIP:TOO: ModeTags: 1 entries + [1690179857.831115][14130:14132] CHIP:TOO: [1]: { + [1690179857.831118][14130:14132] CHIP:TOO: Value: 16385 + [1690179857.831121][14130:14132] CHIP:TOO: } + [1690179857.831124][14130:14132] CHIP:TOO: } + [1690179857.831128][14130:14132] CHIP:TOO: [3]: { + [1690179857.831131][14130:14132] CHIP:TOO: Label: Mapping + [1690179857.831133][14130:14132] CHIP:TOO: Mode: 2 + [1690179857.831135][14130:14132] CHIP:TOO: ModeTags: 1 entries + [1690179857.831138][14130:14132] CHIP:TOO: [1]: { + [1690179857.831141][14130:14132] CHIP:TOO: Value: 16384 + [1690179857.831143][14130:14132] CHIP:TOO: } + [1690179857.831146][14130:14132] CHIP:TOO: } + disabled: true + + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to new_mode_th" + PICS: RVCRUNM.S.C00.Rsp + verification: | + ./chip-tool rvcrunmode change-to-mode 1 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: + + [1690179905.782387][14141:14143] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 + [1690179905.782401][14141:14143] CHIP:TOO: ChangeToModeResponse: { + [1690179905.782405][14141:14143] CHIP:TOO: status: 0 + [1690179905.782408][14141:14143] CHIP:TOO: } + disabled: true + + - label: "Step 8: Physically power cycle the device" + verification: | + Physically power cycle the device. + disabled: true + + - label: "Step 9: TH reads from the DUT the StartUpMode attribute." + PICS: RVCRUNM.S.A0002 + verification: | + ./chip-tool rvcrunmode read start-up-mode 1 1 + + On TH(chip-tool), Verify StartUpMode attribute value is an integer. + - Save the value as new_start_up_mode_dut and is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform: + - Here StartUpMode value is 0 + + [1690544350.025546][2955:2957] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 3877802510 + [1690544350.025630][2955:2957] CHIP:TOO: StartUpMode: 0 + disabled: true + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: RVCRUNM.S.A0001 + verification: | + ./chip-tool rvcrunmode read current-mode 1 1 + + On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is equal to new_start_up_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1690180034.919766][14170:14172] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 1228902958 + [1690180034.919778][14170:14172] CHIP:TOO: CurrentMode: 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_3.yaml index ef3fd5d593e056..76b1bec0a3fdc4 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_3.yaml @@ -117,12 +117,19 @@ tests: [1690179737.189576][14110:14112] CHIP:DMG: { [1690179737.189592][14110:14112] CHIP:DMG: status = 0x00 (SUCCESS), [1690179737.189607][14110:14112] CHIP:DMG: }, + + ./chip-tool rvcrunmode read start-up-mode 1 1 + + On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform + + [1692181154.909850][3899:3901] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 1431406601 + [1692181154.909907][3899:3901] CHIP:TOO: StartUpMode: 0 disabled: true - label: "Step 5: TH reads from the DUT the OnMode attribute." PICS: RVCRUNM.S.A0003 && RVCRUNM.S.A0002 verification: | - Set onmode to any integer value because as default it value has null. + As default value of OnMode attribute is NULL. Set the OnMode to any mode value listed in the SupportedModes entries. ./chip-tool rvcrunmode write on-mode 0 1 1 @@ -138,7 +145,7 @@ tests: On TH(chip-tool), Verify that OnMode attribute value is an integer - Save the value as old_on_mode_dut , below is the sample log provided for the raspi platform, OnMode attribute value is 0 - NOTE: If startup_mode_dut is equal to old_on_mode_dut proceed to step 4. Else proceed to step 6. + NOTE: If startup_mode_dut is equal to old_on_mode_dut proceed to step 6. Else proceed to step 8. [1690544833.540939][2984:2986] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0003 DataVersion: 3877802512 [1690544833.541032][2984:2986] CHIP:TOO: OnMode: 0 diff --git a/src/app/tests/suites/certification/Test_TC_SM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_SM_1_1.yaml new file mode 100755 index 00000000000000..9929d3531f41b3 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SM_1_1.yaml @@ -0,0 +1,220 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 54.1.1. [TC-SM-1.1] Device composition - Root Node [DUT as Server] + +PICS: + - MCORE.SM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: + "Step 1: TH performs a wildcard read of all attributes and endpoints" + verification: | + TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) + ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF + disabled: true + + - label: + "Step 2: C.2.10, Verify that endpoint 0 exists in the returned data" + verification: | + On TH(chip-tool), Verify that endpoint 0 exists in the returned report data Message + below is the sample log provided for the raspi platform: + + [1690185276.189258][40055:40057] CHIP:TOO: [28]: 4294048774 + [1690185276.189270][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 + [1690185276.189273][40055:40057] CHIP:TOO: ClientList: 1 entries + [1690185276.189275][40055:40057] CHIP:TOO: [1]: 41 + [1690185276.189286][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 + [1690185276.189290][40055:40057] CHIP:TOO: PartsList: 2 entries + [1690185276.189293][40055:40057] CHIP:TOO: [1]: 1 + [1690185276.189295][40055:40057] CHIP:TOO: [2]: 2 + [1690185276.189298][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 + [1690185276.189300][40055:40057] CHIP:TOO: FeatureMap: 0 + [1690185276.189309][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 1390630643 + [1690185276.189311][40055:40057] CHIP:TOO: ClusterRevision: 1 + [1690185276.189326][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 1390630643 + [1690185276.189329][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries + [1690185276.189339][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 1390630643 + [1690185276.189341][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries + [1690185276.189353][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 1390630643 + [1690185276.189356][40055:40057] CHIP:TOO: EventList: 0 entries + [1690185276.189374][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 1390630643 + [1690185276.189378][40055:40057] CHIP:TOO: AttributeList: 10 entries + [1690185276.189380][40055:40057] CHIP:TOO: [1]: 0 + [1690185276.189382][40055:40057] CHIP:TOO: [2]: 1 + [1690185276.189384][40055:40057] CHIP:TOO: [3]: 2 + [1690185276.189386][40055:40057] CHIP:TOO: [4]: 3 + [1690185276.189388][40055:40057] CHIP:TOO: [5]: 65528 + [1690185276.189390][40055:40057] CHIP:TOO: [6]: 65529 + [1690185276.189392][40055:40057] CHIP:TOO: [7]: 65530 + [1690185276.189394][40055:40057] CHIP:TOO: [8]: 65531 + [1690185276.189396][40055:40057] CHIP:TOO: [9]: 65532 + [1690185276.189398][40055:40057] CHIP:TOO: [10]: 65533 + [1690185276.189408][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 3752520678 + [1690185276.189411][40055:40057] CHIP:TOO: Binding: 0 entries + [1690185276.189414][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFFC DataVersion: 3752520678 + [1690185276.189416][40055:40057] CHIP:TOO: FeatureMap: 0 + disabled: true + + - label: + "Step 3: C.2.10, Verify that the endpoint 0 descriptor cluster + DeviceTypeList includes the Root Node device type id (0x0016)" + verification: | + On TH(chip-tool), Verify that the endpoint 0 descriptor cluster DeviceTypeList includes the Root Node device type id - 0x0016(22) in the returned report data Message + below is the sample log provided for the raspi platform: + [1690191137.963592][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_FFFA DataVersion: 2221012748 + [1690191137.963595][40907:40909] CHIP:TOO: EventList: 0 entries + [1690191137.963612][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_FFFB DataVersion: 2221012748 + [1690191137.963616][40907:40909] CHIP:TOO: AttributeList: 7 entries + [1690191137.963619][40907:40909] CHIP:TOO: [1]: 0 + [1690191137.963621][40907:40909] CHIP:TOO: [2]: 65528 + [1690191137.963623][40907:40909] CHIP:TOO: [3]: 65529 + [1690191137.963625][40907:40909] CHIP:TOO: [4]: 65530 + [1690191137.963627][40907:40909] CHIP:TOO: [5]: 65531 + [1690191137.963629][40907:40909] CHIP:TOO: [6]: 65532 + [1690191137.963631][40907:40909] CHIP:TOO: [7]: 65533 + [1690191137.963649][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1390630643 + [1690191137.963657][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries + [1690191137.963663][40907:40909] CHIP:TOO: [1]: { + [1690191137.963665][40907:40909] CHIP:TOO: DeviceType: 22 + [1690191137.963667][40907:40909] CHIP:TOO: Revision: 1 + [1690191137.963669][40907:40909] CHIP:TOO: } + [1690191137.963704][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1390630643 + [1690191137.963712][40907:40909] CHIP:TOO: ServerList: 28 entries + [1690191137.963714][40907:40909] CHIP:TOO: [1]: 3 + [1690191137.963716][40907:40909] CHIP:TOO: [2]: 4 + [1690191137.963717][40907:40909] CHIP:TOO: [3]: 29 + [1690191137.963719][40907:40909] CHIP:TOO: [4]: 30 + [1690191137.963721][40907:40909] CHIP:TOO: [5]: 31 + [1690191137.963723][40907:40909] CHIP:TOO: [6]: 40 + [1690191137.963725][40907:40909] CHIP:TOO: [7]: 42 + [1690191137.963727][40907:40909] CHIP:TOO: [8]: 43 + [1690191137.963729][40907:40909] CHIP:TOO: [9]: 44 + [1690191137.963731][40907:40909] CHIP:TOO: [10]: 45 + disabled: true + + - label: + "Step 4: {REF_SM_ENDPOINT}, For each of the non-root endpoints, verify + that the descriptor cluster DeviceTypeList does NOT include the Root + Node device type id (0x0016)" + verification: | + On TH(chip-tool), For each of the non-root endpoints(endpoint - 1 and endpoint 2), verify that the descriptor cluster DeviceTypeList does NOT include the Root Node device type id - 0x0016(22) in the returned report data Message + below is the sample log provided for the raspi platform: + + [1690191138.044893][40907:40909] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_000F Attribute 0x0000_FFFB DataVersion: 4049418703 + [1690191138.044897][40907:40909] CHIP:TOO: AttributeList: 9 entries + [1690191138.044900][40907:40909] CHIP:TOO: [1]: 81 + [1690191138.044902][40907:40909] CHIP:TOO: [2]: 85 + [1690191138.044904][40907:40909] CHIP:TOO: [3]: 111 + [1690191138.044906][40907:40909] CHIP:TOO: [4]: 65528 + [1690191138.044908][40907:40909] CHIP:TOO: [5]: 65529 + [1690191138.044910][40907:40909] CHIP:TOO: [6]: 65530 + [1690191138.044912][40907:40909] CHIP:TOO: [7]: 65531 + [1690191138.044914][40907:40909] CHIP:TOO: [8]: 65532 + [1690191138.044916][40907:40909] CHIP:TOO: [9]: 65533 + [1690191138.044941][40907:40909] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2743502132 + [1690191138.044945][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries + [1690191138.044950][40907:40909] CHIP:TOO: [1]: { + [1690191138.044952][40907:40909] CHIP:TOO: DeviceType: 256 + [1690191138.044954][40907:40909] CHIP:TOO: Revision: 1 + [1690191138.044956][40907:40909] CHIP:TOO: } + [1690191138.045023][40907:40909] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 2743502132 + [1690191138.045038][40907:40909] CHIP:TOO: ServerList: 68 entries + [1690191138.045040][40907:40909] CHIP:TOO: [1]: 3 + [1690191138.045042][40907:40909] CHIP:TOO: [2]: 4 + + [1690191138.208428][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0006 Attribute 0x0000_FFFB DataVersion: 1862188847 + [1690191138.208435][40907:40909] CHIP:TOO: AttributeList: 11 entries + [1690191138.208438][40907:40909] CHIP:TOO: [1]: 0 + [1690191138.208442][40907:40909] CHIP:TOO: [2]: 16384 + [1690191138.208445][40907:40909] CHIP:TOO: [3]: 16385 + [1690191138.208447][40907:40909] CHIP:TOO: [4]: 16386 + [1690191138.208450][40907:40909] CHIP:TOO: [5]: 16387 + [1690191138.208454][40907:40909] CHIP:TOO: [6]: 65528 + [1690191138.208456][40907:40909] CHIP:TOO: [7]: 65529 + [1690191138.208459][40907:40909] CHIP:TOO: [8]: 65530 + [1690191138.208462][40907:40909] CHIP:TOO: [9]: 65531 + [1690191138.208465][40907:40909] CHIP:TOO: [10]: 65532 + [1690191138.208467][40907:40909] CHIP:TOO: [11]: 65533 + [1690191138.208488][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 516620155 + [1690191138.208494][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries + [1690191138.208500][40907:40909] CHIP:TOO: [1]: { + [1690191138.208502][40907:40909] CHIP:TOO: DeviceType: 256 + [1690191138.208505][40907:40909] CHIP:TOO: Revision: 1 + [1690191138.208508][40907:40909] CHIP:TOO: } + [1690191138.208524][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 516620155 + [1690191138.208530][40907:40909] CHIP:TOO: ServerList: 5 entries + [1690191138.208532][40907:40909] CHIP:TOO: [1]: 4 + [1690191138.208536][40907:40909] CHIP:TOO: [2]: 6 + [1690191138.208539][40907:40909] CHIP:TOO: [3]: 29 + [1690191138.208542][40907:40909] CHIP:TOO: [4]: 47 + [1690191138.208546][40907:40909] CHIP:TOO: [5]: 1030 + [1690191138.208557][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 516620155 + [1690191138.208561][40907:40909] CHIP:TOO: ClientList: 0 entries + disabled: true + + - label: + "Step 5: C.2.10, Validate all the mandatory clusters for the Root Node + Device Type exist on the Root Node endpoint" + verification: | + On TH(chip-tool), Validate all the mandatory clusters(Basic Information(40), Access Control(31), Group Key Management(63) General Commissioning(48), Administrator Commissioning(60), Node Operational Credentials(62), Localization Configuration(43), Time Format Localization(44), Unit Localization(45), General Diagnostics(51), and ICD Management(70)) for the Root Node Device Type exist on the Root Node endpoint(endpoint 0) + + [1690191137.963649][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1390630643 + [1690191137.963657][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries + [1690191137.963663][40907:40909] CHIP:TOO: [1]: { + [1690191137.963665][40907:40909] CHIP:TOO: DeviceType: 22 + [1690191137.963667][40907:40909] CHIP:TOO: Revision: 1 + [1690191137.963669][40907:40909] CHIP:TOO: } + [1690191137.963704][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1390630643 + [1690191137.963712][40907:40909] CHIP:TOO: ServerList: 28 entries + [1690191137.963714][40907:40909] CHIP:TOO: [1]: 3 + [1690191137.963716][40907:40909] CHIP:TOO: [2]: 4 + [1690191137.963717][40907:40909] CHIP:TOO: [3]: 29 + [1690191137.963719][40907:40909] CHIP:TOO: [4]: 30 + [1690191137.963721][40907:40909] CHIP:TOO: [5]: 31 + [1690191137.963723][40907:40909] CHIP:TOO: [6]: 40 + [1690191137.963725][40907:40909] CHIP:TOO: [7]: 42 + [1690191137.963727][40907:40909] CHIP:TOO: [8]: 43 + [1690191137.963729][40907:40909] CHIP:TOO: [9]: 44 + [1690191137.963731][40907:40909] CHIP:TOO: [10]: 45 + [1690191137.963733][40907:40909] CHIP:TOO: [11]: 47 + [1690191137.963735][40907:40909] CHIP:TOO: [12]: 48 + [1690191137.963737][40907:40909] CHIP:TOO: [13]: 49 + [1690191137.963739][40907:40909] CHIP:TOO: [14]: 50 + [1690191137.963742][40907:40909] CHIP:TOO: [15]: 51 + [1690191137.963744][40907:40909] CHIP:TOO: [16]: 52 + [1690191137.963745][40907:40909] CHIP:TOO: [17]: 53 + [1690191137.963747][40907:40909] CHIP:TOO: [18]: 54 + [1690191137.963749][40907:40909] CHIP:TOO: [19]: 55 + [1690191137.963751][40907:40909] CHIP:TOO: [20]: 56 + [1690191137.963753][40907:40909] CHIP:TOO: [21]: 60 + [1690191137.963754][40907:40909] CHIP:TOO: [22]: 62 + [1690191137.963756][40907:40909] CHIP:TOO: [23]: 63 + [1690191137.963758][40907:40909] CHIP:TOO: [24]: 64 + [1690191137.963760][40907:40909] CHIP:TOO: [25]: 65 + [1690191137.963762][40907:40909] CHIP:TOO: [26]: 70 + [1690191137.963764][40907:40909] CHIP:TOO: [27]: 1029 + [1690191137.963766][40907:40909] CHIP:TOO: [28]: 4294048774 + [1690191137.963778][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 + [1690191137.963781][40907:40909] CHIP:TOO: ClientList: 1 entries + [1690191137.963783][40907:40909] CHIP:TOO: [1]: 41 + [1690191137.963795][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 + [1690191137.963799][40907:40909] CHIP:TOO: PartsList: 2 entries + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_SM_1_2.yaml new file mode 100755 index 00000000000000..05286d1a00b825 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SM_1_2.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 54.1.2. [TC-SM-1.2] Device composition - Topology [DUT as Server] + +PICS: + - MCORE.IDM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: + "Step 1: TH performs a wildcard read of all attributes on all + endpoints" + verification: | + TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) + ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF + disabled: true + + - label: + "Step 2: Verify the Descriptor cluster PartsList on endpoint 0 exactly + lists all the other (non-0) endpoints on the DUT - i.e. the endpoints + returned in step 1 (except EP 0) must be listed in the PartsList, and + all endpoints listed in the PartsList must be amongst the endpoint(s) + returned in step 1" + verification: | + On TH(chip-tool), Verify the Descriptor cluster PartsList on endpoint 0 exactly lists all the other (non-0) endpoints in the returned report data Message + below is the sample log provided for the raspi platform: + + [1690193538.813187][43091:43093] CHIP:TOO: [28]: 4294048774 + [1690193538.813213][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 + [1690193538.813220][43091:43093] CHIP:TOO: ClientList: 1 entries + [1690193538.813224][43091:43093] CHIP:TOO: [1]: 41 + [1690193538.813254][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 + [1690193538.813262][43091:43093] CHIP:TOO: PartsList: 2 entries + [1690193538.813268][43091:43093] CHIP:TOO: [1]: 1 + [1690193538.813276][43091:43093] CHIP:TOO: [2]: 2 + [1690193538.813281][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 + [1690193538.813283][43091:43093] CHIP:TOO: FeatureMap: 0 + disabled: true + + - label: + "Step 4: For each endpoint on the DUT (including EP 0), verify the + PartsList in the Descriptor cluster on that endpoint does not include + itself" + verification: | + On TH(chip-tool), verify the PartsList in the Descriptor cluster on that endpoint does not include itself For each endpoint on the DUT (including EP 0) in the returned report data Message + below is the sample log provided for the raspi platform: + + [1690193538.813187][43091:43093] CHIP:TOO: [28]: 4294048774 + [1690193538.813213][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 + [1690193538.813220][43091:43093] CHIP:TOO: ClientList: 1 entries + [1690193538.813224][43091:43093] CHIP:TOO: [1]: 41 + [1690193538.813254][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 + [1690193538.813262][43091:43093] CHIP:TOO: PartsList: 2 entries + [1690193538.813268][43091:43093] CHIP:TOO: [1]: 1 + [1690193538.813276][43091:43093] CHIP:TOO: [2]: 2 + [1690193538.813281][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 + [1690193538.813283][43091:43093] CHIP:TOO: FeatureMap: 0 + + + [1690193538.869392][43091:43093] CHIP:TOO: [68]: 4294048773 + [1690193538.869403][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 2743502132 + [1690193538.869406][43091:43093] CHIP:TOO: ClientList: 1 entries + [1690193538.869408][43091:43093] CHIP:TOO: [1]: 6 + [1690193538.869417][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2743502132 + [1690193538.869420][43091:43093] CHIP:TOO: PartsList: 0 entries + [1690193538.869423][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 2743502132 + [1690193538.869425][43091:43093] CHIP:TOO: FeatureMap: 0 + [1690193538.869433][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 2743502132 + [1690193538.869435][43091:43093] CHIP:TOO: ClusterRevision: 1 + [1690193538.869450][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 2743502132 + [1690193538.869453][43091:43093] CHIP:TOO: GeneratedCommandList: 0 entries + [1690193538.869462][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 2743502132 + [1690193538.869464][43091:43093] CHIP:TOO: AcceptedCommandList: 0 entries + [1690193538.869476][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 2743502132 + [1690193538.869478][43091:43093] CHIP:TOO: EventList: 0 entries + [1690193538.869496][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 2743502132 + + + [1690193539.051392][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 516620155 + [1690193539.051395][43091:43093] CHIP:TOO: ClientList: 0 entries + [1690193539.051410][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 516620155 + [1690193539.051414][43091:43093] CHIP:TOO: PartsList: 0 entries + [1690193539.051418][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 516620155 + [1690193539.051421][43091:43093] CHIP:TOO: FeatureMap: 0 + [1690193539.051435][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 516620155 + [1690193539.051438][43091:43093] CHIP:TOO: ClusterRevision: 1 + [1690193539.051459][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 516620155 + [1690193539.051462][43091:43093] CHIP:TOO: GeneratedCommandList: 0 entries + disabled: true + + - label: + "Step 5: Create two empty list variables flat and tree, For each + non-root endpoint on the DUT, If the DeviceTypeList attribute in the + Descriptor cluster for that endpoint includes the Aggregator device + type(0x000e), add the endpoint id to the flat list, Otherwise, add + the endpoint id to the tree list" + verification: | + + disabled: true + + - label: + "Step 6: For each endpoint e in the tree list, walk the entire + PartsList tree and ensure e does not appear in any descendants." + verification: | + + disabled: true + + - label: + "Step 7: For each endpoint e in the flat list: * for each endpoint id + sub_id present in the in the PartsList of e, ensure that every id + listed in the PartsList for endpoint sub_id appears in the PartsList + of e" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml index ea76d9b267cd75..0d3f6a1e4ca208 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml @@ -11,51 +11,109 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 219.1.1. [TC-TCCM-1.1] Global attributes with DUT as Server config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator And Temperature Controlled Cabinet Mode" + endpoint: 1 tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read cluster-revision 1 1 - - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 1 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: - - [1690189572.337445][16132:16134] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_FFFD DataVersion: 473867547 - [1690189572.337466][16132:16134] CHIP:TOO: ClusterRevision: 1 - disabled: true + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read feature-map 1 1 + command: "readAttribute" + attribute: "FeatureMap" + PICS: "!TCCM.S.F00" + response: + value: 0 + constraints: + type: bitmap32 + + - label: + "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL + be 1 if and only if TCCM.S.F00(DEPONOFF)" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TCCM.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] - On the TH(Chip-tool) Log, Verify featureMap value is 1 If TCCM.S.F00(DEPONOFF) true, Otherwise 0, and below is the sample log provided for the raspi platform: + - label: + "Step 4b: TH reads from the DUT the AttributeList attribute. 0x0002: + SHALL be included if and only if TCCM.S.A0002(StartUpMode)" + PICS: TCCM.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] - [1690189585.723124][16135:16137] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_FFFC DataVersion: 473867547 - [1690189585.723143][16135:16137] CHIP:TOO: FeatureMap: 1 - disabled: true + - label: + "Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003 + SHALL be included if and only if TCCM.S.F00(DEPONOFF)" + PICS: TCCM.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] - - label: "Step 4: TH reads from the DUT the AttributeList attribute." + - label: + "Step 4d: TH reads AttributeList attribute from DUT. 1.The list SHALL + NOT contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - + 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the + allowed MEI range (0x0001 - 0xFFF1))" verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read attribute-list 1 1 Verify the "AttributeList " should include the mandatory attributes (values 0, 1), - - global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and - - list may include optional attribute(value 0x0002), if MOD.S.A0004(StartUpMode) supports, - - list contains feature dependent attribute (values 0x0003), if MOD.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + - Global attributes (value 65533, 65532, 65531, 65530, 65529 and 65528) and + - List may include optional attribute(value 0x0002), if TCCM.S.A0002(StartUpMode) supports, + - List contains feature dependent attribute (values 0x0003), if TCCM.S.F00(DEPONOFF) is true on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1690189598.832157][16140:16142] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_FFFB DataVersion: 473867547 [1690189598.832176][16140:16142] CHIP:TOO: AttributeList: 10 entries @@ -69,34 +127,119 @@ tests: [1690189598.832202][16140:16142] CHIP:TOO: [8]: 65531 [1690189598.832206][16140:16142] CHIP:TOO: [9]: 65532 [1690189598.832210][16140:16142] CHIP:TOO: [10]: 65533 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 5a: TH reads from the DUT the EventList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list - - label: "Step 5: TH reads from the DUT the EventList attribute." + - label: + "Step 5b: TH reads EventList attribute from DUT 1.The list SHALL NOT + contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the + Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignored 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where + XXXX is the allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read event-list 1 1 + Verify "EventList" contains a list of supported events, for this cluster the list is emty(0 entries) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + [1690189614.840538][16147:16149] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_FFFA DataVersion: 473867547 [1690189614.840589][16147:16149] CHIP:TOO: EventList: 0 entries - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute." + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." + - label: + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1. The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and + (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range + (0x0001 - 0xFFF1)" verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read accepted-command-list 1 1 - Verify the "AcceptedCommandList" contains a list of mandatory commands (value 0) on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + Verify Successfully " AcceptedCommandList attribute " on the TH1(Chip-tool) Log: [1690189624.827078][16152:16154] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_FFF9 DataVersion: 473867547 [1690189624.827136][16152:16154] CHIP:TOO: AcceptedCommandList: 1 entries [1690189624.827158][16152:16154] CHIP:TOO: [1]: 0 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." + - label: + "Step 7a: TH reads from the DUT the GeneratedCommandList attribute." + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [1] + + - label: + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and + (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range + (0x0001 - 0xFFF1)" verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read generated-command-list 1 1 - Verify " GeneratedCommandList" contains a list of mandatory commands (value 1) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + Verify Successfully" GeneratedCommandList attribute " on the TH1(Chip-tool) Log: [1690189651.608897][16155:16157] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_FFF8 DataVersion: 473867547 [1690189651.608955][16155:16157] CHIP:TOO: GeneratedCommandList: 1 entries [1690189651.608973][16155:16157] CHIP:TOO: [1]: 1 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_1_2.yaml index 41a95cff88e004..ebeb15ee878c7c 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_1_2.yaml @@ -37,9 +37,9 @@ tests: ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 Verify that the DUT response contains list of ModeOptionsStruct entries. - - Verify that list should contain at least one entry + - Verify that the list has at least 2 and at most 255 entries - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value - - ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster alias tag value (RapidCool, RapidFreeze) or in the MfgTags (0x8000 to 0xBFFF) range + - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster alias tag value (RapidCool, RapidFreeze) or in the MfgTags (0x8000 to 0xBFFF) range - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 - Verify that at least one ModeOptionsStruct entry includes either the RapidCool semantic tag or the RapidFreeze semantic tag in the SemanticTags field - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: @@ -77,7 +77,7 @@ tests: verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read current-mode 1 1 - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer and the value is from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 [1690189682.782276][16162:16164] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0001 DataVersion: 473867547 [1690189682.782314][16162:16164] CHIP:TOO: CurrentMode: 0 @@ -88,7 +88,7 @@ tests: verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read on-mode 1 1 - Verify on TH(chip-tool) logs, OnMode attribute value is an integer and the value is from supported_modes_dut (As per spec default value is null) , below is the sample log provided for the raspi platform, Here OnMode attribute value is Null + Verify on TH(chip-tool) logs, OnMode attribute value is an integer from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here OnMode attribute value is Null [1690189699.711642][16169:16171] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0003 DataVersion: 473867547 [1690189699.711687][16169:16171] CHIP:TOO: OnMode: null @@ -99,7 +99,7 @@ tests: verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read start-up-mode 1 1 - Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer(As per spec default value is null) and value is from supported_modes_dut, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null + Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null [1690189713.973520][16173:16175] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0002 DataVersion: 473867547 [1690189713.973576][16173:16175] CHIP:TOO: StartUpMode: null diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_2_1.yaml index 90b3751ebb632f..fa09a143c70f99 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_2_1.yaml @@ -99,7 +99,7 @@ tests: - label: "Step 5: Manually put the device in a state from which it will FAIL to transition to PIXIT.TCCM.MODE_CHANGE_FAIL" - PICS: PIXIT.TCCM.CAN_TEST_MODE_FAILURE + PICS: TCCM.S.M.CAN_TEST_MODE_FAILURE verification: | Manual operation required disabled: true @@ -119,7 +119,7 @@ tests: - label: "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set to PIXIT.TCCM.MODE_CHANGE_FAIL" - PICS: PIXIT.TCCM.CAN_TEST_MODE_FAILURE && TCCM.S.C00.Rsp + PICS: TCCM.S.M.CAN_TEST_MODE_FAILURE && TCCM.S.C00.Rsp verification: | Note : Please skip this step as SDK is not enabled with this failure response diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml index 0999a37d8a8fae..1f428f9c407901 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml @@ -26,20 +26,51 @@ tests: 1. Refrigerator and Temperature Controlled Cabinet and OnOff clusters are available on the same endpoint 2. The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. - disabled: true - - label: "Note" - verification: | - To execute this test case set onmode to any integer value because as default it value has null. + Read the SupportedModes attribute, select a value from SupportedModes and save the value as OnMode_value + + ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 + + On TH(chip-tool) log, Verify the list of SupportedModes and below is the sample log provided for the raspi platform: + + [1692182446.526184][3967:3969] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0000 DataVersion: 69758028 + [1692182446.526293][3967:3969] CHIP:TOO: SupportedModes: 3 entries + [1692182446.526346][3967:3969] CHIP:TOO: [1]: { + [1692182446.526371][3967:3969] CHIP:TOO: Label: Normal + [1692182446.526395][3967:3969] CHIP:TOO: Mode: 0 + [1692182446.526423][3967:3969] CHIP:TOO: ModeTags: 1 entries + [1692182446.526468][3967:3969] CHIP:TOO: [1]: { + [1692182446.526493][3967:3969] CHIP:TOO: Value: 0 + [1692182446.526516][3967:3969] CHIP:TOO: } + [1692182446.526540][3967:3969] CHIP:TOO: } + [1692182446.526572][3967:3969] CHIP:TOO: [2]: { + [1692182446.526595][3967:3969] CHIP:TOO: Label: Rapid Cool + [1692182446.526617][3967:3969] CHIP:TOO: Mode: 1 + [1692182446.526642][3967:3969] CHIP:TOO: ModeTags: 1 entries + [1692182446.526670][3967:3969] CHIP:TOO: [1]: { + [1692182446.526695][3967:3969] CHIP:TOO: Value: 16384 + [1692182446.526717][3967:3969] CHIP:TOO: } + [1692182446.526741][3967:3969] CHIP:TOO: } + [1692182446.526773][3967:3969] CHIP:TOO: [3]: { + [1692182446.526795][3967:3969] CHIP:TOO: Label: Rapid Freeze + [1692182446.526817][3967:3969] CHIP:TOO: Mode: 2 + [1692182446.526842][3967:3969] CHIP:TOO: ModeTags: 1 entries + [1692182446.526870][3967:3969] CHIP:TOO: [1]: { + [1692182446.526894][3967:3969] CHIP:TOO: Value: 16385 + [1692182446.526917][3967:3969] CHIP:TOO: } + [1692182446.526940][3967:3969] CHIP:TOO: } + + + Set the OnMode attribute value to OnMode_value ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode write on-mode 0 1 1 On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - [1690190139.816096][16383:16385] CHIP:DMG: StatusIB = - [1690190139.816100][16383:16385] CHIP:DMG: { - [1690190139.816102][16383:16385] CHIP:DMG: status = 0x00 (SUCCESS), - [1690190139.816105][16383:16385] CHIP:DMG: }, + [1692170913.264454][3071:3073] CHIP:DMG: StatusIB = + [1692170913.264489][3071:3073] CHIP:DMG: { + [1692170913.264522][3071:3073] CHIP:DMG: status = 0x00 (SUCCESS), + [1692170913.264557][3071:3073] CHIP:DMG: }, disabled: true - label: @@ -54,7 +85,7 @@ tests: verification: | ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read on-mode 1 1 - On TH(chip-tool), Verify that OnMode attribute value is an integer or Null + On TH(chip-tool), Verify that OnMode attribute value is an integer Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 [1690190167.005388][16387:16389] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0003 DataVersion: 473867556 diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml index d7283b93401d3b..a27a8f2400623a 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml @@ -24,7 +24,12 @@ config: endpoint: 0 tests: - - label: "Note" + - label: "Preconditions" + verification: | + !TCCM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL + disabled: true + + - label: "NOTE" verification: | To Execute the TC-TCCM-3.2 test case using reboot in raspi device we followed the below suggested way: @@ -54,7 +59,6 @@ tests: - If startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. - Here startup_mode_dut is null proceed to step 3. - [1690541247.515223][2594:2596] CHIP:DMG: } [1690541247.521286][2594:2596] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0002 DataVersion: 667171525 [1690541247.523875][2594:2596] CHIP:TOO: StartUpMode: null disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml index f8f067844dcc96..a7b94787d6ed7d 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml @@ -117,7 +117,7 @@ tests: - label: "Step 5: TH reads from the DUT the OnMode attribute." PICS: TCCM.S.A0003 && TCCM.S.A0002 verification: | - Set onmode to any integer value because as default it value has null. + As default value of OnMode attribute is NULL. Set the OnMode to any mode value listed in the SupportedModes entries. ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode write on-mode 0 1 1 @@ -131,7 +131,7 @@ tests: ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read on-mode 1 1 On TH(chip-tool), Verify that OnMode attribute value is an integer - -Save the value as old_on_mode_du, t below is the sample log provided for the raspi platform, here OnMode attribute value is 0 + - Save the value as old_on_mode_dut, below is the sample log provided for the raspi platform, here OnMode attribute value is 0 [1690190846.367481][16585:16587] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0003 DataVersion: 978521150 [1690190846.367522][16585:16587] CHIP:TOO: OnMode: 0 diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml index b86b24051b7926..872be87ac0bdaf 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 178.1.1. [TC-TCTL-1.1] Global attributes with DUT as Server @@ -20,50 +19,135 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Temperature Control" + endpoint: 1 tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "Step 3a: TH reads from the DUT the FeatureMap attribute" + command: "readAttribute" + attribute: "FeatureMap" + PICS: "!TCTL.S.F00 && !TCTL.S.F01 && !TCTL.S.F02" + response: + value: 0 + constraints: + type: bitmap32 + - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | + "Step 3b: TH reads from the DUT the FeatureMap attribute. bit 0: SHALL + be 1 if and only if TCTL.S.F00(TN) & !TCTL.S.F01(TL)" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TCTL.S.F00 && !TCTL.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - disabled: true + - label: + "Step 3c: TH reads from the DUT the FeatureMap attribute. bit 1: SHALL + be 1 if and only if TCTL.S.F01(TL) & !TCTL.S.F00(TN)" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TCTL.S.F01 && !TCTL.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - verification: | - ./chip-tool temperaturecontrol read cluster-revision 1 1 - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 1 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: - - [1689770372.878629][9188:9190] CHIP:DMG: } - [1689770372.878690][9188:9190] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_FFFD DataVersion: 2844459846 - [1689770372.878714][9188:9190] CHIP:TOO: ClusterRevision: 1 - [1689770372.878763][9188:9190] CHIP:EM: <<< [E:16332i S:45296 M:45197941 (Ack:243112600)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689770372.878774][9188:9190] CHIP:IN: (S) Sending msg 45197941 on secure session with LSID: 45296 - [1689770372.878797][9188:9190] CHIP:EM: Flushed pending ack for MessageCounter:243112600 on exchange 16332i - disabled: true - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - verification: | - ./chip-tool temperaturecontrol read feature-map 1 1 - On TH(chip-tool), verify that DUT responds the Featuremap value as 2 and below is the sample log provided for the raspi platform: - - [1689770405.503132][9196:9198] CHIP:DMG: InteractionModelRevision = 1 - [1689770405.503140][9196:9198] CHIP:DMG: } - [1689770405.503215][9196:9198] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_FFFC DataVersion: 2844459846 - [1689770405.503248][9196:9198] CHIP:TOO: FeatureMap: 2 - [1689770405.503310][9196:9198] CHIP:EM: <<< [E:40699i S:20178 M:144688303 (Ack:177462983)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689770405.503325][9196:9198] CHIP:IN: (S) Sending msg 144688303 on secure session with LSID: 20178 - [1689770405.503372][9196:9198] CHIP:EM: Flushed pending ack for MessageCounter:177462983 on exchange 40699i - disabled: true - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." + - label: + "Step 3d: TH reads from the DUT the FeatureMap attribute. bit 2: SHALL + be 1 if and only if TCTL.S.F02(A_STEP) & TCTL.S.F00(TN)" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TCTL.S.F02 && !TCTL.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65531, 65532, 65533] + + - label: + "Step 4b: TH reads from the DUT the AttributeList attribute. 0x0000, + 0x0001, 0x0002: SHALL be included if and only if TCTL.S.F00(TN)" + PICS: TCTL.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 2] + + - label: + "Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003: + SHALL be included if and only if TCTL.S.F02(A_STEP)" + PICS: TCTL.S.F02 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: + "Step 4d: TH reads from the DUT the AttributeList attribute. 0x0004 & + 0x0005: SHALL be included if and only if TCTL.S.F01(TL)" + PICS: TCTL.S.F01 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [4, 5] + + - label: + "Step 4e: TH reads AttributeList attribute from DUT 1.The list SHALL + NOT contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list + MAY contain values in the Manufacturer Extensible Identifier (MEI) + range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI + range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list + SHALL NOT contain any values in the Test Vendor or invalid range: + (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - + 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the + allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool temperaturecontrol read attribute-list 1 1 Verify " AttributeList " value consists the list of mandatory attributes (65533, 65532, 65531, 65529, 65528) and it may include the optional attributes(0, 1, 2,3,4 and 5) on the TH(Chip-tool) Log: - Below is the sample log provided for the raspi platform: + [1689770447.604182][9210:9212] CHIP:DMG: InteractionModelRevision = 1 [1689770447.604188][9210:9212] CHIP:DMG: } [1689770447.604313][9210:9212] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_FFFB DataVersion: 2844459846 @@ -80,14 +164,38 @@ tests: [1689770447.604489][9210:9212] CHIP:IN: (S) Sending msg 231380196 on secure session with LSID: 24852 [1689770447.604514][9210:9212] CHIP:EM: Flushed pending ack for MessageCounter:110557130 on exchange 34971i [1689770447.604623][9210:9210] CHIP:CTL: Shutting down the commissioner - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 5a: TH reads from the DUT the AcceptedCommandList attribute." + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] - - label: "Step 5: TH reads from the DUT the AcceptedCommandList attribute." + - label: + "Step 5b: TH reads AcceptedCommandList attribute from DUT 1.The list + SHALL NOT contain any additional values in the standard or scoped + range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in + the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignored 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where + XXXX is the allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool temperaturecontrol read accepted-command-list 1 1 Verify " AcceptedCommandList " consists the list of all mandatory commands(0) on the TH(Chip-tool) Log: - Below is the sample log provided for the raspi platform: [1689770504.251374][9226:9228] CHIP:DMG: InteractionModelRevision = 1 [1689770504.251377][9226:9228] CHIP:DMG: } @@ -97,13 +205,39 @@ tests: [1689770504.251446][9226:9228] CHIP:EM: <<< [E:6933i S:52597 M:176057927 (Ack:264727649)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) [1689770504.251450][9226:9228] CHIP:IN: (S) Sending msg 176057927 on secure session with LSID: 52597 [1689770504.251461][9226:9228] CHIP:EM: Flushed pending ack for MessageCounter:264727649 on exchange 6933i - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Step 6a: TH reads from the DUT the GeneratedCommandList attribute." + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [] - - label: "Step 6: TH reads from the DUT the GeneratedCommandList attribute." + - label: + "Step 6b: TH reads GeneratedCommandList attribute from DUT.The list + SHALL NOT contain any additional values in the standard or scoped + range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in + the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignored 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where + XXXX is the allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool temperaturecontrol read generated-command-list 1 1 - Verify " GeneratedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + Verify " GeneratedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: [1689770475.939806][9215:9217] CHIP:DMG: InteractionModelRevision = 1 [1689770475.939807][9215:9217] CHIP:DMG: } @@ -112,12 +246,40 @@ tests: [1689770475.939868][9215:9217] CHIP:EM: <<< [E:56043i S:30992 M:36313621 (Ack:205412119)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) [1689770475.939872][9215:9217] CHIP:IN: (S) Sending msg 36313621 on secure session with LSID: 30992 [1689770475.939880][9215:9217] CHIP:EM: Flushed pending ack for MessageCounter:205412119 on exchange 56043i - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Step 7: TH reads from the DUT the EventList attribute." + - label: "Step 7a: Read the global attribute: EventList" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list + + - label: + "Step 7b: TH reads EventList attribute from DUT. 1.The list SHALL NOT + contain any additional values in the standard or scoped range: + (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the + Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - + 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), + these values SHALL be ignored. 3.The list SHALL NOT contain any values + in the Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), + (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where + XXXX is the allowed MEI range (0x0001 - 0xFFF1)" verification: | ./chip-tool temperaturecontrol read event-list 1 1 + Verify " EventList attribute " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + [1689770528.788582][9233:9235] CHIP:DMG: InteractionModelRevision = 1 [1689770528.788587][9233:9235] CHIP:DMG: } [1689770528.788671][9233:9235] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_FFFA DataVersion: 2844459846 @@ -127,4 +289,12 @@ tests: [1689770528.788826][9233:9235] CHIP:EM: Flushed pending ack for MessageCounter:64478273 on exchange 60387i [1689770528.788927][9233:9233] CHIP:CTL: Shutting down the commissioner [1689770528.788948][9233:9233] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml index a31f3ccf9a1775..4496be8836d46d 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml @@ -26,18 +26,51 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + - label: "Step 1: Commission DUT to TH" verification: | disabled: true - - label: "Step 2: TH reads from the DUT the TCTL.S.A0003(Step) attribute" + - label: "Step 2: TH reads from the DUT the MinTemperature attribute" + PICS: TCTL.S.A0001 + verification: | + ./chip-tool temperaturecontrol read min-temperature 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). + + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0001 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: min-temperature: 0 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: "Step 3: TH reads from the DUT the MaxTemperature attribute" + PICS: TCTL.S.A0002 + verification: | + ./chip-tool temperaturecontrol read max-temperature 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperature with value greater than TCTL.S.A0001(MinTemperature). + + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0002 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: max-temperature :0 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: "Step 4: TH reads from the DUT the Step attribute" PICS: TCTL.S.A0003 verification: | ./chip-tool temperaturecontrol read step 1 1 On TH(chip-tool), Verify that the DUT response contains a temperature value <= TCTL.S.A0002(MaxTemperature) - TCTL.S.A0001(MinTemperature) - and (TCTL.S.A0002(MaxTemperature) - TCTL.S.A0001(MinTemperature)) % TCTL.S.A0003(Step) == 0 + and (TCTL.S.A0002(MaxTemperature) - TCTL.S.A0001(MinTemperature)) % DUT response == 0 [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, @@ -47,3 +80,18 @@ tests: [1689770673.417946][9280:9282] CHIP:TOO: step: 0 [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true + + - label: "Step 5: TH reads from the DUT the TemperatureSetpoint attribute" + PICS: TCTL.S.A0000 + verification: | + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperature with value between minTemperature and maxTemperature inclusive. + and and (temperature value - minTemperature) % the received value of the Step attribute from step 4 == 0. + + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 0 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml index 7806d2fce732ab..286f41e28396b0 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml @@ -27,13 +27,18 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + - label: "Step 1: Commission DUT to TH" verification: | disabled: true - - label: "Step 2: TH reads from the DUT the TemperatureSetpoint attribute" - PICS: TCTL.S.A0000 + - label: "Step 2: TH reads from the DUT the MinTemperature attribute" + PICS: TCTL.S.A0001 verification: | ./chip-tool temperaturecontrol read temperature-setpoint 1 1 On TH(chip-tool), Verify that the DUT response contains a temperature with value between MinTemperature and TCTL.S.A0002(MaxTemperature) inclusive. @@ -46,11 +51,11 @@ tests: [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - - label: "Step 3: TH reads from the DUT the MinTemperature attribute" - PICS: TCTL.S.A0001 + - label: "Step 3: TH reads from the DUT the MaxTemperature attribute" + PICS: TCTL.S.A0002 verification: | ./chip-tool temperaturecontrol read min-temperature 1 1 - on TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). + On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 @@ -60,8 +65,8 @@ tests: [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - - label: "Step 4: TH reads from the DUT the MaxTemperature attribute" - PICS: TCTL.S.A0002 + - label: "Step 4: TH reads from the DUT the TemperatureSetpoint attribute" + PICS: TCTL.S.A0000 verification: | ./chip-tool temperaturecontrol read max-temperature 1 1 diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml index e901d20aff6a9c..ba8136173dcc58 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml @@ -27,6 +27,11 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + While verifying below test case we will get 0 and null value for few attributes, as per spec 0 and null value is default for those attributes. + disabled: true + - label: "Step 1: Commission DUT to TH" verification: | diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml index 11d43b19367a6e..79b3ca1c190665 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml @@ -27,35 +27,225 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + + While verifying below test case we will get 0 and null value for few attributes, as per spec 0 and null value is default for those attributes. + disabled: true + - label: "Step 1: Commission DUT to TH" verification: | disabled: true - - label: "Step 2: TH writes a valid value to DUT" + - label: + "Step 2: Operate device such that a temperature number can be accepted" + verification: | + Operate device such that a temperature number can be accepted + disabled: true + + - label: "Step 3: TH reads from the DUT the MinTemperature attribute" + PICS: TCTL.S.A0001 + verification: | + ./chip-tool temperaturecontrol read min-temperature 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). + + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0001 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: MinTemperature: 0 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: "Step 4: TH reads from the DUT the MaxTemperature attribute" + PICS: TCTL.S.A0002 + verification: | + ./chip-tool temperaturecontrol read max-temperature 1 1 + + On TH(chip-tool), Verify that the DUT response contains a temperature with value greater than TCTL.S.A0001(MinTemperature). + + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0002 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: MaxTemperature: 0 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: + "Step 5: TH sends command SetTemperatureCommand with a temperature + number between minTemp and maxTemp inclusive, saved as setTemp." PICS: TCTL.S.C00.Rsp verification: | - ./chip-tool temperaturecontrol set-temperature 1 1 + ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperature <5> + On TH(chip-tool), Verify that the DUT response contains SUCCESS + [1692260094.059761][13707:13710] CHIP:DMG: ICR moving to [ResponseRe] + [1692260094.059828][13707:13710] CHIP:DMG: InvokeResponseMessage = + [1692260094.059862][13707:13710] CHIP:DMG: { + [1692260094.059895][13707:13710] CHIP:DMG: suppressResponse = false, + [1692260094.059929][13707:13710] CHIP:DMG: InvokeResponseIBs = + [1692260094.059971][13707:13710] CHIP:DMG: [ + [1692260094.060005][13707:13710] CHIP:DMG: InvokeResponseIB = + [1692260094.060051][13707:13710] CHIP:DMG: { + [1692260094.060094][13707:13710] CHIP:DMG: CommandStatusIB = + [1692260094.060134][13707:13710] CHIP:DMG: { + [1692260094.060173][13707:13710] CHIP:DMG: CommandPathIB = + [1692260094.060217][13707:13710] CHIP:DMG: { + [1692260094.060261][13707:13710] CHIP:DMG: EndpointId = 0x1, + [1692260094.060310][13707:13710] CHIP:DMG: ClusterId = 0x56, + [1692260094.060356][13707:13710] CHIP:DMG: CommandId = 0x0, + [1692260094.060402][13707:13710] CHIP:DMG: }, + [1692260094.060452][13707:13710] CHIP:DMG: + [1692260094.060493][13707:13710] CHIP:DMG: StatusIB = + [1692260094.060539][13707:13710] CHIP:DMG: { + [1692260094.060584][13707:13710] CHIP:DMG: status = 0x00 (SUCCESS), + [1692260094.060629][13707:13710] CHIP:DMG: }, + [1692260094.060674][13707:13710] CHIP:DMG: + [1692260094.060712][13707:13710] CHIP:DMG: }, + [1692260094.060756][13707:13710] CHIP:DMG: + [1692260094.060792][13707:13710] CHIP:DMG: }, + [1692260094.060834][13707:13710] CHIP:DMG: + [1692260094.060867][13707:13710] CHIP:DMG: ], + [1692260094.060909][13707:13710] CHIP:DMG: + [1692260094.060942][13707:13710] CHIP:DMG: InteractionModelRevision = 10 + [1692260094.060975][13707:13710] CHIP:DMG: }, + [1692260094.061064][13707:13710] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x85 + [1692260094.061110][13707:13710] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) disabled: true - label: - "Step 3: after a few seconds, TH reads from the DUT the - TemperatureSetpoint attribute" + "Step 6: After a few seconds, TH reads from the DUT the + TemperatureSetpoint attribute." PICS: TCTL.S.A0000 verification: | - + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 5 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - - label: "Step 4: TH writes an invalid value to DUT" + - label: + "Step 7: TH sends command SetTemperatureCommand with an invalid value." PICS: TCTL.S.C00.Rsp verification: | - + ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperature <100> + On TH(chip-tool), Verify DUT responds with status CONSTRAINT_ERROR(0x87) + [1692260094.059761][13707:13710] CHIP:DMG: ICR moving to [ResponseRe] + [1692260094.059828][13707:13710] CHIP:DMG: InvokeResponseMessage = + [1692260094.059862][13707:13710] CHIP:DMG: { + [1692260094.059895][13707:13710] CHIP:DMG: suppressResponse = false, + [1692260094.059929][13707:13710] CHIP:DMG: InvokeResponseIBs = + [1692260094.059971][13707:13710] CHIP:DMG: [ + [1692260094.060005][13707:13710] CHIP:DMG: InvokeResponseIB = + [1692260094.060051][13707:13710] CHIP:DMG: { + [1692260094.060094][13707:13710] CHIP:DMG: CommandStatusIB = + [1692260094.060134][13707:13710] CHIP:DMG: { + [1692260094.060173][13707:13710] CHIP:DMG: CommandPathIB = + [1692260094.060217][13707:13710] CHIP:DMG: { + [1692260094.060261][13707:13710] CHIP:DMG: EndpointId = 0x1, + [1692260094.060310][13707:13710] CHIP:DMG: ClusterId = 0x56, + [1692260094.060356][13707:13710] CHIP:DMG: CommandId = 0x0, + [1692260094.060402][13707:13710] CHIP:DMG: }, + [1692260094.060452][13707:13710] CHIP:DMG: + [1692260094.060493][13707:13710] CHIP:DMG: StatusIB = + [1692260094.060539][13707:13710] CHIP:DMG: { + [1692260094.060584][13707:13710] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), + [1692260094.060629][13707:13710] CHIP:DMG: }, + [1692260094.060674][13707:13710] CHIP:DMG: + [1692260094.060712][13707:13710] CHIP:DMG: }, + [1692260094.060756][13707:13710] CHIP:DMG: + [1692260094.060792][13707:13710] CHIP:DMG: }, + [1692260094.060834][13707:13710] CHIP:DMG: + [1692260094.060867][13707:13710] CHIP:DMG: ], + [1692260094.060909][13707:13710] CHIP:DMG: + [1692260094.060942][13707:13710] CHIP:DMG: InteractionModelRevision = 10 + [1692260094.060975][13707:13710] CHIP:DMG: }, + [1692260094.061064][13707:13710] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x85 + [1692260094.061110][13707:13710] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) disabled: true - label: - "Step 5: after a few seconds, TH reads from the DUT the - TemperatureSetpoint attribute" + "Step 8: After a few seconds, TH reads from the DUT the + TemperatureSetpoint attribute." PICS: TCTL.S.A0000 verification: | + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 5 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) + disabled: true + + - label: + "Step 9: Operate device such that a temperature number cannot be + accepted" + PICS: TCTL.S.M.SupportsInvalidInMode + verification: | + Operate device such that a temperature number cannot be accepted + disabled: true + + - label: + "Step 10: TH sends command SetTemperatureCommand with a temperature + number between minTemp and maxTemp inclusive that is different from + setTemp." + PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.C00.Rsp + verification: | + ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperature <50> + On TH(Chip-tool), Verify that the DUT response contains INVALID_IN_MODE + [1692260094.059761][13707:13710] CHIP:DMG: ICR moving to [ResponseRe] + [1692260094.059828][13707:13710] CHIP:DMG: InvokeResponseMessage = + [1692260094.059862][13707:13710] CHIP:DMG: { + [1692260094.059895][13707:13710] CHIP:DMG: suppressResponse = false, + [1692260094.059929][13707:13710] CHIP:DMG: InvokeResponseIBs = + [1692260094.059971][13707:13710] CHIP:DMG: [ + [1692260094.060005][13707:13710] CHIP:DMG: InvokeResponseIB = + [1692260094.060051][13707:13710] CHIP:DMG: { + [1692260094.060094][13707:13710] CHIP:DMG: CommandStatusIB = + [1692260094.060134][13707:13710] CHIP:DMG: { + [1692260094.060173][13707:13710] CHIP:DMG: CommandPathIB = + [1692260094.060217][13707:13710] CHIP:DMG: { + [1692260094.060261][13707:13710] CHIP:DMG: EndpointId = 0x1, + [1692260094.060310][13707:13710] CHIP:DMG: ClusterId = 0x56, + [1692260094.060356][13707:13710] CHIP:DMG: CommandId = 0x0, + [1692260094.060402][13707:13710] CHIP:DMG: }, + [1692260094.060452][13707:13710] CHIP:DMG: + [1692260094.060493][13707:13710] CHIP:DMG: StatusIB = + [1692260094.060539][13707:13710] CHIP:DMG: { + [1692260094.060584][13707:13710] CHIP:DMG: status = 0x03(INVALID_IN_MODE) + [1692260094.060629][13707:13710] CHIP:DMG: }, + [1692260094.060674][13707:13710] CHIP:DMG: + [1692260094.060712][13707:13710] CHIP:DMG: }, + [1692260094.060756][13707:13710] CHIP:DMG: + [1692260094.060792][13707:13710] CHIP:DMG: }, + [1692260094.060834][13707:13710] CHIP:DMG: + [1692260094.060867][13707:13710] CHIP:DMG: ], + [1692260094.060909][13707:13710] CHIP:DMG: + [1692260094.060942][13707:13710] CHIP:DMG: InteractionModelRevision = 10 + [1692260094.060975][13707:13710] CHIP:DMG: }, + [1692260094.061064][13707:13710] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x85 + [1692260094.061110][13707:13710] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) + disabled: true + - label: + "Step 11: after a few seconds, TH reads from the DUT the + TemperatureSetpoint attribute." + PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.A0000 + verification: | + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 + [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, + [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 + [1689770673.417851][9280:9282] CHIP:DMG: } + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 5 + [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml index 24b4c98c3040a8..5ecfe9666a2471 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml @@ -27,23 +27,115 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + + While verifying below test case we will get 0 and null value for few attributes, as per spec 0 and null value is default for those attributes. + disabled: true + - label: "Step 1: Commission DUT to TH" verification: | disabled: true - label: - "Step 2: TH writes a valid value to DUT within the range of - SupportedTemperatureLevels" - PICS: TCTL.S.C00.Rsp + "Step 2: Operate device such that a temperature level can be accepted" verification: | + Operate device such that a temperature level can be accepted + disabled: true + - label: + "Step 3: TH reads from the DUT the SupportedTemperatureLevels + attribute" + PICS: TCTL.S.A0005 + verification: | + ./chip-tool temperaturecontrol read supported-temperature-levels 1 1 + On TH(chip-tool), Verify that the DUT response contains a list of up to 32 strings with each string length not exceeding 16 characters. + [1689770716.974439][9291:9293] CHIP:DMG: SuppressResponse = true, + [1689770716.974446][9291:9293] CHIP:DMG: InteractionModelRevision = 1 + [1689770716.974451][9291:9293] CHIP:DMG: } + [1689770716.974558][9291:9293] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0005 DataVersion: 2844459846 + [1689770716.974594][9291:9293] CHIP:TOO: SupportedTemperatureLevels: 3 entries + [1689770716.974607][9291:9293] CHIP:TOO: [1]: Hot + [1689770716.974614][9291:9293] CHIP:TOO: [2]: Warm + [1689770716.974620][9291:9293] CHIP:TOO: [3]: Freezing + [1689770716.974685][9291:9293] CHIP:EM: <<< [E:59031i S:44407 M:101895658 (Ack:80765321)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689770716.974699][9291:9293] CHIP:IN: (S) Sending msg 101895658 on secure session with LSID: 44407 + [1689770716.974728][9291:9293] CHIP:EM: Flushed pending ack for MessageCounter:80765321 on exchange 59031i + disabled: true + + - label: + "Step 4: TH sends command SetTemperatureCommand with a value from + supportedLevels saved as setLevel" + PICS: TCTL.S.C00.Rsp + verification: | + ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperatureLevel 1 + On TH(chip-tool), Verify that the DUT response contains SUCCESS + [1692265679.055214][13978:13980] CHIP:DMG: ], + [1692265679.055279][13978:13980] CHIP:DMG: + [1692265679.055306][13978:13980] CHIP:DMG: InteractionModelRevision = 10 + [1692265679.055329][13978:13980] CHIP:DMG: }, + [1692265679.055422][13978:13980] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x0 + [1692265679.055501][13978:13980] CHIP:DMG: ICR moving to [AwaitingDe] + [1692265679.055673][13978:13980] CHIP:EM: <<< [E:45460i S:40447 M:82497399 (Ack:231075843)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1692265679.055722][13978:13980] CHIP:IN: (S) Sending msg 82497399 on secure session with LSID: 40447 disabled: true - label: - "Step 3: after a few seconds, TH reads from the DUT the + "Step 5: After a few seconds, TH reads from the DUT the SelectedTemperatureLevel attribute" PICS: TCTL.S.A0004 verification: | + ./chip-tool temperaturecontrol read selected-temperature-level 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setLevel value written in step 4 + [1692265713.881978][13985:13987] CHIP:DMG: } + [1692265713.882145][13985:13987] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0004 DataVersion: 3892542637 + [1692265713.882212][13985:13987] CHIP:TOO: SelectedTemperatureLevel: 1 + [1692265713.882429][13985:13987] CHIP:EM: <<< [E:46803i S:60267 M:79585227 (Ack:218909199)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1692265713.882475][13985:13987] CHIP:IN: (S) Sending msg 79585227 on secure session with LSID: 60267 + [1692265713.882578][13985:13987] CHIP:EM: Flushed pending ack for MessageCounter:218909199 on exchange 46803i + disabled: true + + - label: + "Step 6: Operate device such that a temperature level cannot be + accepted" + PICS: TCTL.S.M.SupportsInvalidInMode + verification: | + Operate device such that a temperature level cannot be accepted + disabled: true + + - label: + "Step 7: TH sends command SetTemperatureCommand with a value from + supportedLevels that is different from setLevel" + PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.C00.Rsp + verification: | + ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperatureLevel 3 + On TH(chip-tool), Verify that the DUT response contains CONSTRAINT_ERROR + [1692265766.674998][13994:13996] CHIP:DMG: + [1692265766.675028][13994:13996] CHIP:DMG: InteractionModelRevision = 10 + [1692265766.675058][13994:13996] CHIP:DMG: }, + [1692265766.675136][13994:13996] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x87 + [1692265766.675180][13994:13996] CHIP:TOO: Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) + [1692265766.675227][13994:13996] CHIP:DMG: ICR moving to [AwaitingDe] + [1692265766.675356][13994:13996] CHIP:EM: <<< [E:29432i S:48831 M:234714759 (Ack:36101797)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1692265766.675409][13994:13996] CHIP:IN: (S) Sending msg 234714759 on secure session with LSID: 48831 + [1692265766.675519][13994:13996] CHIP:EM: Flushed pending ack for MessageCounter:36101797 on exchange 29432i + disabled: true + - label: + "Step 8: after a few seconds, TH reads from the DUT the + SelectedTemperatureLevel attribute" + PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.A0004 + verification: | + ./chip-tool temperaturecontrol read selected-temperature-level 1 1 + On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setLevel value written in step 4 + [1692265822.762570][14005:14007] CHIP:DMG: SuppressResponse = true, + [1692265822.762602][14005:14007] CHIP:DMG: InteractionModelRevision = 10 + [1692265822.762631][14005:14007] CHIP:DMG: } + [1692265822.762811][14005:14007] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0004 DataVersion: 3892542639 + [1692265822.762940][14005:14007] CHIP:TOO: SelectedTemperatureLevel: 1 + [1692265822.763134][14005:14007] CHIP:EM: <<< [E:14178i S:20433 M:165826928 (Ack:66881663)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1692265822.763186][14005:14007] CHIP:IN: (S) Sending msg 165826928 on secure session with LSID: 20433 + [1692265822.763307][14005:14007] CHIP:EM: Flushed pending ack for MessageCounter:66881663 on exchange 14178i disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml index cefd166e28065b..f59aee73ca7686 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml @@ -31,27 +31,13 @@ tests: - name: "nodeId" value: nodeId - #Issue: https://github.com/project-chip/connectedhomeip/issues/26601 - label: "Step 2: Read the global attribute: ClusterRevision" - verification: | - ./chip-tool thermostat read cluster-revision 1 1 - - On TH(chip-tool), verify that DUT responsds ClusterRevision attribute value as 6 - - [1654082369.006076][7829:7834] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_FFFD DataVersion: 2954689426 - [1654082369.006146][7829:7834] CHIP:TOO: ClusterRevision: 5 - [1654082369.006241][7829:7834] CHIP:EM: Sending Standalone Ack for MessageCounter:4310083 on exchange 63290i - - This log and comment are as per the latest sdk but the vaue is wrong https://github.com/project-chip/connectedhomeip/issues/26601 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 6 + constraints: + type: int16u - label: "Step 3a: Read the global attribute: FeatureMap" PICS: diff --git a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_1.yaml b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_1.yaml deleted file mode 100644 index 1984d4bf492274..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_1.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 185.2.3. [TC-WASHERCTRL-3.1] Rinse functionality with DUT as Server - -PICS: - - WASHERCTRL.S.F01 - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true - - - label: - "Step 2: TH writes a supported NumberOfRinses attribute to DUT within - the range of the enum provided with a max value of 4." - PICS: WASHERCTRL.S.A0002 - verification: | - Verify DUT responds w/ status SUCCESS(0x00) - disabled: true - - - label: - "Step 3: after a few seconds, TH reads from the DUT the NumberOfRinses - attribute" - PICS: WASHERCTRL.S.A0002 - verification: | - Value is the same as was written in step 2 - disabled: true - - - label: - "Step 4: TH writes an unsupported NumberOfRinses attribute to DUT - while DUT is not in a valid state." - PICS: WASHERCTRL.S.A0002 - verification: | - Verify that the DUT response contains Status INVALID_IN_STATE response - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_2.yaml b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_2.yaml deleted file mode 100644 index 77887e90905629..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_3_2.yaml +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 185.2.4. [TC-WASHERCTRL-3.2] Optional spin functionality with DUT as Server - -PICS: - - WASHERCTRL.S.F00 - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true - - - label: - "Step 2: TH writes a supported SpinSpeedCurrent attribute that is - other than 0 to DUT" - PICS: WASHERCTRL.S.A0001 - verification: | - Verify DUT responds w/ status SUCCESS(0x00) - disabled: true - - - label: - "Step 3: after a few seconds, TH reads from the DUT the - SpinSpeedCurrent attribute" - PICS: WASHERCTRL.S.A0001 - verification: | - Value is the same as was written in step 2 - disabled: true - - - label: - "Step 4: TH writes an unsupported SpinSpeedCurrent attribute that is - other than 0 to DUT" - PICS: WASHERCTRL.S.A0001 - verification: | - Verify that the DUT response contains Status CONSTRAINT_ERROR response - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml index 80c25bb1d0cfe2..3359307064a0fb 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml @@ -165,80 +165,76 @@ tests: # The value of bit 0..1 must be 01b & if (LF) value of bit 2..3 must be 01b else 00b & if (TL) value of bit 4..5 must be 01b else 00b # Only 3 possibilities are possible here : 05h = 5, 11h = 17 or 15h = 21 then check a range for simplicity [5 - 21] - label: "Step 3a: TH reads OperationalStatus attribute's bit 0..1" - PICS: WNCV.S.A000a && PICS_SDK_CI_ONLY + PICS: WNCV.S.A000a command: "readAttribute" attribute: "OperationalStatus" response: + saveAs: OperationalStatusValue constraints: type: bitmap8 hasMasksSet: [0x1] hasMasksClear: [0x2] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 2..3 - (WNCV.S.F00(LF))" - PICS: WNCV.S.A000a && WNCV.S.F00 && PICS_SDK_CI_ONLY + "Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do + the bits checks in upcoming OperationalStatus read steps." + PICS: WNCV.S.A000a + cluster: "Unit Testing" + command: "writeAttribute" + attribute: "bitmap8" + arguments: + value: OperationalStatusValue + + - label: + "Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + PICS: WNCV.S.A000a && WNCV.S.F00 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksSet: [0x4] hasMasksClear: [0x8] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 2..3 - (WNCV.S.F00(LF))" - PICS: WNCV.S.A000a && !WNCV.S.F00 && PICS_SDK_CI_ONLY + "Step 3a: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + PICS: WNCV.S.A000a && !WNCV.S.F00 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksClear: [0x4, 0x8] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 4..5 - (WNCV.S.F01(TL))" - PICS: WNCV.S.A000a && WNCV.S.F01 && PICS_SDK_CI_ONLY + "Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + PICS: WNCV.S.A000a && WNCV.S.F01 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksSet: [0x10] hasMasksClear: [0x20] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 4..5 - (WNCV.S.F01(TL))" - PICS: WNCV.S.A000a && !WNCV.S.F01 && PICS_SDK_CI_ONLY + "Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + PICS: WNCV.S.A000a && !WNCV.S.F01 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksClear: [0x10, 0x20] - #Issue https://github.com/CHIP-Specifications/chip-test-scripts/issues/509 - - label: "Step 3a: TH reads OperationalStatus attribute from DUT" - verification: | - ./chip-tool windowcovering read operational-status 1 1 - - Verify "OperationalStatus " on the TH(Chip-tool) Log: is currently not zero and is in opening mode - - [1650883032.948262][8712:8718] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0102 Attribute 0x0000_000A DataVersion: 366273196 - [1650883032.948351][8712:8718] CHIP:TOO: OperationalStatus: 21 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - ### Depending on the DUT specs we might prefer a arguments here - label: "Step 3a2: DUT updates its attributes" cluster: "DelayCommands" diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml index 0a4746a05526c1..7c710cf5be394f 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml @@ -165,82 +165,76 @@ tests: # The value of bit 0..1 must be 10b & if (LF) value of bit 2..3 must be 10b else 00b & if (TL) value of bit 4..5 must be 10b else 00b # Only 3 possibilities are possible here : 0Ah = 10, 22h = 34 or 2Ah = 42 then check a range for simplicity [10 - 42] - label: "Step 3a: TH reads OperationalStatus attribute's bit 0..1" - PICS: WNCV.S.A000a && PICS_SDK_CI_ONLY + PICS: WNCV.S.A000a command: "readAttribute" attribute: "OperationalStatus" response: + saveAs: OperationalStatusValue constraints: type: bitmap8 hasMasksSet: [0x2] hasMasksClear: [0x1] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 2..3 - (WNCV.S.F00(LF))" - PICS: WNCV.S.A000a && WNCV.S.F00 && PICS_SDK_CI_ONLY + "Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do + the bits checks in upcoming OperationalStatus read steps." + PICS: WNCV.S.A000a + cluster: "Unit Testing" + command: "writeAttribute" + attribute: "bitmap8" + arguments: + value: OperationalStatusValue + + - label: + "Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + PICS: WNCV.S.A000a && WNCV.S.F00 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksSet: [0x8] hasMasksClear: [0x4] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 2..3 - (WNCV.S.F00(LF))" - PICS: WNCV.S.A000a && !WNCV.S.F00 && PICS_SDK_CI_ONLY + "Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + PICS: WNCV.S.A000a && !WNCV.S.F00 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksClear: [0x4, 0x8] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 4..5 - (WNCV.S.F01(TL))" - PICS: WNCV.S.A000a && WNCV.S.F01 && PICS_SDK_CI_ONLY + "Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + PICS: WNCV.S.A000a && WNCV.S.F01 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksSet: [0x20] hasMasksClear: [0x10] - label: - "Step 3a: TH reads OperationalStatus attribute's bit 4..5 - (WNCV.S.F01(TL))" - PICS: WNCV.S.A000a && !WNCV.S.F01 && PICS_SDK_CI_ONLY + "Step 3a: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + PICS: WNCV.S.A000a && !WNCV.S.F01 + cluster: "Unit Testing" command: "readAttribute" - attribute: "OperationalStatus" + attribute: "bitmap8" response: + value: OperationalStatusValue constraints: type: bitmap8 hasMasksClear: [0x10, 0x20] - #Issue https://github.com/CHIP-Specifications/chip-test-scripts/issues/509 - - label: "Step 3a: TH reads OperationalStatus attribute from DUT" - verification: | - ./chip-tool windowcovering read operational-status 1 1 - - Verify "OperationalStatus " on the TH(Chip-tool) Log: is currently not zero and is in closing mode - - CHIP:DMG: Data = 42, - CHIP:DMG: } - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0102 Attribute 0x0000_000ADataVersion: 324132078 - CHIP:TOO: OperationalStatus: 42 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - ### Depending on the DUT specs we might prefer a arguments here - label: "Step 3a2: DUT updates its attributes" cluster: "DelayCommands" diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 6ef9392d3af055..36cf7692951bb8 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -307,7 +307,15 @@ DISHALM.S.A0000=1 DISHALM.S.A0001=1 DISHALM.S.A0002=1 DISHALM.S.A0003=1 -DISHALM.M.ManuallyControlled=1 + +#Manual controllable +DISHALM.S.M.ManuallyControlled=1 +DISHALM.S.M.InflowAlarmSupported=1 +DISHALM.S.M.DrainAlarmSupported=1 +DISHALM.S.M.DoorAlarmSupported=1 +DISHALM.S.M.TempLowAlarmSupported=1 +DISHALM.S.M.TempHighAlarmSupported=1 +DISHALM.S.M.WaterLevelAlarmSupported=1 #Commands DISHALM.S.C00.Rsp=1 @@ -329,7 +337,13 @@ DISHM.S.A0003=1 DISHM.S.C00.Rsp=1 DISHM.S.C01.Tx=1 -PIXIT.DISHM.CAN_TEST_MODE_FAILURE=1 + +#Manual controllable +DISHM.S.M.CAN_TEST_MODE_FAILURE=1 + +#PIXIT +PIXIT.DISHM.MODE_CHANGE_FAIL=1 +PIXIT.DISHM.MODE_CHANGE_OK=1 # MEDIA CLUSTER # App Launcher @@ -580,16 +594,16 @@ PRS.C.AO-WRITE=0 G.S=1 G.S.F00=1 G.S.A0000=0 -G.S.C00.Rsp=0 -G.S.C01.Rsp=0 -G.S.C02.Rsp=0 -G.S.C03.Rsp=0 +G.S.C00.Rsp=1 +G.S.C01.Rsp=1 +G.S.C02.Rsp=1 +G.S.C03.Rsp=1 G.S.C04.Rsp=0 G.S.C05.Rsp=0 -G.S.C00.Tx=0 -G.S.C01.Tx=0 -G.S.C02.Tx=0 -G.S.C03.Tx=0 +G.S.C00.Tx=1 +G.S.C01.Tx=1 +G.S.C02.Tx=1 +G.S.C03.Tx=1 G.C=1 G.C.A0000=0 @@ -603,7 +617,17 @@ G.C.C05.Tx=0 GRPKEY.S=1 # No support for the CacheAndSync feature so far GRPKEY.S.F00=0 -GRPKEY.S.A0001=0 +GRPKEY.S.A0000=1 +GRPKEY.S.A0001=1 +GRPKEY.S.A0002=1 +GRPKEY.S.A0003=1 + +GRPKEY.S.C00.Rsp=1 +GRPKEY.S.C01.Rsp=1 +GRPKEY.S.C02.Rsp=1 +GRPKEY.S.C03.Rsp=1 +GRPKEY.S.C04.Rsp=1 +GRPKEY.S.C05.Rsp=1 GRPKEY.C=1 GRPKEY.C.A0000=1 @@ -652,8 +676,6 @@ S.S.C40.Rsp=0 S.S.C41.Rsp=0 S.S.C42.Rsp=0 S.S.C05.Rsp=0 -G.S.C00.Rsp=0 -G.S.C04.Rsp=0 S.S.AM=0 S.S.AO=0 S.S.F00=0 @@ -763,7 +785,11 @@ LWM.S.F00=1 LWM.S.C00.Rsp=1 LWM.S.C01.Tx=1 -PIXIT.LWM.CAN_TEST_MODE_FAILURE=1 +#PIXIT +PIXIT.LWM.MODE_CHANGE_FAIL=1 +PIXIT.LWM.MODE_CHANGE_OK=1 + +LWM.S.M.CAN_TEST_MODE_FAILURE=1 # Time Format Localization Cluster LTIME.S=1 @@ -1446,7 +1472,7 @@ ILL.C.AO-WRITE=0 # Door Lock # Server attributes DRLK.S=1 -DRLK.S.DetectLockJammed=1 +DRLK.S.M.DetectLockJammed=1 DRLK.S.Simulate.NotFullyLocked=1 DRLK.S.A0000=1 DRLK.S.A0001=1 @@ -2039,7 +2065,7 @@ MCORE.ROLE.CONTROLLER=0 # Bridged Device Basic Information # Server BRBINFO.S=1 -BRBINFO.S.A0000=0 +BRBINFO.S.A0000=1 BRBINFO.S.A0001=0 BRBINFO.S.A0002=0 BRBINFO.S.A0003=0 @@ -2219,7 +2245,6 @@ AIRQUAL.S.F01=1 AIRQUAL.S.F02=1 AIRQUAL.S.F03=1 AIRQUAL.S.A0000=1 -PICS_USER_PROMPT=0 AIRQUAL.M.AirQualityChange=0 # Concentration Measurement @@ -2403,27 +2428,6 @@ TVOCCONC.S.A0008=1 TVOCCONC.S.A0009=1 TVOCCONC.S.A000a=1 -# TEMPERATURE CONTROL CLUSTER - -TCTL.S=1 -TCTL.C=1 - -TCTL.S.F00=1 -TCTL.S.F01=1 -TCTL.S.F02=1 - -#Server -TCTL.S.A0000=1 -TCTL.S.A0001=1 -TCTL.S.A0002=1 -TCTL.S.A0003=1 -TCTL.S.A0004=1 -TCTL.S.A0005=1 -TCC.M.ManuallyControlledTemperature=1 - -#Command -TCTL.S.C00.Rsp=1 -TCTL.C.C00.Tx=1 RNCONC.C=0 @@ -2479,7 +2483,11 @@ RVCCLEANM.S.F00=1 RVCCLEANM.S.C00.Rsp=1 RVCCLEANM.S.C01.Tx=1 -PIXIT.RVCCLEANM.CAN_TEST_MODE_FAILURE=1 +RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE=1 + +#PIXIT +PIXIT.RVCCLEANM.MODE_CHANGE_FAIL=1 +PIXIT.RVCCLEANM.MODE_CHANGE_OK=1 # RVC OPERATIONAL STATE CLUSTER RVCOPSTATE.S=1 @@ -2545,7 +2553,11 @@ RVCRUNM.S.A0003=1 RVCRUNM.S.C00.Rsp=1 RVCRUNM.S.C01.Tx=1 -PIXIT.RVCRUNM.CAN_TEST_MODE_FAILURE=1 +RVCRUNM.S.M.CAN_TEST_MODE_FAILURE=1 + +#PIXIT +PIXIT.RVCRUNM.MODE_CHANGE_FAIL=1 +PIXIT.RVCRUNM.MODE_CHANGE_OK=1 #Refrigerator and Temperature Controlled Cabinet Mode Cluster(TCCM) @@ -2562,6 +2574,11 @@ TCCM.S.A0003=1 TCCM.S.C00.Rsp=1 TCCM.S.C01.Tx=1 +TCCM.S.M.CAN_TEST_MODE_FAILURE=1 + +#PIXIT +PIXIT.TCCM.MODE_CHANGE_FAIL=1 +PIXIT.TCCM.MODE_CHANGE_OK=1 # Fan Control #Features @@ -2667,14 +2684,12 @@ TCCM.S.A0003=1 TCCM.S.C00.Rsp=1 TCCM.S.C01.Tx=1 -PIXIT.TCCM.CAN_TEST_MODE_FAILURE=1 - #Temperature Control TCTL.S=1 TCTL.C=1 -TCTL.S.F00=1 +TCTL.S.F00=0 TCTL.S.F01=1 -TCTL.S.F02=1 +TCTL.S.F02=0 TCTL.S.A0000=1 TCTL.S.A0001=1 TCTL.S.A0002=1 @@ -2682,6 +2697,7 @@ TCTL.S.A0003=1 TCTL.S.A0004=1 TCTL.S.A0005=1 TCC.M.ManuallyControlledTemperature=1 +TCTL.S.M.SupportsInvalidInMode=1 TCTL.S.C00.Rsp=1 TCTL.C.C00.Tx=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 8fd0ac79b9c1ea..878e8e8be699a5 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -15,10 +15,7 @@ "AccessControlEnforcement": ["Test_TC_ACE_1_1", "Test_TC_ACE_1_5"], "BooleanState": ["Test_TC_BOOL_1_1", "Test_TC_BOOL_2_1"], "Binding": ["Test_TC_BIND_1_1"], - "BridgedDeviceBasicInformation": [ - "Test_TC_BRBINFO_1_1", - "Test_TC_BRBINFO_2_1" - ], + "BridgedDeviceBasicInformation": ["Test_TC_BRBINFO_1_1"], "Actions": ["Test_TC_ACT_1_1"], "ColorControl": [ "Test_TC_CC_1_1", @@ -66,14 +63,13 @@ "Test_TC_FAN_2_2", "Test_TC_FAN_2_3", "Test_TC_FAN_2_4", - "Test_TC_FAN_2_5", "Test_TC_FAN_3_1", "Test_TC_FAN_3_2", "Test_TC_FAN_3_6" ], "GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"], - "GeneralDiagnostics": ["Test_TC_DGGEN_1_1", "Test_TC_DGGEN_2_1"], - "GroupKeyManagement": ["Test_TC_GRPKEY_1_1"], + "GeneralDiagnostics": ["Test_TC_DGGEN_1_1"], + "GroupKeyManagement": ["Test_TC_GRPKEY_1_1", "Test_TC_GRPKEY_2_2"], "IcdManagement": ["Test_TC_ICDM_1_1"], "Identify": [ "Test_TC_I_1_1", @@ -102,7 +98,7 @@ "Test_TC_LVL_7_1" ], "LocalizationConfiguration": ["Test_TC_LCFG_1_1"], - "TimeFormatLocalization": ["Test_TC_LTIME_1_2"], + "TimeFormatLocalization": ["Test_TC_LTIME_1_2", "Test_TC_LTIME_3_1"], "UnitLocalization": ["Test_TC_LUNIT_1_2", "Test_TC_LUNIT_3_1"], "UserLabel": [ "Test_TC_ULABEL_1_1", @@ -111,6 +107,7 @@ "Test_TC_ULABEL_2_3", "Test_TC_ULABEL_2_4" ], + "LaundryWasherMode": ["Test_TC_LWM_1_1", "Test_TC_LWM_2_1"], "MediaControl": [ "Test_TC_LOWPOWER_1_1", "Test_TC_KEYPADINPUT_1_2", @@ -161,7 +158,7 @@ "Test_TC_OO_2_2", "Test_TC_OO_2_4" ], - "OperationalState": ["Test_TC_OPSTATE_1_1"], + "OperationalState": ["Test_TC_OPSTATE_1_1", "Test_TC_OPSTATE_2_4"], "PowerSource": ["Test_TC_PS_1_1", "Test_TC_PS_2_1"], "PressureMeasurement": [ "Test_TC_PRS_1_1", @@ -176,9 +173,11 @@ "Test_TC_PCC_2_4" ], "PowerSourceConfiguration": ["Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1"], + "RefrigeratorAlarm": ["Test_TC_REFALM_1_1"], "RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"], "RoboticVacuumCleaner": [ "Test_TC_RVCCLEANM_1_1", + "Test_TC_RVCCLEANM_3_1", "Test_TC_RVCRUNM_1_1", "Test_TC_RVCOPSTATE_1_1" ], @@ -193,6 +192,8 @@ "Test_TC_SMOKECO_2_6" ], "Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"], + "TemperatureControlledCabinetMode": ["Test_TC_TCCM_1_1"], + "TemperatureControl": ["Test_TC_TCTL_1_1"], "TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"], "Thermostat": ["Test_TC_TSTAT_1_1", "Test_TC_TSTAT_2_1"], "ThermostatUserConfiguration": [ @@ -363,6 +364,7 @@ "LocalizationConfiguration", "UnitLocalization", "TimeFormatLocalization", + "LaundryWasherMode", "MediaControl", "ModeSelect", "MultipleFabrics", @@ -374,11 +376,14 @@ "PressureMeasurement", "PumpConfigurationControl", "PowerSourceConfiguration", + "RefrigeratorAlarm", "RelativeHumidityMeasurement", "SecureChannel", "SmokeCOAlarm", "Switch", "RVCOperationalState", + "TemperatureControlledCabinetMode", + "TemperatureControl", "TemperatureMeasurement", "Thermostat", "ThermostatUserConfiguration", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index df76b9d101193d..a2f917ac68c226 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -40,7 +40,6 @@ "TestGroupDemoConfig", "Test_TC_G_2_2", "Test_TC_G_2_3", - "Test_TC_G_2_4", "Test_TC_G_3_2" ], "BulkDataExchangeProtocol": [ @@ -116,7 +115,7 @@ "Descriptor": ["Test_TC_DESC_2_1"], "FanControl": [], "GeneralCommissioning": ["Test_TC_CGEN_2_2"], - "GeneralDiagnostics": ["Test_TC_DGGEN_2_2", "Test_TC_DGGEN_2_3"], + "GeneralDiagnostics": ["Test_TC_DGGEN_2_2"], "Identify": ["Test_TC_I_3_2"], "IcdManagement": ["Test_TC_ICDM_2_2", "Test_TC_ICDM_2_3"], "IlluminanceMeasurement": [], @@ -192,16 +191,7 @@ "Test_TC_CADMIN_1_25", "Test_TC_CADMIN_1_26" ], - "ModeSelect": [ - "Test_TC_MOD_1_2", - "Test_TC_MOD_1_3", - "Test_TC_MOD_2_1", - "Test_TC_MOD_2_2", - "Test_TC_MOD_3_1", - "Test_TC_MOD_3_2", - "Test_TC_MOD_3_3", - "Test_TC_MOD_3_4" - ], + "ModeSelect": ["Test_TC_MOD_1_2", "Test_TC_MOD_1_3", "Test_TC_MOD_2_2"], "OTASoftwareUpdate": [ "Test_TC_SU_1_1", "Test_TC_SU_2_1", @@ -267,35 +257,23 @@ "Test_TC_CC_9_3" ], "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2"], - "LocalizationConfiguration": ["Test_TC_LCFG_2_1"], + "LocalizationConfiguration": [], "LevelControl": [], - "LaundryWasherMode": [ - "Test_TC_LWM_1_1", - "Test_TC_LWM_1_2", - "Test_TC_LWM_2_1", - "Test_TC_LWM_3_1", - "Test_TC_LWM_3_2" - ], + "LaundryWasherMode": ["Test_TC_LWM_1_2", "Test_TC_LWM_3_2"], "OnOff": ["Test_TC_OO_2_3"], "OperationalState": [ "Test_TC_OPSTATE_2_1", "Test_TC_OPSTATE_2_2", - "Test_TC_OPSTATE_2_3", - "Test_TC_OPSTATE_2_4" + "Test_TC_OPSTATE_2_3" ], "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], "SmokeCOAlarm": [], "RefrigeratorAlarm": [ - "Test_TC_REFALM_1_1", "Test_TC_REFALM_2_1", "Test_TC_REFALM_2_2", "Test_TC_REFALM_2_3" ], - "RVCCleanMode": [ - "Test_TC_RVCCLEANM_1_1", - "Test_TC_RVCCLEANM_3_1", - "Test_TC_RVCCLEANM_3_3" - ], + "RVCCleanMode": ["Test_TC_RVCCLEANM_3_3"], "RVCOperationalState": ["Test_TC_RVCOPSTATE_2_2"], "RVCRunMode": [ "Test_TC_RVCRUNM_1_1", @@ -303,7 +281,6 @@ "Test_TC_RVCRUNM_3_3" ], "TemperatureControlledCabinetMode": [ - "Test_TC_TCCM_1_1", "Test_TC_TCCM_1_2", "Test_TC_TCCM_2_1", "Test_TC_TCCM_3_1", @@ -312,7 +289,6 @@ ], "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], "TemperatureControl": [ - "Test_TC_TCTL_1_1", "Test_TC_TCTL_2_1", "Test_TC_TCTL_2_2", "Test_TC_TCTL_2_3", @@ -324,7 +300,7 @@ "ThermostatUserConfiguration": [], "ThreadNetworkDiagnostics": ["Test_TC_DGTHREAD_2_5"], "Actions": ["Test_TC_ACT_2_1", "Test_TC_ACT_2_2", "Test_TC_ACT_3_2"], - "TimeFormatLocalization": ["Test_TC_LTIME_3_1"], + "TimeFormatLocalization": [], "TimeSynchronization": [], "UnitLocalization": [], "Binding": ["Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3"], diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h new file mode 100644 index 00000000000000..2a9d7e662791ea --- /dev/null +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -0,0 +1,144272 @@ +/* + * + * Copyright (c) 2022 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#pragma once + +#if CONFIG_ENABLE_YAML_TESTS + +#include +#include +#include +#include +#include + +#include // For INFINITY + +class TestList : public Command +{ +public: + TestList() : Command("list"){}; + CHIP_ERROR Run() override + { + printf("TestAccessControlCluster\n"); + printf("Test_TC_ACL_1_1\n"); + printf("Test_TC_ACL_2_1\n"); + printf("Test_TC_ACL_2_3\n"); + printf("Test_TC_ACL_2_4\n"); + printf("Test_TC_ACL_2_5\n"); + printf("Test_TC_ACL_2_6\n"); + printf("Test_TC_ACL_2_7\n"); + printf("Test_TC_ACL_2_8\n"); + printf("Test_TC_ACL_2_9\n"); + printf("Test_TC_ACL_2_10\n"); + printf("Test_TC_ACE_1_1\n"); + printf("Test_TC_ACE_1_5\n"); + printf("Test_TC_AIRQUAL_1_1\n"); + printf("Test_TC_AIRQUAL_2_1\n"); + printf("Test_TC_BOOL_1_1\n"); + printf("Test_TC_BOOL_2_1\n"); + printf("Test_TC_BRBINFO_1_1\n"); + printf("Test_TC_ACT_1_1\n"); + printf("Test_TC_BIND_1_1\n"); + printf("Test_TC_CC_1_1\n"); + printf("Test_TC_CC_2_1\n"); + printf("Test_TC_CC_3_2\n"); + printf("Test_TC_CC_3_3\n"); + printf("Test_TC_CC_4_1\n"); + printf("Test_TC_CC_4_2\n"); + printf("Test_TC_CC_4_3\n"); + printf("Test_TC_CC_4_4\n"); + printf("Test_TC_CC_5_1\n"); + printf("Test_TC_CC_5_2\n"); + printf("Test_TC_CC_5_3\n"); + printf("Test_TC_CC_6_1\n"); + printf("Test_TC_CC_6_2\n"); + printf("Test_TC_CC_6_3\n"); + printf("Test_TC_CC_6_5\n"); + printf("Test_TC_CC_7_2\n"); + printf("Test_TC_CC_7_3\n"); + printf("Test_TC_CC_7_4\n"); + printf("Test_TC_CC_8_1\n"); + printf("TestColorControl_9_1\n"); + printf("TestColorControl_9_2\n"); + printf("Test_TC_CDOCONC_1_1\n"); + printf("Test_TC_CDOCONC_2_1\n"); + printf("Test_TC_CMOCONC_1_1\n"); + printf("Test_TC_CMOCONC_2_1\n"); + printf("Test_TC_FLDCONC_1_1\n"); + printf("Test_TC_FLDCONC_2_1\n"); + printf("Test_TC_NDOCONC_1_1\n"); + printf("Test_TC_NDOCONC_2_1\n"); + printf("Test_TC_OZCONC_1_1\n"); + printf("Test_TC_OZCONC_2_1\n"); + printf("Test_TC_PMHCONC_1_1\n"); + printf("Test_TC_PMHCONC_2_1\n"); + printf("Test_TC_PMICONC_1_1\n"); + printf("Test_TC_PMICONC_2_1\n"); + printf("Test_TC_PMKCONC_1_1\n"); + printf("Test_TC_PMKCONC_2_1\n"); + printf("Test_TC_RNCONC_1_1\n"); + printf("Test_TC_RNCONC_2_1\n"); + printf("Test_TC_TVOCCONC_1_1\n"); + printf("Test_TC_TVOCCONC_2_1\n"); + printf("TestIcdManagementCluster\n"); + printf("Test_TC_OPCREDS_1_2\n"); + printf("Test_TC_BINFO_1_1\n"); + printf("Test_TC_BINFO_2_1\n"); + printf("Test_TC_BINFO_2_2\n"); + printf("Test_TC_CNET_1_3\n"); + printf("Test_TC_DESC_1_1\n"); + printf("Test_TC_DLOG_1_1\n"); + printf("Test_TC_DGETH_1_1\n"); + printf("Test_TC_DGETH_2_1\n"); + printf("Test_TC_DGETH_2_2\n"); + printf("Test_TC_FLW_1_1\n"); + printf("Test_TC_FLW_2_1\n"); + printf("Test_TC_FLABEL_1_1\n"); + printf("Test_TC_FLABEL_2_1\n"); + printf("Test_TC_FAN_1_1\n"); + printf("Test_TC_FAN_2_1\n"); + printf("Test_TC_FAN_2_2\n"); + printf("Test_TC_FAN_2_3\n"); + printf("Test_TC_FAN_2_4\n"); + printf("Test_TC_FAN_3_1\n"); + printf("Test_TC_FAN_3_2\n"); + printf("Test_TC_FAN_3_6\n"); + printf("Test_TC_CGEN_1_1\n"); + printf("Test_TC_CGEN_2_1\n"); + printf("Test_TC_DGGEN_1_1\n"); + printf("Test_TC_GRPKEY_1_1\n"); + printf("Test_TC_GRPKEY_2_2\n"); + printf("Test_TC_ICDM_1_1\n"); + printf("Test_TC_ICDM_2_1\n"); + printf("Test_TC_I_1_1\n"); + printf("Test_TC_I_2_1\n"); + printf("Test_TC_I_2_2\n"); + printf("Test_TC_I_2_3\n"); + printf("Test_TC_ILL_1_1\n"); + printf("Test_TC_ILL_2_1\n"); + printf("Test_TC_ILL_2_2\n"); + printf("Test_TC_LVL_1_1\n"); + printf("Test_TC_LVL_2_1\n"); + printf("Test_TC_LVL_2_2\n"); + printf("Test_TC_LVL_3_1\n"); + printf("Test_TC_LVL_4_1\n"); + printf("Test_TC_LVL_5_1\n"); + printf("Test_TC_LVL_6_1\n"); + printf("Test_TC_LVL_7_1\n"); + printf("Test_TC_LCFG_1_1\n"); + printf("Test_TC_LUNIT_1_2\n"); + printf("Test_TC_LUNIT_3_1\n"); + printf("Test_TC_LTIME_1_2\n"); + printf("Test_TC_LTIME_3_1\n"); + printf("Test_TC_LWM_1_1\n"); + printf("Test_TC_LWM_2_1\n"); + printf("Test_TC_LOWPOWER_1_1\n"); + printf("Test_TC_KEYPADINPUT_1_2\n"); + printf("Test_TC_APPLAUNCHER_1_3\n"); + printf("Test_TC_MEDIAINPUT_1_4\n"); + printf("Test_TC_WAKEONLAN_1_5\n"); + printf("Test_TC_CHANNEL_1_6\n"); + printf("Test_TC_MEDIAPLAYBACK_1_7\n"); + printf("Test_TC_AUDIOOUTPUT_1_8\n"); + printf("Test_TC_TGTNAV_1_9\n"); + printf("Test_TC_APBSC_1_10\n"); + printf("Test_TC_CONTENTLAUNCHER_1_11\n"); + printf("Test_TC_ALOGIN_1_12\n"); + printf("Test_TC_LOWPOWER_2_1\n"); + printf("Test_TC_KEYPADINPUT_3_2\n"); + printf("Test_TC_KEYPADINPUT_3_3\n"); + printf("Test_TC_APPLAUNCHER_3_5\n"); + printf("Test_TC_APPLAUNCHER_3_6\n"); + printf("Test_TC_APPLAUNCHER_3_7\n"); + printf("Test_TC_MEDIAINPUT_3_10\n"); + printf("Test_TC_MEDIAINPUT_3_11\n"); + printf("Test_TC_MEDIAINPUT_3_12\n"); + printf("Test_TC_MEDIAINPUT_3_13\n"); + printf("Test_TC_CHANNEL_5_1\n"); + printf("Test_TC_CHANNEL_5_2\n"); + printf("Test_TC_CHANNEL_5_3\n"); + printf("Test_TC_MEDIAPLAYBACK_6_1\n"); + printf("Test_TC_MEDIAPLAYBACK_6_2\n"); + printf("Test_TC_MEDIAPLAYBACK_6_3\n"); + printf("Test_TC_MEDIAPLAYBACK_6_4\n"); + printf("Test_TC_AUDIOOUTPUT_7_1\n"); + printf("Test_TC_AUDIOOUTPUT_7_2\n"); + printf("Test_TC_TGTNAV_8_1\n"); + printf("Test_TC_APBSC_9_1\n"); + printf("Test_TC_CONTENTLAUNCHER_10_1\n"); + printf("Test_TC_WAKEONLAN_4_1\n"); + printf("Test_TC_ALOGIN_12_1\n"); + printf("Test_TC_CONTENTLAUNCHER_10_3\n"); + printf("Test_TC_CONTENTLAUNCHER_10_5\n"); + printf("Test_TC_CONTENTLAUNCHER_10_7\n"); + printf("Test_TC_MOD_1_1\n"); + printf("OTA_SuccessfulTransfer\n"); + printf("Test_TC_OCC_1_1\n"); + printf("Test_TC_OCC_2_1\n"); + printf("Test_TC_OCC_2_3\n"); + printf("Test_TC_OO_1_1\n"); + printf("Test_TC_OO_2_1\n"); + printf("Test_TC_OO_2_2\n"); + printf("Test_TC_OO_2_4\n"); + printf("Test_TC_OPSTATE_1_1\n"); + printf("Test_TC_OPSTATE_2_4\n"); + printf("Test_TC_PS_1_1\n"); + printf("Test_TC_PS_2_1\n"); + printf("Test_TC_PRS_1_1\n"); + printf("Test_TC_PRS_2_1\n"); + printf("Test_TC_PRS_2_2\n"); + printf("Test_TC_PCC_1_1\n"); + printf("Test_TC_PCC_2_1\n"); + printf("Test_TC_PCC_2_2\n"); + printf("Test_TC_PCC_2_3\n"); + printf("Test_TC_PCC_2_4\n"); + printf("Test_TC_PSCFG_1_1\n"); + printf("Test_TC_PSCFG_2_1\n"); + printf("Test_TC_REFALM_1_1\n"); + printf("Test_TC_RH_1_1\n"); + printf("Test_TC_RH_2_1\n"); + printf("Test_TC_SMOKECO_1_1\n"); + printf("Test_TC_SMOKECO_2_1\n"); + printf("Test_TC_SMOKECO_2_2\n"); + printf("Test_TC_SMOKECO_2_3\n"); + printf("Test_TC_SMOKECO_2_4\n"); + printf("Test_TC_SMOKECO_2_5\n"); + printf("Test_TC_SMOKECO_2_6\n"); + printf("Test_TC_SWTCH_1_1\n"); + printf("Test_TC_SWTCH_2_1\n"); + printf("Test_TC_RVCOPSTATE_1_1\n"); + printf("Test_TC_TCCM_1_1\n"); + printf("Test_TC_TCTL_1_1\n"); + printf("Test_TC_TMP_1_1\n"); + printf("Test_TC_TMP_2_1\n"); + printf("Test_TC_TSTAT_1_1\n"); + printf("Test_TC_TSTAT_2_1\n"); + printf("Test_TC_TSUIC_1_1\n"); + printf("Test_TC_TSUIC_2_1\n"); + printf("Test_TC_TSUIC_2_2\n"); + printf("Test_TC_DGTHREAD_1_1\n"); + printf("Test_TC_DGTHREAD_2_1\n"); + printf("Test_TC_DGTHREAD_2_2\n"); + printf("Test_TC_DGTHREAD_2_3\n"); + printf("Test_TC_DGTHREAD_2_4\n"); + printf("Test_TC_TIMESYNC_1_1\n"); + printf("Test_TC_TIMESYNC_2_3\n"); + printf("Test_TC_ULABEL_1_1\n"); + printf("Test_TC_ULABEL_2_1\n"); + printf("Test_TC_ULABEL_2_2\n"); + printf("Test_TC_ULABEL_2_3\n"); + printf("Test_TC_ULABEL_2_4\n"); + printf("Test_TC_DGWIFI_1_1\n"); + printf("Test_TC_DGWIFI_2_1\n"); + printf("Test_TC_DGWIFI_2_3\n"); + printf("Test_TC_WNCV_1_1\n"); + printf("Test_TC_WNCV_2_1\n"); + printf("Test_TC_WNCV_2_2\n"); + printf("Test_TC_WNCV_2_3\n"); + printf("Test_TC_WNCV_2_5\n"); + printf("Test_TC_WNCV_3_1\n"); + printf("Test_TC_WNCV_3_2\n"); + printf("Test_TC_WNCV_3_3\n"); + printf("Test_TC_WNCV_3_4\n"); + printf("Test_TC_WNCV_3_5\n"); + printf("Test_TC_WNCV_4_1\n"); + printf("Test_TC_WNCV_4_2\n"); + printf("Test_TC_WNCV_4_3\n"); + printf("Test_TC_WNCV_4_4\n"); + printf("Test_TC_WNCV_4_5\n"); + printf("TV_TargetNavigatorCluster\n"); + printf("TV_AudioOutputCluster\n"); + printf("TV_ApplicationLauncherCluster\n"); + printf("TV_KeypadInputCluster\n"); + printf("TV_AccountLoginCluster\n"); + printf("TV_WakeOnLanCluster\n"); + printf("TV_ApplicationBasicCluster\n"); + printf("TV_MediaPlaybackCluster\n"); + printf("TV_ChannelCluster\n"); + printf("TV_LowPowerCluster\n"); + printf("TV_ContentLauncherCluster\n"); + printf("TV_MediaInputCluster\n"); + printf("TestCASERecovery\n"); + printf("TestCluster\n"); + printf("TestClusterComplexTypes\n"); + printf("TestConstraints\n"); + printf("TestDelayCommands\n"); + printf("TestEvents\n"); + printf("TestDiscovery\n"); + printf("TestLogCommands\n"); + printf("TestSaveAs\n"); + printf("TestConfigVariables\n"); + printf("TestDescriptorCluster\n"); + printf("TestBasicInformation\n"); + printf("TestFabricRemovalWhileSubscribed\n"); + printf("TestGeneralCommissioning\n"); + printf("TestIdentifyCluster\n"); + printf("TestOperationalCredentialsCluster\n"); + printf("TestModeSelectCluster\n"); + printf("TestTemperatureControl\n"); + printf("TestSelfFabricRemoval\n"); + printf("TestSystemCommands\n"); + printf("TestBinding\n"); + printf("TestUserLabelCluster\n"); + printf("TestUserLabelClusterConstraints\n"); + printf("TestArmFailSafe\n"); + printf("TestFanControl\n"); + printf("TestAccessControlConstraints\n"); + printf("TestLevelControlWithOnOffDependency\n"); + printf("TestCommissioningWindow\n"); + printf("TestCommissionerNodeId\n"); + printf("TestTimeSynchronization\n"); + printf("TestOperationalState\n"); + printf("TestRVCOperationalState\n"); + printf("TestDishwasherAlarm\n"); + printf("TestMultiAdmin\n"); + printf("Test_TC_DGSW_1_1\n"); + printf("TestSubscribe_OnOff\n"); + printf("TestSubscribe_AdministratorCommissioning\n"); + printf("DL_UsersAndCredentials\n"); + printf("DL_LockUnlock\n"); + printf("DL_Schedules\n"); + printf("Test_TC_DRLK_1_1\n"); + printf("Test_TC_DRLK_2_4\n"); + printf("Test_TC_DRLK_2_5\n"); + printf("Test_TC_DRLK_2_6\n"); + printf("Test_TC_DRLK_2_7\n"); + printf("Test_TC_DRLK_2_8\n"); + printf("Test_TC_DRLK_2_11\n"); + printf("TestGroupMessaging\n"); + printf("TestGroupsCluster\n"); + printf("Test_TC_G_1_1\n"); + printf("Test_TC_G_2_1\n"); + printf("TestActivatedCarbonFilterMonitoring\n"); + printf("TestHepaFilterMonitoring\n"); + printf("Test_TC_ACFREMON_1_1\n"); + printf("Test_TC_ACFREMON_2_1\n"); + printf("Test_TC_HEPAFREMON_1_1\n"); + printf("Test_TC_HEPAFREMON_2_1\n"); + + return CHIP_NO_ERROR; + } +}; + +class ManualTestList : public Command +{ +public: + ManualTestList() : Command("list-manual"){}; + CHIP_ERROR Run() override + { + printf("Test_TC_DD_1_5\n"); + printf("Test_TC_DD_1_6\n"); + printf("Test_TC_DD_1_7\n"); + printf("Test_TC_DD_1_8\n"); + printf("Test_TC_DD_1_9\n"); + printf("Test_TC_DD_1_10\n"); + printf("Test_TC_DD_1_11\n"); + printf("Test_TC_DD_1_12\n"); + printf("Test_TC_DD_1_13\n"); + printf("Test_TC_DD_1_14\n"); + printf("Test_TC_DD_1_15\n"); + printf("Test_TC_DD_2_1\n"); + printf("Test_TC_DD_2_2\n"); + printf("Test_TC_DD_3_1\n"); + printf("Test_TC_DD_3_2\n"); + printf("Test_TC_DD_3_3\n"); + printf("Test_TC_DD_3_4\n"); + printf("Test_TC_DD_3_5\n"); + printf("Test_TC_DD_3_6\n"); + printf("Test_TC_DD_3_7\n"); + printf("Test_TC_DD_3_8\n"); + printf("Test_TC_DD_3_9\n"); + printf("Test_TC_DD_3_10\n"); + printf("Test_TC_DD_3_11\n"); + printf("Test_TC_DD_3_12\n"); + printf("Test_TC_DD_3_13\n"); + printf("Test_TC_DD_3_14\n"); + printf("Test_TC_DD_3_15\n"); + printf("Test_TC_DD_3_16\n"); + printf("Test_TC_DD_3_17\n"); + printf("Test_TC_DD_3_18\n"); + printf("Test_TC_DD_3_19\n"); + printf("Test_TC_DD_3_20\n"); + printf("Test_TC_DD_3_21\n"); + printf("TestGroupDemoCommand\n"); + printf("TestGroupDemoConfig\n"); + printf("Test_TC_G_2_2\n"); + printf("Test_TC_G_2_3\n"); + printf("Test_TC_G_2_4\n"); + printf("Test_TC_G_3_2\n"); + printf("Test_TC_BDX_1_1\n"); + printf("Test_TC_BDX_1_2\n"); + printf("Test_TC_BDX_1_3\n"); + printf("Test_TC_BDX_1_4\n"); + printf("Test_TC_BDX_1_5\n"); + printf("Test_TC_BDX_1_6\n"); + printf("Test_TC_BDX_2_1\n"); + printf("Test_TC_BDX_2_2\n"); + printf("Test_TC_BDX_2_3\n"); + printf("Test_TC_BDX_2_4\n"); + printf("Test_TC_BDX_2_5\n"); + printf("Test_TC_BR_1\n"); + printf("Test_TC_BR_2\n"); + printf("Test_TC_BR_3\n"); + printf("Test_TC_BR_4\n"); + printf("Test_TC_DA_1_1\n"); + printf("Test_TC_DA_1_3\n"); + printf("Test_TC_DA_1_4\n"); + printf("Test_TC_DA_1_6\n"); + printf("Test_TC_DA_1_8\n"); + printf("Test_TC_BINFO_3_1\n"); + printf("Test_TC_OPCREDS_3_1\n"); + printf("Test_TC_OPCREDS_3_2\n"); + printf("Test_TC_OPCREDS_3_3\n"); + printf("Test_TC_OPCREDS_3_4\n"); + printf("Test_TC_OPCREDS_3_5\n"); + printf("Test_TC_OPCREDS_3_6\n"); + printf("Test_TC_CNET_4_1\n"); + printf("Test_TC_CNET_4_2\n"); + printf("Test_TC_CNET_4_3\n"); + printf("Test_TC_CNET_4_4\n"); + printf("Test_TC_CNET_4_5\n"); + printf("Test_TC_CNET_4_6\n"); + printf("Test_TC_CNET_4_9\n"); + printf("Test_TC_CNET_4_10\n"); + printf("Test_TC_CNET_4_11\n"); + printf("Test_TC_CNET_4_12\n"); + printf("Test_TC_CNET_4_13\n"); + printf("Test_TC_CNET_4_14\n"); + printf("Test_TC_CNET_4_15\n"); + printf("Test_TC_CNET_4_16\n"); + printf("Test_TC_CNET_4_20\n"); + printf("Test_TC_CNET_4_21\n"); + printf("Test_TC_CNET_4_22\n"); + printf("Test_TC_DLOG_2_1\n"); + printf("Test_TC_DLOG_2_2\n"); + printf("Test_TC_DLOG_3_1\n"); + printf("Test_TC_DISHALM_1_1\n"); + printf("Test_TC_DISHALM_2_1\n"); + printf("Test_TC_DISHALM_3_1\n"); + printf("Test_TC_DISHALM_3_2\n"); + printf("Test_TC_DISHALM_3_3\n"); + printf("Test_TC_DISHALM_3_4\n"); + printf("Test_TC_DISHALM_3_5\n"); + printf("Test_TC_DISHALM_3_6\n"); + printf("Test_TC_DISHM_1_1\n"); + printf("Test_TC_DISHM_1_2\n"); + printf("Test_TC_DISHM_2_1\n"); + printf("Test_TC_DISHM_3_1\n"); + printf("Test_TC_DISHM_3_2\n"); + printf("Test_TC_DISHM_3_3\n"); + printf("Test_TC_DESC_2_1\n"); + printf("Test_TC_CGEN_2_2\n"); + printf("Test_TC_DGGEN_2_2\n"); + printf("Test_TC_ICDM_2_2\n"); + printf("Test_TC_ICDM_2_3\n"); + printf("Test_TC_I_3_2\n"); + printf("Test_TC_IDM_1_1\n"); + printf("Test_TC_IDM_2_1\n"); + printf("Test_TC_IDM_2_2\n"); + printf("Test_TC_IDM_3_1\n"); + printf("Test_TC_IDM_3_2\n"); + printf("Test_TC_IDM_4_1\n"); + printf("Test_TC_IDM_4_2\n"); + printf("Test_TC_IDM_4_3\n"); + printf("Test_TC_IDM_4_4\n"); + printf("Test_TC_IDM_5_1\n"); + printf("Test_TC_IDM_5_2\n"); + printf("Test_TC_IDM_6_1\n"); + printf("Test_TC_IDM_6_2\n"); + printf("Test_TC_IDM_6_3\n"); + printf("Test_TC_IDM_6_4\n"); + printf("Test_TC_IDM_7_1\n"); + printf("Test_TC_IDM_8_1\n"); + printf("Test_TC_IDM_10_1\n"); + printf("Test_TC_IDM_11_1\n"); + printf("Test_TC_LOWPOWER_2_2\n"); + printf("Test_TC_APPLAUNCHER_3_7_1\n"); + printf("Test_TC_APPLAUNCHER_3_8_1\n"); + printf("Test_TC_APPLAUNCHER_3_9_1\n"); + printf("Test_TC_MEDIAINPUT_3_14\n"); + printf("Test_TC_MEDIAINPUT_3_15\n"); + printf("Test_TC_MEDIAINPUT_3_16\n"); + printf("Test_TC_MEDIAINPUT_3_17\n"); + printf("Test_TC_CHANNEL_5_4\n"); + printf("Test_TC_CHANNEL_5_5\n"); + printf("Test_TC_CHANNEL_5_6\n"); + printf("Test_TC_KEYPADINPUT_3_1\n"); + printf("Test_TC_MEDIAPLAYBACK_6_5\n"); + printf("Test_TC_MEDIAPLAYBACK_6_7\n"); + printf("Test_TC_AUDIOOUTPUT_7_3\n"); + printf("Test_TC_AUDIOOUTPUT_7_4\n"); + printf("Test_TC_CONTENTLAUNCHER_10_4\n"); + printf("Test_TC_MC_11_1\n"); + printf("Test_TC_MC_11_2\n"); + printf("Test_TC_ALOGIN_12_2\n"); + printf("Test_TC_TGTNAV_8_2\n"); + printf("Test_TC_CADMIN_1_1\n"); + printf("Test_TC_CADMIN_1_2\n"); + printf("Test_TC_CADMIN_1_7\n"); + printf("Test_TC_CADMIN_1_8\n"); + printf("Test_TC_CADMIN_1_11\n"); + printf("Test_TC_CADMIN_1_12\n"); + printf("Test_TC_CADMIN_1_14\n"); + printf("Test_TC_CADMIN_1_15\n"); + printf("Test_TC_CADMIN_1_16\n"); + printf("Test_TC_CADMIN_1_17\n"); + printf("Test_TC_CADMIN_1_18\n"); + printf("Test_TC_CADMIN_1_19\n"); + printf("Test_TC_CADMIN_1_20\n"); + printf("Test_TC_CADMIN_1_21\n"); + printf("Test_TC_CADMIN_1_22\n"); + printf("Test_TC_CADMIN_1_3\n"); + printf("Test_TC_CADMIN_1_4\n"); + printf("Test_TC_CADMIN_1_5\n"); + printf("Test_TC_CADMIN_1_6\n"); + printf("Test_TC_CADMIN_1_9\n"); + printf("Test_TC_CADMIN_1_10\n"); + printf("Test_TC_CADMIN_1_13\n"); + printf("Test_TC_CADMIN_1_23\n"); + printf("Test_TC_CADMIN_1_24\n"); + printf("Test_TC_CADMIN_1_25\n"); + printf("Test_TC_CADMIN_1_26\n"); + printf("Test_TC_MOD_1_2\n"); + printf("Test_TC_MOD_1_3\n"); + printf("Test_TC_MOD_2_2\n"); + printf("Test_TC_SU_1_1\n"); + printf("Test_TC_SU_2_1\n"); + printf("Test_TC_SU_2_2\n"); + printf("Test_TC_SU_2_3\n"); + printf("Test_TC_SU_2_4\n"); + printf("Test_TC_SU_2_5\n"); + printf("Test_TC_SU_2_6\n"); + printf("Test_TC_SU_2_7\n"); + printf("Test_TC_SU_2_8\n"); + printf("Test_TC_SU_3_1\n"); + printf("Test_TC_SU_3_2\n"); + printf("Test_TC_SU_3_3\n"); + printf("Test_TC_SU_3_4\n"); + printf("Test_TC_SU_4_1\n"); + printf("Test_TC_SU_4_2\n"); + printf("Test_TC_PSCFG_2_2\n"); + printf("Test_TC_SC_1_1\n"); + printf("Test_TC_SC_1_2\n"); + printf("Test_TC_SC_1_3\n"); + printf("Test_TC_SC_1_4\n"); + printf("Test_TC_SC_2_1\n"); + printf("Test_TC_SC_2_2\n"); + printf("Test_TC_SC_2_3\n"); + printf("Test_TC_SC_2_4\n"); + printf("Test_TC_SC_3_1\n"); + printf("Test_TC_SC_3_2\n"); + printf("Test_TC_SC_3_3\n"); + printf("Test_TC_SC_3_4\n"); + printf("Test_TC_SC_4_1\n"); + printf("Test_TC_SC_4_2\n"); + printf("Test_TC_SC_4_3\n"); + printf("Test_TC_SC_4_4\n"); + printf("Test_TC_SC_4_5\n"); + printf("Test_TC_SC_4_6\n"); + printf("Test_TC_SC_4_7\n"); + printf("Test_TC_SC_4_8\n"); + printf("Test_TC_SC_4_9\n"); + printf("Test_TC_SC_4_10\n"); + printf("Test_TC_SC_5_3\n"); + printf("Test_TC_SC_6_1\n"); + printf("Test_TC_DGSW_2_1\n"); + printf("Test_TC_DGSW_2_2\n"); + printf("Test_TC_DGSW_2_3\n"); + printf("Test_TC_DGWIFI_2_2\n"); + printf("Test_TC_FLW_2_2\n"); + printf("Test_TC_OCC_3_1\n"); + printf("Test_TC_PS_2_2\n"); + printf("Test_TC_PS_3_1\n"); + printf("Test_TC_BOOL_2_2\n"); + printf("Test_TC_CC_3_1\n"); + printf("Test_TC_CC_7_1\n"); + printf("Test_TC_CC_9_1\n"); + printf("Test_TC_CC_9_2\n"); + printf("Test_TC_CC_9_3\n"); + printf("Test_TC_DRLK_2_10\n"); + printf("Test_TC_DRLK_3_2\n"); + printf("Test_TC_LWM_1_2\n"); + printf("Test_TC_LWM_3_2\n"); + printf("Test_TC_OO_2_3\n"); + printf("Test_TC_OPSTATE_2_1\n"); + printf("Test_TC_OPSTATE_2_2\n"); + printf("Test_TC_OPSTATE_2_3\n"); + printf("Test_TC_RH_2_2\n"); + printf("Test_TC_REFALM_2_1\n"); + printf("Test_TC_REFALM_2_2\n"); + printf("Test_TC_REFALM_2_3\n"); + printf("Test_TC_RVCCLEANM_3_3\n"); + printf("Test_TC_RVCOPSTATE_2_2\n"); + printf("Test_TC_RVCRUNM_1_1\n"); + printf("Test_TC_RVCRUNM_3_1\n"); + printf("Test_TC_RVCRUNM_3_3\n"); + printf("Test_TC_SWTCH_2_2\n"); + printf("Test_TC_SWTCH_3_2\n"); + printf("Test_TC_TCCM_1_2\n"); + printf("Test_TC_TCCM_2_1\n"); + printf("Test_TC_TCCM_3_1\n"); + printf("Test_TC_TCCM_3_2\n"); + printf("Test_TC_TCCM_3_3\n"); + printf("Test_TC_TCTL_2_1\n"); + printf("Test_TC_TCTL_2_2\n"); + printf("Test_TC_TCTL_2_3\n"); + printf("Test_TC_TCTL_3_2\n"); + printf("Test_TC_TCTL_3_3\n"); + printf("Test_TC_TMP_2_2\n"); + printf("Test_TC_TSTAT_3_2\n"); + printf("Test_TC_DGTHREAD_2_5\n"); + printf("Test_TC_ACT_2_1\n"); + printf("Test_TC_ACT_2_2\n"); + printf("Test_TC_ACT_3_2\n"); + printf("Test_TC_BIND_2_1\n"); + printf("Test_TC_BIND_2_2\n"); + printf("Test_TC_BIND_2_3\n"); + printf("Test_TC_S_1_1\n"); + printf("Test_TC_S_2_1\n"); + printf("Test_TC_S_2_5\n"); + printf("Test_TC_S_2_6\n"); + printf("Test_TC_BRBINFO_2_2\n"); + printf("Test_TC_BRBINFO_3_1\n"); + printf("Test_TC_WASHERCTRL_1_1\n"); + printf("Test_TC_WASHERCTRL_2_1\n"); + printf("Test_TC_WASHERCTRL_2_2\n"); + printf("Test_TC_WASHERCTRL_3_1\n"); + printf("Test_TC_WASHERCTRL_3_2\n"); + + return CHIP_NO_ERROR; + } +}; + +class PythonRunnerOnlyTestList : public Command +{ +public: + PythonRunnerOnlyTestList() : Command("list-python-runner-only"){}; + CHIP_ERROR Run() override + { + printf("TestGroupKeyManagementCluster\n"); + printf("TestEqualities\n"); + + return CHIP_NO_ERROR; + } +}; + +class TestAccessControlClusterSuite : public TestCommand +{ +public: + TestAccessControlClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestAccessControlCluster", 24, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestAccessControlClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 0U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 1UL)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 2UL)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 3U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[0].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), 4ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_3.GetValue(), 5ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_3.GetValue(), 6ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_3.GetValue(), 7ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 8U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 9UL)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 10UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 11U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[2].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[0]", iter_3.GetValue(), 12ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[1]", iter_3.GetValue(), 13ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[2]", iter_3.GetValue(), 14ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[3]", iter_3.GetValue(), 15ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[2].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[2].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 16U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 17UL)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 18UL)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 19U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 3)); + VerifyOrReturn(CheckValue("acl[3].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[3].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[3].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[0]", iter_3.GetValue(), 20ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[1]", iter_3.GetValue(), 21ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[2]", iter_3.GetValue(), 22ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[3]", iter_3.GetValue(), 23ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[3].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[3].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 24U)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 25UL)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 26UL)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 27U)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[3].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[3].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 4)); + } + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[1].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[1].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 2)); + } + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 0U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 1UL)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 2UL)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[0].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 3U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[0].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), 4ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_3.GetValue(), 5ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_3.GetValue(), 6ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_3.GetValue(), 7ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 8U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 9UL)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 10UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 11U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[2].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[0]", iter_3.GetValue(), 12ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[1]", iter_3.GetValue(), 13ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[2]", iter_3.GetValue(), 14ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[3]", iter_3.GetValue(), 15ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[2].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[2].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 16U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 17UL)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 18UL)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 19U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 3)); + VerifyOrReturn(CheckValue("acl[3].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[3].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[3].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[0]", iter_3.GetValue(), 20ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[1]", iter_3.GetValue(), 21ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[2]", iter_3.GetValue(), 22ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[3].subjects.Value()[3]", iter_3.GetValue(), 23ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[3].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[3].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 24U)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 25UL)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[3].targets.Value()", iter_3, 2)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[2].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[2].cluster.Value()", iter_3.GetValue().cluster.Value(), 26UL)); + VerifyOrReturn(CheckValueNonNull("acl[3].targets.Value()[2].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[3].targets.Value()[2].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 27U)); + VerifyOrReturn(CheckValueNull("acl[3].targets.Value()[2].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[3].targets.Value()", iter_3, 3)); + } + VerifyOrReturn(CheckValue("acl[3].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 4)); + } + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[0].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for commissionee"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Write entries"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(4); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 1UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 2UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 3U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 4ULL; + listHolder_3->mList[1] = 5ULL; + listHolder_3->mList[2] = 6ULL; + listHolder_3->mList[3] = 7ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 8U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 9UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 10UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 11U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[1].fabricIndex = 0U; + + listHolder_0->mList[2].privilege = + static_cast(3); + listHolder_0->mList[2].authMode = + static_cast(3); + listHolder_0->mList[2].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 12ULL; + listHolder_3->mList[1] = 13ULL; + listHolder_3->mList[2] = 14ULL; + listHolder_3->mList[3] = 15ULL; + listHolder_0->mList[2].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[2].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 16U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 17UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 18UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 19U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[2].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[2].fabricIndex = 0U; + + listHolder_0->mList[3].privilege = + static_cast(3); + listHolder_0->mList[3].authMode = + static_cast(2); + listHolder_0->mList[3].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 20ULL; + listHolder_3->mList[1] = 21ULL; + listHolder_3->mList[2] = 22ULL; + listHolder_3->mList[3] = 23ULL; + listHolder_0->mList[3].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[3].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 24U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 25UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 26UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 27U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[3].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[3].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Write entries empty lists"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(); + listHolder_0->mList[1].targets.SetNonNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List(); + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Write entry invalid privilege"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(5); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Write entry invalid auth mode"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(1); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Write entry invalid subject"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 0ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Write entry invalid target"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNull(); + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Write entry too many subjects"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(20); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 1ULL; + listHolder_3->mList[1] = 2ULL; + listHolder_3->mList[2] = 3ULL; + listHolder_3->mList[3] = 4ULL; + listHolder_3->mList[4] = 5ULL; + listHolder_3->mList[5] = 6ULL; + listHolder_3->mList[6] = 7ULL; + listHolder_3->mList[7] = 8ULL; + listHolder_3->mList[8] = 9ULL; + listHolder_3->mList[9] = 10ULL; + listHolder_3->mList[10] = 11ULL; + listHolder_3->mList[11] = 12ULL; + listHolder_3->mList[12] = 13ULL; + listHolder_3->mList[13] = 14ULL; + listHolder_3->mList[14] = 15ULL; + listHolder_3->mList[15] = 16ULL; + listHolder_3->mList[16] = 17ULL; + listHolder_3->mList[17] = 18ULL; + listHolder_3->mList[18] = 19ULL; + listHolder_3->mList[19] = 20ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 20); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Write entry too many targets"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(20); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 1U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNull(); + listHolder_3->mList[1].endpoint.SetNonNull(); + listHolder_3->mList[1].endpoint.Value() = 2U; + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNull(); + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 3U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_3->mList[3].cluster.SetNull(); + listHolder_3->mList[3].endpoint.SetNonNull(); + listHolder_3->mList[3].endpoint.Value() = 4U; + listHolder_3->mList[3].deviceType.SetNull(); + + listHolder_3->mList[4].cluster.SetNull(); + listHolder_3->mList[4].endpoint.SetNonNull(); + listHolder_3->mList[4].endpoint.Value() = 5U; + listHolder_3->mList[4].deviceType.SetNull(); + + listHolder_3->mList[5].cluster.SetNull(); + listHolder_3->mList[5].endpoint.SetNonNull(); + listHolder_3->mList[5].endpoint.Value() = 6U; + listHolder_3->mList[5].deviceType.SetNull(); + + listHolder_3->mList[6].cluster.SetNull(); + listHolder_3->mList[6].endpoint.SetNonNull(); + listHolder_3->mList[6].endpoint.Value() = 7U; + listHolder_3->mList[6].deviceType.SetNull(); + + listHolder_3->mList[7].cluster.SetNull(); + listHolder_3->mList[7].endpoint.SetNonNull(); + listHolder_3->mList[7].endpoint.Value() = 8U; + listHolder_3->mList[7].deviceType.SetNull(); + + listHolder_3->mList[8].cluster.SetNull(); + listHolder_3->mList[8].endpoint.SetNonNull(); + listHolder_3->mList[8].endpoint.Value() = 9U; + listHolder_3->mList[8].deviceType.SetNull(); + + listHolder_3->mList[9].cluster.SetNull(); + listHolder_3->mList[9].endpoint.SetNonNull(); + listHolder_3->mList[9].endpoint.Value() = 10U; + listHolder_3->mList[9].deviceType.SetNull(); + + listHolder_3->mList[10].cluster.SetNull(); + listHolder_3->mList[10].endpoint.SetNonNull(); + listHolder_3->mList[10].endpoint.Value() = 11U; + listHolder_3->mList[10].deviceType.SetNull(); + + listHolder_3->mList[11].cluster.SetNull(); + listHolder_3->mList[11].endpoint.SetNonNull(); + listHolder_3->mList[11].endpoint.Value() = 12U; + listHolder_3->mList[11].deviceType.SetNull(); + + listHolder_3->mList[12].cluster.SetNull(); + listHolder_3->mList[12].endpoint.SetNonNull(); + listHolder_3->mList[12].endpoint.Value() = 13U; + listHolder_3->mList[12].deviceType.SetNull(); + + listHolder_3->mList[13].cluster.SetNull(); + listHolder_3->mList[13].endpoint.SetNonNull(); + listHolder_3->mList[13].endpoint.Value() = 14U; + listHolder_3->mList[13].deviceType.SetNull(); + + listHolder_3->mList[14].cluster.SetNull(); + listHolder_3->mList[14].endpoint.SetNonNull(); + listHolder_3->mList[14].endpoint.Value() = 15U; + listHolder_3->mList[14].deviceType.SetNull(); + + listHolder_3->mList[15].cluster.SetNull(); + listHolder_3->mList[15].endpoint.SetNonNull(); + listHolder_3->mList[15].endpoint.Value() = 16U; + listHolder_3->mList[15].deviceType.SetNull(); + + listHolder_3->mList[16].cluster.SetNull(); + listHolder_3->mList[16].endpoint.SetNonNull(); + listHolder_3->mList[16].endpoint.Value() = 17U; + listHolder_3->mList[16].deviceType.SetNull(); + + listHolder_3->mList[17].cluster.SetNull(); + listHolder_3->mList[17].endpoint.SetNonNull(); + listHolder_3->mList[17].endpoint.Value() = 18U; + listHolder_3->mList[17].deviceType.SetNull(); + + listHolder_3->mList[18].cluster.SetNull(); + listHolder_3->mList[18].endpoint.SetNonNull(); + listHolder_3->mList[18].endpoint.Value() = 19U; + listHolder_3->mList[18].deviceType.SetNull(); + + listHolder_3->mList[19].cluster.SetNull(); + listHolder_3->mList[19].endpoint.SetNonNull(); + listHolder_3->mList[19].endpoint.Value() = 20U; + listHolder_3->mList[19].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 20); + } + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Write too many entries"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(5); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 1UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 2UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 3U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 4ULL; + listHolder_3->mList[1] = 5ULL; + listHolder_3->mList[2] = 6ULL; + listHolder_3->mList[3] = 7ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 8U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 9UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 10UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 11U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[1].fabricIndex = 0U; + + listHolder_0->mList[2].privilege = + static_cast(3); + listHolder_0->mList[2].authMode = + static_cast(3); + listHolder_0->mList[2].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 12ULL; + listHolder_3->mList[1] = 13ULL; + listHolder_3->mList[2] = 14ULL; + listHolder_3->mList[3] = 15ULL; + listHolder_0->mList[2].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[2].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 16U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 17UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 18UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 19U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[2].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[2].fabricIndex = 0U; + + listHolder_0->mList[3].privilege = + static_cast(1); + listHolder_0->mList[3].authMode = + static_cast(2); + listHolder_0->mList[3].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 20ULL; + listHolder_3->mList[1] = 21ULL; + listHolder_3->mList[2] = 22ULL; + listHolder_3->mList[3] = 23ULL; + listHolder_0->mList[3].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[3].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 24U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 25UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 26UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 27U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[3].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[3].fabricIndex = 0U; + + listHolder_0->mList[4].privilege = + static_cast(3); + listHolder_0->mList[4].authMode = + static_cast(2); + listHolder_0->mList[4].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 28ULL; + listHolder_3->mList[1] = 29ULL; + listHolder_3->mList[2] = 30ULL; + listHolder_3->mList[3] = 31ULL; + listHolder_0->mList[4].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[4].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 32U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 33UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 34UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 35U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[4].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 3); + } + listHolder_0->mList[4].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 5); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Restore ACL"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 20: { + LogStep(20, "Verify"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Validate resource minima (SubjectsPerAccessControlEntry)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::SubjectsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Validate resource minima (TargetsPerAccessControlEntry)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::TargetsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Validate resource minima (AccessControlEntriesPerFabric)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::AccessControlEntriesPerFabric::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_1_1Suite : public TestCommand +{ +public: + Test_TC_ACL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_1_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads ClusterRevision attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads FeatureMap attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads AttributeList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList attribute from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: TH reads optional attribute (Extension) in AttributeList"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 4c: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 5a: TH reads EventList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 5b: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1. The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_1Suite : public TestCommand +{ +public: + Test_TC_ACL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_1", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads SubjectsPerAccessControlEntry attribute from DUT"); + VerifyOrDo(!ShouldSkip("ACL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::SubjectsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads TargetsPerAccessControlEntry attribute from DUT"); + VerifyOrDo(!ShouldSkip("ACL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::TargetsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads AccessControlEntriesPerFabric attribute from DUT"); + VerifyOrDo(!ShouldSkip("ACL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::AccessControlEntriesPerFabric::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_3Suite : public TestCommand +{ +public: + Test_TC_ACL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_3", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("D_OK_FULL", &mDOkFull); + AddArgument("D_BAD_LENGTH", &mDBadLength); + AddArgument("D_BAD_STRUCT", &mDBadStruct); + AddArgument("D_BAD_LIST", &mDBadList); + AddArgument("D_BAD_ELEM", &mDBadElem); + AddArgument("D_BAD_OVERFLOW", &mDBadOverflow); + AddArgument("D_BAD_UNDERFLOW", &mDBadUnderflow); + AddArgument("D_BAD_NONE", &mDBadNone); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mDOkFull; + chip::Optional mDBadLength; + chip::Optional mDBadStruct; + chip::Optional mDBadList; + chip::Optional mDBadElem; + chip::Optional mDBadOverflow; + chip::Optional mDBadUnderflow; + chip::Optional mDBadNone; + chip::Optional mTimeout; + + uint8_t CurrentFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CurrentFabricIndex = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 0)); + } + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64" + "\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65" + "\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63" + "\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkFull.HasValue() + ? mDOkFull.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74" + "\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67" + "\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74" + "\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 128))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 0)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, + "Step 4: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct: Data field: D_OK_EMPTY : 1718"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 6: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_SINGLE " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 8: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656" + "C656D656E7420616761696E2E2E2E2E2E0018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkFull.HasValue() + ? mDOkFull.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20" + "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65" + "\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72" + "\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C" + "\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C" + "\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 128); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 10: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_LENGTH " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656" + "C656D656E7420616761696E2E2E2E2E2E2E0018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadLength.HasValue() + ? mDBadLength.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20" + "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65" + "\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72" + "\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x32\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C" + "\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C" + "\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 129); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 11: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_STRUCT : 1518"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDBadStruct.HasValue() ? mDBadStruct.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x15\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 12: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_LIST " + ":3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672" + "0617320612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadList.HasValue() + ? mDBadList.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x37\x01\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69" + "\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 72); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 13: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_ELEM " + ":17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206173206120636" + "86172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadElem.HasValue() + ? mDBadElem.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\x10\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69" + "\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 65); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 14: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_OVERFLOW : " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061" + "7320612063686172737472696E670018FF"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadOverflow.HasValue() + ? mDBadOverflow.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18\xFF"), + 72); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 15: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_UNDERFLOW " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadUnderflow.HasValue() + ? mDBadUnderflow.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00"), + 70); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 16: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDBadNone.HasValue() ? mDBadNone.Value() : chip::ByteSpan(chip::Uint8::from_const_char(""), 0); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep( + 16, + "Step 17: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 2 elements . value is list of AccessControlExtensionStruct containing 2 " + "elements . first element contains Data field: D_OK_EMPTY 1718 . second element contains Data field: D_OK_SINGLE " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320" + "612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 18: TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 19: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 20: TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_4Suite : public TestCommand +{ +public: + Test_TC_ACL_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_4", 45, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("CAT1", 0, UINT64_MAX, &mCat1); + AddArgument("CAT2", 0, UINT64_MAX, &mCat2); + AddArgument("CAT3", 0, UINT64_MAX, &mCat3); + AddArgument("CAT4", 0, UINT64_MAX, &mCat4); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mCat1; + chip::Optional mCat2; + chip::Optional mCat3; + chip::Optional mCat4; + chip::Optional mTimeout; + + chip::NodeId CommissionerNodeId; + uint8_t CurrentFabricIndex; + uint16_t MAXSUBJECTS; + uint16_t TargetsPerAccessControlEntry; + uint16_t MAXENTRIES; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CurrentFabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), 111ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_3.GetValue(), 222ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_3.GetValue(), 333ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_3.GetValue(), 444ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 11UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 22U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_3, 1)); + } + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[2].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[0]", iter_3.GetValue(), 555ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[1]", iter_3.GetValue(), 666ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[2]", iter_3.GetValue(), 777ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[3]", iter_3.GetValue(), 888ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[2].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[2].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 55UL)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 66U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].targets.Value()", iter_3, 1)); + } + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 3)); + } + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 4U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), 444ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_3.GetValue(), 333ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_3.GetValue(), 222ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_3.GetValue(), 111ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 44UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 33U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_3, 1)); + } + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[2].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[0]", iter_3.GetValue(), 888ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[1]", iter_3.GetValue(), 777ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[2]", iter_3.GetValue(), 666ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[3]", iter_3.GetValue(), 555ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[2].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[2].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 88UL)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 77U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].targets.Value()", iter_3, 1)); + } + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 3)); + } + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), 111ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_3.GetValue(), 222ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_3.GetValue(), 333ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_3.GetValue(), 444ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 11UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 22U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 33UL)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[1].deviceType.Value()", iter_3.GetValue().deviceType.Value(), 44UL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_3, 2)); + } + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[2].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[0]", iter_3.GetValue(), 555ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[1]", iter_3.GetValue(), 666ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[2]", iter_3.GetValue(), 777ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[3]", iter_3.GetValue(), 888ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[2].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[2].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 55UL)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 66U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 77UL)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[1].deviceType.Value()", iter_3.GetValue().deviceType.Value(), 88UL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].targets.Value()", iter_3, 2)); + } + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 3)); + } + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[1].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 11UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 22U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 33UL)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckValue("acl[1].targets.Value()[1].deviceType.Value()", iter_3.GetValue().deviceType.Value(), 44UL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_3, 2)); + } + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNull("acl[2].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets", iter_0.GetValue().targets)); + { + auto iter_3 = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 0)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].cluster.Value()", iter_3.GetValue().cluster.Value(), 55UL)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[0].endpoint.Value()", iter_3.GetValue().endpoint.Value(), 66U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].targets.Value()", iter_3, 1)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[1].cluster", iter_3.GetValue().cluster)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[1].cluster.Value()", iter_3.GetValue().cluster.Value(), 77UL)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].endpoint", iter_3.GetValue().endpoint)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[1].deviceType", iter_3.GetValue().deviceType)); + VerifyOrReturn( + CheckValue("acl[2].targets.Value()[1].deviceType.Value()", iter_3.GetValue().deviceType.Value(), 88UL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].targets.Value()", iter_3, 2)); + } + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 3)); + } + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), 111ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_3.GetValue(), 222ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_3.GetValue(), 333ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_3.GetValue(), 444ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNull("acl[1].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[2].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[0]", iter_3.GetValue(), 555ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[1]", iter_3.GetValue(), 666ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[2]", iter_3.GetValue(), 777ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[2].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[3]", iter_3.GetValue(), 888ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[2].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNull("acl[2].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 3)); + } + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNull("acl[1].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[1].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 2)); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 2U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[1].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[1].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 2)); + } + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + MAXSUBJECTS = value; + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), + mCat1.HasValue() ? mCat1.Value() : 65520ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_3.GetValue(), + mCat2.HasValue() ? mCat2.Value() : 65521ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_3.GetValue(), + mCat3.HasValue() ? mCat3.Value() : 65522ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_3.GetValue(), + mCat4.HasValue() ? mCat4.Value() : 65523ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 4)); + } + VerifyOrReturn(CheckValueNull("acl[1].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 2)); + } + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TargetsPerAccessControlEntry = value; + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + MAXENTRIES = value; + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[1].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[1].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNull("acl[2].subjects", iter_0.GetValue().subjects)); + VerifyOrReturn(CheckValueNull("acl[2].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 3)); + } + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1:Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 2:TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3:TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 4: { + LogStep( + 4, + "Step 4:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of AccessControlEntryStruct " + "containing 3 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE (2) Subjects field: [N1] " + "Targets field: null 2 . struct Privilege field: View (1) AuthMode field: CASE (3) Subjects field: [111, 222, 333, " + "444] Targets field: [{Cluster: 11}, {Endpoint: 22}] 3..struct Privilege field: Operate (3) AuthMode field: Group " + "(3) Subjects field: [555, 666, 777, 888] Targets field: [{Cluster: 55}, {Endpoint: 66}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 111ULL; + listHolder_3->mList[1] = 222ULL; + listHolder_3->mList[2] = 333ULL; + listHolder_3->mList[3] = 444ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 11UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 22U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[2].privilege = + static_cast(3); + listHolder_0->mList[2].authMode = + static_cast(3); + listHolder_0->mList[2].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 555ULL; + listHolder_3->mList[1] = 666ULL; + listHolder_3->mList[2] = 777ULL; + listHolder_3->mList[3] = 888ULL; + listHolder_0->mList[2].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[2].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 55UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 66U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[2].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[2].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5:TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 6: { + LogStep( + 6, + "Step 6:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of AccessControlEntryStruct " + "containing 3 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE (2) Subjects field: [N1] " + "Targets field: null 2.struct Privilege field: Manage (4) AuthMode field: Group (3) Subjects field: [444, 333, " + "222, 111] Targets field: [{Cluster: 44}, {Endpoint: 33}] 3.struct Privilege field: Administer (5) AuthMode field: " + "CASE (2) Subjects field: [888, 777, 666, 555] Targets field: [{Cluster: 88}, {Endpoint: 77}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(4); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 444ULL; + listHolder_3->mList[1] = 333ULL; + listHolder_3->mList[2] = 222ULL; + listHolder_3->mList[3] = 111ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 44UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 33U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[2].privilege = + static_cast(5); + listHolder_0->mList[2].authMode = + static_cast(2); + listHolder_0->mList[2].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 888ULL; + listHolder_3->mList[1] = 777ULL; + listHolder_3->mList[2] = 666ULL; + listHolder_3->mList[3] = 555ULL; + listHolder_0->mList[2].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[2].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 88UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 77U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[2].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[2].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7:TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 8:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 3 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: View (1) AuthMode field: CASE (2) " + "Subjects field: [111, 222, 333, 444] Targets field: [{Cluster: 11, Endpoint: 22}, {Cluster: 33, DeviceType: " + "44}] 3.struct Privilege field: Operate (3) AuthMode field: Group (3) Subjects field: [555, 666, 777, 888] " + "Targets field: [{Cluster: 55, Endpoint: 66}, {Cluster: 77, DeviceType: 88}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 111ULL; + listHolder_3->mList[1] = 222ULL; + listHolder_3->mList[2] = 333ULL; + listHolder_3->mList[3] = 444ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(2); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 11UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 22U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 33UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNonNull(); + listHolder_3->mList[1].deviceType.Value() = 44UL; + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 2); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[2].privilege = + static_cast(3); + listHolder_0->mList[2].authMode = + static_cast(3); + listHolder_0->mList[2].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 555ULL; + listHolder_3->mList[1] = 666ULL; + listHolder_3->mList[2] = 777ULL; + listHolder_3->mList[3] = 888ULL; + listHolder_0->mList[2].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[2].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(2); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 55UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 66U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 77UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNonNull(); + listHolder_3->mList[1].deviceType.Value() = 88UL; + + listHolder_0->mList[2].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 2); + } + listHolder_0->mList[2].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 9:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 10:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 3 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: View (1) AuthMode field: CASE (2) " + "Subjects field: null Targets field: [{Cluster: 11, Endpoint: 22}, {Cluster: 33, DeviceType: 44}] 3.struct " + "Privilege field: Operate (3) AuthMode field: Group (3) Subjects field: null Targets field: [{Cluster: 55, " + "Endpoint: 66}, {Cluster: 77, DeviceType: 88}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(2); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 11UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 22U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 33UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNonNull(); + listHolder_3->mList[1].deviceType.Value() = 44UL; + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 2); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[2].privilege = + static_cast(3); + listHolder_0->mList[2].authMode = + static_cast(3); + listHolder_0->mList[2].subjects.SetNull(); + listHolder_0->mList[2].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(2); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 55UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 66U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 77UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNonNull(); + listHolder_3->mList[1].deviceType.Value() = 88UL; + + listHolder_0->mList[2].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 2); + } + listHolder_0->mList[2].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 11:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 12:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 3 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: View (1) AuthMode field: CASE (2) " + "Subjects field: [111, 222, 333, 444] Targets field: null 3.struct Privilege field: Operate (3) AuthMode " + "field: Group (3) Subjects field: [555, 666, 777, 888] Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 111ULL; + listHolder_3->mList[1] = 222ULL; + listHolder_3->mList[2] = 333ULL; + listHolder_3->mList[3] = 444ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[2].privilege = + static_cast(3); + listHolder_0->mList[2].authMode = + static_cast(3); + listHolder_0->mList[2].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 555ULL; + listHolder_3->mList[1] = 666ULL; + listHolder_3->mList[2] = 777ULL; + listHolder_3->mList[3] = 888ULL; + listHolder_0->mList[2].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[2].targets.SetNull(); + listHolder_0->mList[2].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 13:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 14:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: Group (3) " + "Subjects field: null Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 15:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 16:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: ProxyView (2) AuthMode field: CASE (2) " + "Subjects field: null Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(2); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 17:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 18:TH1 reads DUT AccessControl cluster SubjectsPerAccessControlEntry attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::SubjectsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 19:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: list of MAXSUBJECTS random node IDs (stored as SUBJECTS) Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 20:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 21: { + LogStep(21, + "Step 21:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: [CAT1, CAT2, CAT3, CAT4] Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = mCat1.HasValue() ? mCat1.Value() : 65520ULL; + listHolder_3->mList[1] = mCat2.HasValue() ? mCat2.Value() : 65521ULL; + listHolder_3->mList[2] = mCat3.HasValue() ? mCat3.Value() : 65522ULL; + listHolder_3->mList[3] = mCat4.HasValue() ? mCat4.Value() : 65523ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 22:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Step 23:TH1 reads AccessControl cluster TargetsPerAccessControlEntry attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::TargetsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 24:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field:null Targets field: list of MAXTARGETS targets {Cluster: random} (stored as TARGETS)"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Step 25:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 26:TH1 reads AccessControl cluster AccessControlEntriesPerFabric attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::AccessControlEntriesPerFabric::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 27:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing MAXENTRIES elements 1.struct Privilege field: Administer (5) AuthMode " + "field: CASE (2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode " + "field: CASE (2) Subjects field: null Targets field: null subsequent elements same as second element"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[2].privilege = + static_cast(3); + listHolder_0->mList[2].authMode = + static_cast(2); + listHolder_0->mList[2].subjects.SetNull(); + listHolder_0->mList[2].targets.SetNull(); + listHolder_0->mList[2].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 28:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 29:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: PASE (1) " + "Subjects field: null Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(1); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 30: { + LogStep(30, "Step 30:TH1 reads AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 31:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Administer (5) AuthMode field: Group " + "(3) Subjects field: null Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(5); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 32: { + LogStep(32, + "Step 32:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: invalid value (not 1-5) AuthMode " + "field: CASE (2) Subjects field: null Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(6); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 33:TH1 writes AccessControl cluster ACL attribute, value is list of AccessControlEntryStruct containing " + "2 elements"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(6); + listHolder_0->mList[1].authMode = + static_cast(4); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 34: { + LogStep(34, + "Step 34:TH1 writes AccessControl cluster ACL attribute, value is list of AccessControlEntryStruct containing " + "2 elements"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 0ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 35: { + LogStep(35, + "Step 35:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: [0xFFFFFFFFFFFFFFFF] Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 18446744073709551615ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 36: { + LogStep(36, + "Step 36:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: [0xFFFFFFFD00000000] Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 18446744060824649728ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 37: { + LogStep(37, + "Step 37:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: [0xFFFFFFFFFFFF0000] Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 18446744073709486080ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 38: { + LogStep(38, + "Step 38:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: null Targets field: [{}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNull(); + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 39: { + LogStep(39, + "Step 39:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: null Targets field: [{Cluster: 0xFFFFFFFF}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 4294967295UL; + listHolder_3->mList[0].endpoint.SetNull(); + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 40: { + LogStep(40, + "Step 40:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1. struct Privilege field: Administer (5) AuthMode field: " + "CASE (2) Subjects field: [N1] Targets field: null 2. struct Privilege field: Operate (3) AuthMode field: " + "CASE (2) Subjects field: null Targets field: [{Endpoint: 65535}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 65535U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 41: { + LogStep(41, + "Step 41:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: null Targets field: [{DeviceType: 0xFFFFFFFF}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNull(); + listHolder_3->mList[0].deviceType.SetNonNull(); + listHolder_3->mList[0].deviceType.Value() = 4294967295UL; + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 42: { + LogStep(42, + "Step 42:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: null Targets field: [{Endpoint: 22, DeviceType: 33}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 22U; + listHolder_3->mList[0].deviceType.SetNonNull(); + listHolder_3->mList[0].deviceType.Value() = 33UL; + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, + "Step 43:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) " + "Subjects field: null Targets field: [{Cluster: 11, Endpoint: 22, DeviceType: 33}]"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 11UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 22U; + listHolder_3->mList[0].deviceType.SetNonNull(); + listHolder_3->mList[0].deviceType.Value() = 33UL; + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 44: { + LogStep(44, "Step 44:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute value is an empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_5Suite : public TestCommand +{ +public: + Test_TC_ACL_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_5", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("D_BAD_LENGTH", &mDBadLength); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mDBadLength; + chip::Optional mTimeout; + + chip::NodeId CommissionerNodeId; + uint8_t CurrentFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CurrentFabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("accessControlExtensionChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.adminNodeID.Value()", value.adminNodeID.Value(), + CommissionerNodeId)); + VerifyOrReturn(CheckValueNull("accessControlExtensionChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlExtensionChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValueAsString( + "accessControlExtensionChanged.latestValue.Value().data", value.latestValue.Value().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.fabricIndex", value.fabricIndex, CurrentFabricIndex)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: TH commissions DUT using admin node ID N1"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 2: TH reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 4: { + LogStep(4, + "Step 4: TH writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element struct Data field: D_OK_EMPTY"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Events::AccessControlExtensionChanged::Id, false, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 6: TH writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element struct Data field: D_OK_SINGLE"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 8: TH writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element struct Data field: D_BAD_LENGTH"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadLength.HasValue() + ? mDBadLength.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20" + "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65" + "\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72" + "\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x32\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C" + "\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C" + "\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 129); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 9: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep( + 10, + "Step 10: TH writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 2 elements struct Data field: D_OK_EMPTY struct Data field: D_OK_SINGLE"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 11: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 12: TH writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 13: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_6Suite : public TestCommand +{ +public: + Test_TC_ACL_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_6", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::NodeId CommissionerNodeId; + uint8_t CurrentFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CurrentFabricIndex = value; + } + break; + case 3: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("accessControlEntryChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn( + CheckValue("accessControlEntryChanged.adminPasscodeID.Value()", value.adminPasscodeID.Value(), 0U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().privilege", + value.latestValue.Value().privilege, 5U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().authMode", + value.latestValue.Value().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue.Value().subjects", + value.latestValue.Value().subjects)); + { + auto iter_4 = value.latestValue.Value().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 0)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[0]", + iter_4.GetValue(), CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 1)); + } + VerifyOrReturn( + CheckValueNull("accessControlEntryChanged.latestValue.Value().targets", value.latestValue.Value().targets)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.fabricIndex", value.fabricIndex, CurrentFabricIndex)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: TH commissions DUT using admin node ID N1"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 2: TH reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Events::AccessControlEntryChanged::Id, false, chip::NullOptional); + } + case 4: { + LogStep(4, + "Step 4: TH writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of " + "AccessControlEntryStruct containing 2 elements 1.struct Privilege field: Administer (5) AuthMode field: CASE " + "(2) Subjects field: [N1] Targets field: null 2struct Privilege field: Operate (3) AuthMode field: Group (3) " + "Subjects field: null Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep( + 6, + "Step 6: TH writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of AccessControlEntryStruct " + "containing 2 elements. The first item is valid, the second item is invalid due to group ID 0 being used, which is " + "illegal. 1.struct Privilege field: Administer (5) AuthMode field: CASE (2) Subjects field: [N1] Targets field: " + "null 2.struct Privilege field: Operate (3) AuthMode field: Group (3) Subjects field: [0] Targets field: null"); + VerifyOrDo(!ShouldSkip("ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 0ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: TH reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_7Suite : public TestCommand +{ +public: + Test_TC_ACL_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_7", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("payload", &mPayload); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + AddArgument("PakeVerifier", &mPakeVerifier); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mNodeId2; + chip::Optional mPayload; + chip::Optional mDiscriminator; + chip::Optional mWaitAfterCommissioning; + chip::Optional mPakeVerifier; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mTimeout; + + chip::NodeId TH1CommissionerNodeId; + uint8_t TH1FabricIndex; + chip::NodeId TH2CommissionerNodeId; + uint8_t TH2FabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH1CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH1FabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2FabricIndex = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64" + "\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65" + "\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63" + "\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("accessControlExtensionChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.adminNodeID.Value()", value.adminNodeID.Value(), + TH1CommissionerNodeId)); + VerifyOrReturn(CheckValueNull("accessControlExtensionChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlExtensionChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValueAsString( + "accessControlExtensionChanged.latestValue.Value().data", value.latestValue.Value().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.fabricIndex", value.fabricIndex, TH1FabricIndex)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 18: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("accessControlExtensionChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.adminNodeID.Value()", value.adminNodeID.Value(), + TH2CommissionerNodeId)); + VerifyOrReturn(CheckValueNull("accessControlExtensionChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlExtensionChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValueAsString( + "accessControlExtensionChanged.latestValue.Value().data", value.latestValue.Value().data, + mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64" + "\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65" + "\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63" + "\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71))); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckValue("accessControlExtensionChanged.fabricIndex", value.fabricIndex, TH2FabricIndex)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1:Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the TH1 commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 2:TH1 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3:TH1 puts DUT into commissioning mode"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3 & 4: TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID N2"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Waiting after opening commissioning window"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4:TH2 starts a commissioning process with DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 7: { + LogStep(7, "DUT is commissioned by TH2 on Fabric ID2 "); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 8: { + LogStep(8, "Read the TH2 commissioner node ID"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityBeta, value); + } + case 9: { + LogStep(9, "Step 5:TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 5:TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, + "Step 6:TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = TH1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 7:TH2 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[0].fabricIndex = TH2FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 7:TH2 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 8:TH1 reads AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 9:TH2 reads AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 9:TH2 reads AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 10:TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Events::AccessControlExtensionChanged::Id, false, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 11:TH2 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E01 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityBeta, GetEndpoint(0), AccessControl::Id, + AccessControl::Events::AccessControlExtensionChanged::Id, false, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 11:TH2 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "TH1 writes Extension attribute value as empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 21: { + LogStep(21, "TH2 writes Extension attribute value as empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 22: { + LogStep(22, "TH2 writes Extension attribute value as empty list"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Remove TH2 FabricIndex"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = TH2FabricIndex; + return SendCommand(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Remove TH2 FabricIndex"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_8Suite : public TestCommand +{ +public: + Test_TC_ACL_2_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_8", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + AddArgument("payload", &mPayload); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("PakeVerifier", &mPakeVerifier); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mNodeId2; + chip::Optional mWaitAfterCommissioning; + chip::Optional mPayload; + chip::Optional mDiscriminator; + chip::Optional mPakeVerifier; + chip::Optional mTimeout; + + chip::NodeId TH1CommissionerNodeId; + uint8_t TH1FabricIndex; + chip::NodeId TH2CommissionerNodeId; + uint8_t TH2FabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH1CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH1FabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2FabricIndex = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), TH1CommissionerNodeId)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[1]", iter_3.GetValue(), 1111ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 2)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), TH2CommissionerNodeId)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[1]", iter_3.GetValue(), 2222ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 2)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("accessControlEntryChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn( + CheckValue("accessControlEntryChanged.adminPasscodeID.Value()", value.adminPasscodeID.Value(), 0U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().privilege", + value.latestValue.Value().privilege, 5U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().authMode", + value.latestValue.Value().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue.Value().subjects", + value.latestValue.Value().subjects)); + { + auto iter_4 = value.latestValue.Value().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 0)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[0]", + iter_4.GetValue(), TH1CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 1)); + } + VerifyOrReturn( + CheckValueNull("accessControlEntryChanged.latestValue.Value().targets", value.latestValue.Value().targets)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.fabricIndex", value.fabricIndex, TH1FabricIndex)); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.adminNodeID.Value()", value.adminNodeID.Value(), + TH1CommissionerNodeId)); + VerifyOrReturn(CheckValueNull("accessControlEntryChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.changeType", value.changeType, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().privilege", + value.latestValue.Value().privilege, 5U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().authMode", + value.latestValue.Value().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue.Value().subjects", + value.latestValue.Value().subjects)); + { + auto iter_4 = value.latestValue.Value().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 0)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[0]", + iter_4.GetValue(), TH1CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 1)); + } + VerifyOrReturn( + CheckValueNull("accessControlEntryChanged.latestValue.Value().targets", value.latestValue.Value().targets)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.fabricIndex", value.fabricIndex, TH1FabricIndex)); + } + mTestSubStepIndex++; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.adminNodeID.Value()", value.adminNodeID.Value(), + TH1CommissionerNodeId)); + VerifyOrReturn(CheckValueNull("accessControlEntryChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().privilege", + value.latestValue.Value().privilege, 5U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().authMode", + value.latestValue.Value().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue.Value().subjects", + value.latestValue.Value().subjects)); + { + auto iter_4 = value.latestValue.Value().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 0)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[0]", + iter_4.GetValue(), TH1CommissionerNodeId)); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 1)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[1]", + iter_4.GetValue(), 1111ULL)); + VerifyOrReturn(CheckNoMoreListItems( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 2)); + } + VerifyOrReturn( + CheckValueNull("accessControlEntryChanged.latestValue.Value().targets", value.latestValue.Value().targets)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.fabricIndex", value.fabricIndex, TH1FabricIndex)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 18: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("accessControlEntryChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn( + CheckValue("accessControlEntryChanged.adminPasscodeID.Value()", value.adminPasscodeID.Value(), 0U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().privilege", + value.latestValue.Value().privilege, 5U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().authMode", + value.latestValue.Value().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue.Value().subjects", + value.latestValue.Value().subjects)); + { + auto iter_4 = value.latestValue.Value().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 0)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[0]", + iter_4.GetValue(), TH2CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 1)); + } + VerifyOrReturn( + CheckValueNull("accessControlEntryChanged.latestValue.Value().targets", value.latestValue.Value().targets)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.fabricIndex", value.fabricIndex, TH2FabricIndex)); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.adminNodeID.Value()", value.adminNodeID.Value(), + TH2CommissionerNodeId)); + VerifyOrReturn(CheckValueNull("accessControlEntryChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.changeType", value.changeType, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().privilege", + value.latestValue.Value().privilege, 5U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().authMode", + value.latestValue.Value().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue.Value().subjects", + value.latestValue.Value().subjects)); + { + auto iter_4 = value.latestValue.Value().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 0)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[0]", + iter_4.GetValue(), TH2CommissionerNodeId)); + VerifyOrReturn(CheckNoMoreListItems( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 1)); + } + VerifyOrReturn( + CheckValueNull("accessControlEntryChanged.latestValue.Value().targets", value.latestValue.Value().targets)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.fabricIndex", value.fabricIndex, TH2FabricIndex)); + } + mTestSubStepIndex++; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.adminNodeID", value.adminNodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.adminNodeID.Value()", value.adminNodeID.Value(), + TH2CommissionerNodeId)); + VerifyOrReturn(CheckValueNull("accessControlEntryChanged.adminPasscodeID", value.adminPasscodeID)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.changeType", value.changeType, 1U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue", value.latestValue)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().privilege", + value.latestValue.Value().privilege, 5U)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().authMode", + value.latestValue.Value().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("accessControlEntryChanged.latestValue.Value().subjects", + value.latestValue.Value().subjects)); + { + auto iter_4 = value.latestValue.Value().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 0)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[0]", + iter_4.GetValue(), TH2CommissionerNodeId)); + VerifyOrReturn(CheckNextListItemDecodes( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 1)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().subjects.Value()[1]", + iter_4.GetValue(), 2222ULL)); + VerifyOrReturn(CheckNoMoreListItems( + "accessControlEntryChanged.latestValue.Value().subjects.Value()", iter_4, 2)); + } + VerifyOrReturn( + CheckValueNull("accessControlEntryChanged.latestValue.Value().targets", value.latestValue.Value().targets)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.latestValue.Value().fabricIndex", + value.latestValue.Value().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckValue("accessControlEntryChanged.fabricIndex", value.fabricIndex, TH2FabricIndex)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the TH1 commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "TH1 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH1 puts DUT into commissioning mode"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Waiting after opening commissioning window"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID N2"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "TH2 starts a commissioning process with DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 7: { + LogStep(7, "DUT is commissioned by TH2 on Fabric ID2 "); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 8: { + LogStep(8, "Read the TH2 commissioner node ID"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityBeta, value); + } + case 9: { + LogStep(9, "TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH1CommissionerNodeId; + listHolder_3->mList[1] = 1111ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = TH1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "TH2 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH2CommissionerNodeId; + listHolder_3->mList[1] = 2222ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = TH2FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "TH2 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "TH2 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH2 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 3; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Events::AccessControlEntryChanged::Id, false, chip::NullOptional); + } + case 18: { + LogStep(18, "TH2 reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E00 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 3; + return ReadEvent(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Events::AccessControlEntryChanged::Id, + false, chip::NullOptional); + } + case 19: { + LogStep(19, "TH2 reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "TH1 writes ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH1CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 21: { + LogStep(21, "TH2 writes ACL attribute default value"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH2CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 22: { + LogStep(22, "TH2 writes ACL attribute default value"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Remove TH2 FabricIndex"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = TH2FabricIndex; + return SendCommand(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Remove TH2 FabricIndex"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_9Suite : public TestCommand +{ +public: + Test_TC_ACL_2_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_9", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mNodeId2; + chip::Optional mPayload; + chip::Optional mTimeout; + + chip::NodeId CommissionerNodeId; + uint8_t CurrentFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CurrentFabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + } + break; + case 11: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 12: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1:Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "TH1 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(4); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3:TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5:TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 6:TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 7:TH1 reads DUT Endpoint 0 AccessControl cluster SubjectsPerAccessControlEntry attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::SubjectsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 8:TH1 reads DUT Endpoint 0 AccessControl cluster TargetsPerAccessControlEntry attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::TargetsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 9:TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlEntriesPerFabric attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::AccessControlEntriesPerFabric::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 10:TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Events::AccessControlEntryChanged::Id, false, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 11:TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event"); + VerifyOrDo(!ShouldSkip("ACL.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Events::AccessControlExtensionChanged::Id, false, chip::NullOptional); + } + case 13: { + LogStep(13, "Test cleanup: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Test cleanup: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_10Suite : public TestCommand +{ +public: + Test_TC_ACL_2_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_10", 35, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + AddArgument("payload", &mPayload); + AddArgument("PakeVerifier", &mPakeVerifier); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mNodeId2; + chip::Optional mDiscriminator; + chip::Optional mWaitAfterCommissioning; + chip::Optional mPayload; + chip::Optional mPakeVerifier; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mTimeout; + + chip::NodeId TH1CommissionerNodeId; + uint8_t TH1FabricIndex; + chip::NodeId TH2CommissionerNodeId; + uint8_t TH2FabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH1CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH1FabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2CommissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2FabricIndex = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), TH2CommissionerNodeId)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[1]", iter_3.GetValue(), 2222ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 2)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 3U)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 3U)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[1].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_3.GetValue(), 4444ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[1].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[1].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 2)); + } + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1:Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the TH1 commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 2:TH1 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3:TH1 puts DUT into commissioning mode"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Waiting after opening commissioning window"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID N2"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "TH2 starts a commissioning process with DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 7: { + LogStep(7, "DUT is commissioned by TH2 on Fabric ID2"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 8: { + LogStep(8, "Read the TH2 commissioner node ID"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityBeta, value); + } + case 9: { + LogStep(9, "Step 4:TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4:TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 5:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH1CommissionerNodeId; + listHolder_3->mList[1] = 1111ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = TH1FabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 3333ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = TH1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 6:TH2 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH2CommissionerNodeId; + listHolder_3->mList[1] = 2222ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = TH2FabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 4444ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = TH2FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 6:TH2 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, + "Step 7:TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct, Data field: D_OK_EMPTY"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = TH1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 8:TH2 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct, Data field: D_OK_SINGLE"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[0].fabricIndex = TH2FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 8:TH2 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct, Data field: D_OK_SINGLE"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 9: Reboot DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 9: Reboot DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Reboot the DUT and enter 'y' after successgarbage: not in length on purpose", 42); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "TH1 Connects to the device again"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "TH2 Connects to the device again"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 21: { + LogStep(21, "Step 10:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH1CommissionerNodeId; + listHolder_3->mList[1] = 1111ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = TH1FabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 3333ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = TH1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 11:TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Step 12:TH2 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Step 12:TH2 reads DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Step 13:TH2 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001 && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[0].fabricIndex = TH2FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 13:TH2 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "Step 14: If DUT is an app on host, examine persistent storage in /tmp/chip_kvs text file"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 15:TH1 removes fabric F2 from DUT"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.C0a.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = TH2FabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Step 15:TH1 removes fabric F2 from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && OPCREDS.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 16:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH1CommissionerNodeId; + listHolder_3->mList[1] = 1111ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = TH1FabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 3333ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = TH1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 17:TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Step 18: If DUT is an app on host, examine persistent storage in /tmp/chip_kvs text file"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 33: { + LogStep(33, "TH1 writes Extension attribute value as empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 34: { + LogStep(34, "TH1 writes ACL attribute value is an empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = TH1CommissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACE_1_1Suite : public TestCommand +{ +public: + Test_TC_ACE_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACE_1_1", 38, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACE_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::NodeId commissionerNodeId; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + commissionerNodeId = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 1)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the commissioner node ID"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "TP2 - Write ACL giving admin privilege on all EP0"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "TP3 - Read the NOC attribute (Node operational credentials - requires administer)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::NOCs::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TP4 - Write the location attribute (Basic - requires administer)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("XXgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "TP5 - Send the UpdateFabricLabel command (Node operational credentials - requires administer)"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type value; + value.label = chip::Span("TestFabricgarbage: not in length on purpose", 10); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::UpdateFabricLabel::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "TP6 - Write NodeLabel attribute (Basic - requires manage)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("TestNodegarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "TP7 - Send TestEventTrigger (General Diagnostics - requires manage)"); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = chip::ByteSpan(chip::Uint8::from_const_char("0garbage: not in length on purpose"), 1); + value.eventTrigger = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "TP8 - Tead the VendorID attribute (Basic - requires view)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "TP9 - Write ACL giving admin privilege ACL, manage for rest of EP0"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 31UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(4); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "TP10 - Read the NOC attribute (Node operational credentials - requires administer)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::NOCs::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TP11 - Write the location attribute (Basic - requires administer)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("XXgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "TP12 - Send the UpdateFabricLabel command (Node operational credentials - requires administer)"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type value; + value.label = chip::Span("TestFabricgarbage: not in length on purpose", 10); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::UpdateFabricLabel::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TP13(6) - Write NodeLabel attribute (Basic - requires manage)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("TestNodegarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "TP13(7) - Send TestEventTrigger (General Diagnostics - requires manage)"); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = chip::ByteSpan(chip::Uint8::from_const_char("0garbage: not in length on purpose"), 1); + value.eventTrigger = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "TP13(8) - Tead the VendorID attribute (Basic - requires view)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "TP14 - Write ACL giving admin privilege ACL, operate for rest of EP0"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 31UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "TP15(10) - Read the NOC attribute (Node operational credentials - requires administer)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::NOCs::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "TP15(11) - Write the location attribute (Basic - requires administer)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("XXgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 19: { + LogStep(19, "TP15(12) - Send the UpdateFabricLabel command (Node operational credentials - requires administer)"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type value; + value.label = chip::Span("TestFabricgarbage: not in length on purpose", 10); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::UpdateFabricLabel::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "TP16 - Write NodeLabel attribute (Basic - requires manage)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("TestNodegarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 21: { + LogStep(21, "TP17 - Send TestEventTrigger (General Diagnostics - requires manage)"); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = chip::ByteSpan(chip::Uint8::from_const_char("0garbage: not in length on purpose"), 1); + value.eventTrigger = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "TP18(8) - Tead the VendorID attribute (Basic - requires view)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "TP19 - Write ACL giving admin privilege ACL, operate for rest of EP0"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 31UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 24: { + LogStep(24, "TP20(10) - Read the NOC attribute (Node operational credentials - requires administer)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::NOCs::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "TP20(11) - Write the location attribute (Basic - requires administer)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("XXgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 26: { + LogStep(26, "TP20(12) - Send the UpdateFabricLabel command (Node operational credentials - requires administer)"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type value; + value.label = chip::Span("TestFabricgarbage: not in length on purpose", 10); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::UpdateFabricLabel::Id, value, chip::NullOptional + + ); + } + case 27: { + LogStep(27, "TP21(16) - Write NodeLabel attribute (Basic - requires manage)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("TestNodegarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 28: { + LogStep(28, "TP21(17) - Send TestEventTrigger (General Diagnostics - requires manage)"); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = chip::ByteSpan(chip::Uint8::from_const_char("0garbage: not in length on purpose"), 1); + value.eventTrigger = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 29: { + LogStep(29, "TP22(8) - Tead the VendorID attribute (Basic - requires view)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 30: { + LogStep(30, "TP23 - Write ACL giving only admin privilege ACL cluster"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 31UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 31: { + LogStep(31, "TP24(10) - Read the NOC attribute (Node operational credentials - requires administer)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::NOCs::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "TP24(11) - Write the location attribute (Basic - requires administer)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("XXgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 33: { + LogStep(33, "TP24(12) - Send the UpdateFabricLabel command (Node operational credentials - requires administer)"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type value; + value.label = chip::Span("TestFabricgarbage: not in length on purpose", 10); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::UpdateFabricLabel::Id, value, chip::NullOptional + + ); + } + case 34: { + LogStep(34, "TP25(16) - Write NodeLabel attribute (Basic - requires manage)"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("TestNodegarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 35: { + LogStep(35, "TP25(17) - Send TestEventTrigger (General Diagnostics - requires manage)"); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = chip::ByteSpan(chip::Uint8::from_const_char("0garbage: not in length on purpose"), 1); + value.eventTrigger = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 36: { + LogStep(36, "TP26 - Tead the VendorID attribute (Basic - requires view)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 37: { + LogStep(37, "TP27 - Write ACL to restore full access"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeId; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACE_1_5Suite : public TestCommand +{ +public: + Test_TC_ACE_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACE_1_5", 23, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("payload", &mPayload); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + AddArgument("PakeVerifier", &mPakeVerifier); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACE_1_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mPayload; + chip::Optional mDiscriminator; + chip::Optional mWaitAfterCommissioning; + chip::Optional mPakeVerifier; + chip::Optional mTimeout; + + uint8_t th1FabricIndex; + uint8_t th2FabricIndex; + chip::NodeId commissionerNodeIdAlpha; + chip::NodeId commissionerNodeIdBeta; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + th1FabricIndex = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + th2FabricIndex = value; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + commissionerNodeIdAlpha = value.nodeId; + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + commissionerNodeIdBeta = value.nodeId; + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved for TH1"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH1 reads the fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2 & 3: TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID N2"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: Open Commissioning Window from alpha"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Waiting after opening commissioning window"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 3: Commission from TH2"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 6: { + LogStep(6, "Wait for the commissioned device to be retrieved for TH2"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 7: { + LogStep(7, "Step 4: TH2 reads the fabric index"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4: TH2 reads the fabric index"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Read the commissioner node ID from the alpha fabric"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 5: TH1 writes ACL giving view privilege for descriptor cluster"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeIdAlpha; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 31UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[0].fabricIndex = th1FabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 29UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = th1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, "Read the commissioner node ID from the beta fabric"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityBeta, value); + } + case 12: { + LogStep(12, "Step 6: TH2 writes ACL giving view privilge for basic cluster"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeIdBeta; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 31UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[0].fabricIndex = th2FabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(1); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 40UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = th2FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 6: TH2 writes ACL giving view privilge for basic cluster"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 7: TH1 reads descriptor cluster - expect SUCCESS"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::DeviceTypeList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 8: TH1 reads basic cluster - expect UNSUPPORTED_ACCESS"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 9: TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::DeviceTypeList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 9: TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 10: TH2 reads basic cluster - expect SUCCESS"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 10: TH2 reads basic cluster - expect SUCCESS"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 11: TH1 resets ACL to default"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeIdAlpha; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 12: TH1 sends RemoveFabric command for TH2"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = th2FabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Step 12: TH1 sends RemoveFabric command for TH2"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_AIRQUAL_1_1Suite : public TestCommand +{ +public: + Test_TC_AIRQUAL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_AIRQUAL_1_1", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_AIRQUAL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("!AIRQUAL.S.F00 && !AIRQUAL.S.F01 && !AIRQUAL.S.F02 && !AIRQUAL.S.F03"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given AIRQUAL.S.F00(Fair) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("AIRQUAL.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given AIRQUAL.S.F01(Moderate) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("AIRQUAL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given AIRQUAL.S.F02(VeryPoor) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("AIRQUAL.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given AIRQUAL.S.F03(ExtremelyPoor) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("AIRQUAL.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep( + 9, + "Step 4b: TH reads from the DUT the AttributeList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in " + "the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) and " + "(0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 5a: TH reads EventList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep( + 13, + "Step 6b: TH reads from the DUT the AcceptedCommandList attribute. 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list " + "MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep( + 15, + "Step 7b: TH reads from the DUT the GeneratedCommandList attribute. 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list " + "MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_AIRQUAL_2_1Suite : public TestCommand +{ +public: + Test_TC_AIRQUAL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_AIRQUAL_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_AIRQUAL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AirQuality::AirQualityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the AirQuality attribute."); + VerifyOrDo(!ShouldSkip("AIRQUAL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AirQuality::Id, AirQuality::Attributes::AirQuality::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BOOL_1_1Suite : public TestCommand +{ +public: + Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BOOL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("eventList", iter_0, 0)); + VerifyOrReturn(CheckValue("eventList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, + BooleanState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, + BooleanState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("BOOL.S.E00 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 7: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip(" !BOOL.S.E00 && PICS_EVENT_LIST_ENABLED "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BOOL_2_1Suite : public TestCommand +{ +public: + Test_TC_BOOL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BOOL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read mandatory non-global attribute: StateValue"); + VerifyOrDo(!ShouldSkip("BOOL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::StateValue::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRBINFO_1_1Suite : public TestCommand +{ +public: + Test_TC_BRBINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRBINFO_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRBINFO_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip(" !PICS_EVENT_LIST_ENABLED "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: TH reads optional attribute(VendorName) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4c: TH reads optional attribute(VendorID) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4d: TH reads optional attribute(ProductName) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4e: TH reads optional attribute(NodeLabel) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4f: TH reads optional attribute(HardwareVersion) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4g: TH reads optional attribute(HardwareVersionString) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4h: TH reads optional attribute(SoftwareVersion) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4i: TH reads optional attribute(SoftwareVersionString) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4j: TH reads optional attribute(ManufacturingDate) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4k: TH reads optional attribute(PartNumber) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4l: TH reads optional attribute(ProductURL) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4m: TH reads optional attribute(ProductLabel) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4n: TH reads optional attribute(SerialNumber) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4o: TH reads optional attribute(UniqueID) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4p: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 5a: TH reads optional event(StartUp) in EventList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.E00 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::EventList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 5b: TH reads optional attribute(ShutDown) in EventList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.E01 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::EventList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 5c: TH reads optional attribute(Leave) in EventList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.E02 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::EventList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 5d: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Step 6a: TH1 reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 7a: TH1 reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasicInformation::Id, + BridgedDeviceBasicInformation::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 7b: TH1 reads GeneratedCommandList from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACT_1_1Suite : public TestCommand +{ +public: + Test_TC_ACT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACT_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 11)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Actions::Id, Actions::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Actions::Id, Actions::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Actions::Id, Actions::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Actions::Id, Actions::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: Read the optional attribute(SetupURL) in AttributeList"); + VerifyOrDo(!ShouldSkip("ACT.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Actions::Id, Actions::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: TH reads EventList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 6: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Actions::Id, Actions::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 7: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Actions::Id, Actions::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BIND_1_1Suite : public TestCommand +{ +public: + Test_TC_BIND_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BIND_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_1_1Suite : public TestCommand +{ +public: + Test_TC_CC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_1_1", 79, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16385UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16394UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16385UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16394UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 21UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 22UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 25UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 32UL)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 33UL)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 34UL)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 36UL)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 37UL)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 38UL)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 40UL)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 42UL)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 48UL)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 49UL)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 50UL)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 51UL)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 52UL)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 54UL)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 55UL)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 56UL)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 58UL)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 59UL)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 60UL)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16384UL)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16386UL)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16387UL)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16388UL)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16389UL)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16390UL)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16395UL)); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16396UL)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16397UL)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16400UL)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + } + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65UL)); + } + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 66UL)); + } + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 67UL)); + } + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 68UL)); + } + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 71UL)); + } + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 75UL)); + } + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 76UL)); + } + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("( !CC.S.F00 && !CC.S.F01 && !CC.S.F02 && !CC.S.F03 && !CC.S.F04 )"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given CC.S.F00(HS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given CC.S.F01(EHue) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given CC.S.F02(CL) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given CC.S.F03(XY) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given CC.S.F04(CT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4b: Read the optional attribute(CurrentHue) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4c: Read the optional attribute(CurrentSaturation) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4d: Read the optional attribute(RemainingTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4e: Read the optional attribute(CurrentX) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4f: Read the optional attribute(CurrentY) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4g: Read the optional attribute(DriftCompensation) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4h: Read the optional attribute(CompensationText) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4i: Read the optional attribute(ColorTemperatureMireds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4j: Read the optional attribute(NumberOfPrimaries) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4k: Read the optional attribute(Primary1X) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 4l: Read the optional attribute(Primary1Y) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 4m: Read the optional attribute(Primary1Intensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 4n: Read the optional attribute(Primary2X) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 4o: Read the optional attribute(Primary2Y) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 4p: Read the optional attribute(Primary2Intensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4q: Read the optional attribute(Primary3X) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4r: Read the optional attribute(Primary3Y) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4s: Read the optional attribute(Primary3Intensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4t: Read the optional attribute(Primary4X) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 4u: Read the optional attribute(Primary4Y) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 30: { + LogStep(30, "Step 4v: Read the optional attribute(Primary4Intensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 31: { + LogStep(31, "Step 4w: Read the optional attribute(Primary5X) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 32: { + LogStep(32, "Step 4x: Read the optional attribute(Primary5Y) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, "Step 4y: Read the optional attribute(Primary5Intensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0026"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 34: { + LogStep(34, "Step 4z: Read the optional attribute(Primary6X) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0028"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 35: { + LogStep(35, "Step 4a1: Read the optional attribute(Primary6Y) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 36: { + LogStep(36, "Step 4a2: Read the optional attribute(Primary6Intensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A002a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 37: { + LogStep(37, "Step 4a3: Read the optional attribute(WhitePointX) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 38: { + LogStep(38, "Step 4a4: Read the optional attribute(WhitePointY) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 39: { + LogStep(39, "Step 4a5: Read the optional attribute(ColorPointRX) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 40: { + LogStep(40, "Step 4a6: Read the optional attribute(ColorPointRY) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0033"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 41: { + LogStep(41, "Step 4a7: Read the optional attribute(ColorPointRIntensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0034"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 42: { + LogStep(42, "Step 4a8: Read the optional attribute(ColorPointGX) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0036"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 43: { + LogStep(43, "Step 4a9: Read the optional attribute(ColorPointGY) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0037"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 44: { + LogStep(44, "Step 4a10: Read the optional attribute(ColorPointGIntensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 45: { + LogStep(45, "Step 4a11: Read the optional attribute(ColorPointBX) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 46: { + LogStep(46, "Step 4a12: Read the optional attribute(ColorPointBY) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A003b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 47: { + LogStep(47, "Step 4a13: Read the optional attribute(ColorPointBIntensity) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A003c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 48: { + LogStep(48, "Step 4a14: Read the optional attribute(EnhancedCurrentHue) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 49: { + LogStep(49, "Step 4a15: Read the optional attribute(ColorLoopActive) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A4002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 50: { + LogStep(50, "Step 4a16: Read the optional attribute(ColorLoopDirection) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 51: { + LogStep(51, "Step 4a17: Read the optional attribute(ColorLoopTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A4004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 52: { + LogStep(52, "Step 4a18: Read the optional attribute(ColorLoopStartEnhancedHue) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A4005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 53: { + LogStep(53, "Step 4a19: Read the optional attribute(ColorLoopStoredEnhancedHue) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A4006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 54: { + LogStep(54, "Step 4a20: Read the optional attribute(ColorTempPhysicalMinMireds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 55: { + LogStep(55, "Step 4a21: Read the optional attribute(ColorTempPhysicalMaxMireds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 56: { + LogStep(56, "Step 4a22: Read the optional attribute(CoupleColorTempToLevelMinMireds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A400d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 57: { + LogStep(57, "Step 4a23: Read the optional attribute(StartUpColorTemperatureMireds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CC.S.A4010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 58: { + LogStep(58, "Step 5: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 59: { + LogStep(59, "Step 6a: Read the optional command(MoveToHue) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 60: { + LogStep(60, "Step 6b: Read the optional command(MoveHue) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 61: { + LogStep(61, "Step 6c: Read the optional command(StepHue) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 62: { + LogStep(62, "Step 6d: Read the optional command(MoveToSaturation) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 63: { + LogStep(63, "Step 6e: Read the optional command(MoveSaturation) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 64: { + LogStep(64, "Step 6f: Read the optional command(StepSaturation) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 65: { + LogStep(65, "Step 6g: Read the optional command(MoveToHueAndSaturation) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 66: { + LogStep(66, "Step 6h: Read the optional command(MoveToColor) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 67: { + LogStep(67, "Step 6i: Read the optional command(MoveColor) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 68: { + LogStep(68, "Step 6j: Read the optional command(StepColor) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C09.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 69: { + LogStep(69, "Step 6k: Read the optional command(MoveToColorTemperature) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 70: { + LogStep(70, "Step 6l: Read the optional command(EnhancedMoveToHue) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 71: { + LogStep(71, "Step 6m: Read the optional command(EnhancedMoveHue) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 72: { + LogStep(72, "Step 6n: Read the optional command(EnhancedStepHue) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 73: { + LogStep(73, "Step 6o: Read the optional command(EnhancedMoveToHueAndSaturation) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C43.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 74: { + LogStep(74, "Step 6p: Read the optional command(ColorLoopSet) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 75: { + LogStep(75, "Step 6q: Read the optional command(StopMoveStep) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 76: { + LogStep(76, "Step 6r: Read the optional command(MoveColorTemperature) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 77: { + LogStep(77, "Step 6s: Read the optional command(StepColorTemperature) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 78: { + LogStep(78, "Step 7: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_2_1Suite : public TestCommand +{ +public: + Test_TC_CC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_2_1", 54, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint32_t FeatureMapValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 254)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + FeatureMapValue = value; + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorCapabilities", value, FeatureMapValue)); + VerifyOrReturn(CheckConstraintType("value", "bitmap16", "bitmap16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 31U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads RemainingTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::RemainingTime::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads DriftCompensation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::DriftCompensation::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads CompensationText attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CompensationText::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads ColorTemperatureMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads Options attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 12: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 14: TH reads ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 15: TH reads ColorLoopDirection attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 16: TH reads ColorLoopTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 17: TH reads ColorLoopStartEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 18: TH reads ColorLoopStoredEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 18a: Saving for comparision in step 19 reads FeatureMap attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Step 19: TH reads ColorCapabilities attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorCapabilities::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 20: TH reads ColorTempPhysicalMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 21: TH reads ColorTempPhysicalMaxMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 22: TH reads CoupleColorTempToLevelMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 23: TH reads StartUpColorTemperatureMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::StartUpColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 24: TH reads NumberOfPrimaries attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::NumberOfPrimaries::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "Step 25: TH reads Primary1X attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 1 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 26: { + LogStep(26, + "Step 26: TH reads Primary1Y attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 1 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 27: { + LogStep(27, + "Step 27: TH reads Primary1Intensity attribute from DUT and Verify that the DUT response contains an uint8 if " + "NumberOfPrimaries is 1 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, + "Step 28: TH reads Primary2X attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 2 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 29: { + LogStep(29, + "Step 29: TH reads Primary2Y attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 2 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, + "Step 30: TH reads Primary2Intensity attribute from DUT and Verify that the DUT response contains an uint8 if " + "NumberOfPrimaries is 2 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 31: { + LogStep(31, + "Step 31: TH reads Primary3X attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 3 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, + "Step 32: TH reads Primary3Y attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 3 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 33: { + LogStep(33, + "Step 33: TH reads Primary3Intensity attribute from DUT and Verify that the DUT response contains an uint8 if " + "NumberOfPrimaries is 3 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 34: { + LogStep(34, + "Step 34: TH reads Primary4X attribute from DUT Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 4 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 35: { + LogStep(35, + "Step 35: TH reads Primary4Y attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 4 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 36: { + LogStep(36, + "Step 36: TH reads Primary4Intensity attribute from DUT and Verify that the DUT response contains an uint8 if " + "NumberOfPrimaries is 4 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 37: { + LogStep(37, + "Step 37: TH reads Primary5X attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 5 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 38: { + LogStep(38, + "Step 38: TH reads Primary5Y attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 5 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 39: { + LogStep(39, + "Step 39: TH reads Primary5Intensity attribute from DUT and Verify that the DUT response contains an uint8 if " + "NumberOfPrimaries is 5 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0026"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 40: { + LogStep(40, + "Step 40: TH reads Primary6X attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 6 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0028"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 41: { + LogStep(41, + "Step 41: TH reads Primary6Y attribute from DUT and Verify that the DUT response contains an uint16 [Min:0 " + "Max:0xfeff] if NumberOfPrimaries is 6 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 42: { + LogStep(42, + "Step 42: TH reads Primary6Intensity attribute from DUT and Verify that the DUT response contains an uint8 if " + "NumberOfPrimaries is 6 or more"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CC.S.A002a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 43: { + LogStep(43, "Step 43: TH reads WhitePointX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::WhitePointX::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Step 44: TH reads WhitePointY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::WhitePointY::Id, true, + chip::NullOptional); + } + case 45: { + LogStep(45, "Step 45: TH reads ColorPointRX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointRX::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Step 46: TH reads ColorPointRY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0033"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointRY::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "Step 47: TH reads ColorPointRIntensity attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0034"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorPointRIntensity::Id, true, chip::NullOptional); + } + case 48: { + LogStep(48, "Step 48: TH reads ColorPointGX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0036"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointGX::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Step 49: TH reads ColorPointGY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0037"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointGY::Id, true, + chip::NullOptional); + } + case 50: { + LogStep(50, "Step 50: TH reads ColorPointGIntensity attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorPointGIntensity::Id, true, chip::NullOptional); + } + case 51: { + LogStep(51, "Step 51: TH reads ColorPointBX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointBX::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Step 52: TH reads ColorPointBY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A003b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointBY::Id, true, + chip::NullOptional); + } + case 53: { + LogStep(53, "Step 53: TH reads ColorPointBIntensity attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A003c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorPointBIntensity::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_3_2Suite : public TestCommand +{ +public: + Test_TC_CC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_2", 31, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 215U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 38U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 52U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 80U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 110U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 80U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 110U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 16U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 183U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 247U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 140U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 190U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 140U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 190U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends MoveToHue command to DUT with Hue=200, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 200U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH sends MoveHue command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH sends MoveHue command to DUT with MoveMode=0x00 (stop) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(0); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 2f: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Wait 2s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 2g: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 3a: TH sends MoveToHue command to DUT with Hue=60, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 60U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 3b: TH sends MoveHue command to DUT with MoveMode=0x03 (down) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(3); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 3c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 3d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 3e: TH sends MoveHue command to DUT with MoveMode=0x00 (stop) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(0); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value, + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Step 3f: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Wait 2s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 3g: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_3_3Suite : public TestCommand +{ +public: + Test_TC_CC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_3", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 195U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 17U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 23U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 208U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 208U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends MoveToHue command to DUT with Hue=200, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 200U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 2b: TH sends StepHue command to DUT with StepMode=0x01 (up), StepSize=60 and TransitionTime=200 (20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepHue::Type value; + value.stepMode = static_cast(1); + value.stepSize = 60U; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 3a: TH sends MoveToHue command to DUT with Hue=50, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 50U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, + "Step 3b: TH sends StepHue command to DUT with StepMode=0x03 (down), StepSize=60 and TransitionTime=200 (20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepHue::Type value; + value.stepMode = static_cast(3); + value.stepSize = 60U; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 3c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 3d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 3e: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_1Suite : public TestCommand +{ +public: + Test_TC_CC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_1", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("SaturationConfigValue", 0, UINT8_MAX, &mSaturationConfigValue); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mSaturationConfigValue; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 68U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 92U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 80U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 102U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 138U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 102U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 138U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 2a: TH sends MoveToSaturation command to DUT with Saturation=60 and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 60U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH sends MoveToSaturation command to DUT with Saturation=120 and TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 120U; + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 2f: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_2Suite : public TestCommand +{ +public: + Test_TC_CC_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_2", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_4_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 216U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 216U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 59U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 81U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 35U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 2a: TH sends MoveToSaturation command to DUT with Saturation=150 and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 150U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH sends MoveSaturation command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(1); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3a: TH sends MoveToSaturation command to DUT with Saturation=120 and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 120U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 3b: TH sends MoveSaturation command to DUT with MoveMode=0x03 (down) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(3); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 3c: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 3d: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 3e: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 4a: TH sends MoveToSaturation command to DUT with Saturation=150 and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 150U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 4b: TH sends MoveSaturation command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(1); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value, + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Step 4c: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4d: TH sends MoveSaturation command to DUT with MoveMode=0x00 (stop) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(0); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value, + chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Step 4e: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 28: { + LogStep(28, "Wait 2s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 29: { + LogStep(29, "Step 4f: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 30: { + LogStep(30, "Step 5a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, "Step 5b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 32: { + LogStep(32, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 33: { + LogStep(33, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_3Suite : public TestCommand +{ +public: + Test_TC_CC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_3", 31, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_4_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 187U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 253U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 204U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 204U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 216U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 25U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 35U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 12U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 12U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentSaturation", value, 0U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 2a: TH sends MoveToSaturation command to DUT with Saturation=200 and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 200U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 2b: TH sends StepSaturation command to DUT with StepMode=0x01 (up), StepSize=40 and TransitionTime=200 " + "(20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; + value.stepMode = static_cast(1); + value.stepSize = 40U; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 2f: TH sends StepSaturation command to DUT with StepMode=0x01 (up), StepSize=20 and TransitionTime=100 " + "(10s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; + value.stepMode = static_cast(1); + value.stepSize = 20U; + value.transitionTime = 100U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 2g: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3a: TH sends MoveToSaturation command to DUT with Saturation=50 and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 50U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, + "Step 3b: TH sends StepSaturation command to DUT with StepMode=0x03 (down), StepSize=40 and TransitionTime=200 " + "(20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; + value.stepMode = static_cast(3); + value.stepSize = 40U; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 3c: H reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 3d: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 3e: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 3f: TH sends StepSaturation command to DUT with StepMode=0x03 (down), StepSize=20 and TransitionTime=100 " + "(10 s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; + value.stepMode = static_cast(3); + value.stepSize = 20U; + value.transitionTime = 100U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value, + chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 3g: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4b: H reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_4Suite : public TestCommand +{ +public: + Test_TC_CC_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_4", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_4_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 42U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 58U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 160U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 200U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 50U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 80U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 135U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 185U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 68U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 92U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 135U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 185U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 68U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 92U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends MoveToHueAndSaturation command to DUT with Hue=200, Saturation=50 and TransitionTime=0 " + "(immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type value; + value.hue = 200U; + value.saturation = 50U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHueAndSaturation::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH reads CurrentHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000 && CC.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2b1: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 7: { + LogStep( + 7, + "Step 3a: TH sends MoveToHueAndSaturation command to DUT with Hue=160, Saturation=80 and TransitionTime=200 (20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type value; + value.hue = 160U; + value.saturation = 80U; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHueAndSaturation::Id, + value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 3b: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3b1: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 3c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3c1: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 3d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3d1: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_5_1Suite : public TestCommand +{ +public: + Test_TC_CC_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_1", 61, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_5_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 27853U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 37683U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 16711U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 22609U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 13107U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32768U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 13107U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 19660U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11141U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15073U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11141U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15073U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11141U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15073U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11141U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15073U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("options", value, 0U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 27853U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 37683U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 16711U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 22609U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentX", value, 32768U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentY", value, 19660U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentX", value, 32768U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentY", value, 19660U)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 22282U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 30146U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 27853U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 37683U)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("options", value, 1U)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 27853U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 37683U)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 16711U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 22609U)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11141U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15073U)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11141U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15073U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentX", value, 13107U)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentY", value, 13107U)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 22282U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 30146U)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 27853U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 37683U)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends MoveToColor command to DUT, with ColorX = 32768/0x8000 ColorY = 19660/0x4CCC TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 32768U; + value.colorY = 19660U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2b1: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 3a: TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 TransitionTime " + "= 200 (20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 13107U; + value.colorY = 13107U; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 3b: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3b: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 3c: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3c: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 3d: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3d: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4b: TH read Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4c: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, + "Step 4d: TH sends a MoveToColor command to the DUT with ColorX = 32768/0x8000 (x=0.5) (purple) ColorY = " + "19660/0x4CCC (y=0.3) TransitionTime = 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 32768U; + value.colorY = 19660U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 22: { + LogStep(22, "Step 4e: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Step 4e: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Step 4f: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, + "Step 4g: TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 13107U; + value.colorY = 13107U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "Step 4h: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4h: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 4i: TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 13107U; + value.colorY = 32768U; + value.transitionTime = 0U; + value.optionsMask = 1U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 4j: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Step 4j: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 4k: TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 26214U; + value.colorY = 32768U; + value.transitionTime = 0U; + value.optionsMask = 1U; + value.optionsOverride = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 35: { + LogStep(35, "Step 4i: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "Step 4i: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 37: { + LogStep(37, "Step 5a: TH writes 1 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 38: { + LogStep(38, "Step 5b: TH read Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, true, + chip::NullOptional); + } + case 39: { + LogStep(39, "Step 5c: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 40: { + LogStep(40, + "Step 5d: TH sends MoveToColor command to DUT, with ColorX = 32768/0x8000 ColorY = 19660/0x4CCC TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 32768U; + value.colorY = 19660U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 41: { + LogStep(41, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 42: { + LogStep(42, "Step 5e: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 43: { + LogStep(43, "Step 5e: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Step 5f: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 45: { + LogStep(45, + "Step 5g: TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 13107U; + value.colorY = 13107U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 46: { + LogStep(46, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 47: { + LogStep(47, "Step 5h: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 48: { + LogStep(48, "Step 5h: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, + "Step 5i: TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 13107U; + value.colorY = 32768U; + value.transitionTime = 0U; + value.optionsMask = 1U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 51: { + LogStep(51, "Step 5j: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Step 5j: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 53: { + LogStep(53, + "Step 5k: TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 TransitionTime " + "= 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 26214U; + value.colorY = 32768U; + value.transitionTime = 0U; + value.optionsMask = 1U; + value.optionsOverride = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 54: { + LogStep(54, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 55: { + LogStep(55, "Step 5l: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 56: { + LogStep(56, "Step 5l: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 57: { + LogStep(57, "Step 6a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 58: { + LogStep(58, "Step 6b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 59: { + LogStep(59, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 60: { + LogStep(60, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_5_2Suite : public TestCommand +{ +public: + Test_TC_CC_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_2", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_5_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t CurrentXValue; + uint16_t CurrentYValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 27200U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 36800U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 22900U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 31100U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 26350U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 35650U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 23800U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32200U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 25500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 34500U)); + CurrentXValue = value; + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 24650U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 33350U)); + CurrentYValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 25500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 34500U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 24650U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 33350U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep( + 3, + "Step 1a: TH sends MoveToColor command to DUT, with ColorX = 33000 ColorY = 26000 TransitionTime = 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 33000U; + value.colorY = 26000U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2a: TH sends MoveColor command to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColor::Type value; + value.rateX = -100; + value.rateY = 100; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColor::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2b: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2b: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2c: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2c: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 2d: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 2d: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3a: TH sends StopMoveStep command to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Step 3b: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 3b: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_5_3Suite : public TestCommand +{ +public: + Test_TC_CC_5_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_3", 19, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_5_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 13000U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 33000U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 14000U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 20000U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11050U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 14950U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11900U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 16100U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11050U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 14950U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 11900U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 16100U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep( + 3, + "Step 2a: TH sends MoveToColor command to DUT, with ColorX = 33000 ColorY = 20000 TransitionTime = 0 (immediate)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; + value.colorX = 33000U; + value.colorY = 20000U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 3a: TH sends StepColor command to DUT, with StepX = -20000, StepY = -6000, TransitionTime = 200 (20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C09.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepColor::Type value; + value.stepX = -20000; + value.stepY = -6000; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColor::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 3b: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3b: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 3c: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3c: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 3d: TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3d: TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_6_1Suite : public TestCommand +{ +public: + Test_TC_CC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_1", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_6_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mConfigWait; + chip::Optional mTimeout; + + uint16_t ColorTempPhysicalMinMiredsValue; + uint16_t ColorTempPhysicalMaxMiredsValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMinMiredsValue = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMaxMiredsValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 246U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 334U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 230U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 310U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 212U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 288U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 212U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 288U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1a: H reads ColorTempPhysicalMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1b: TH reads ColorTempPhysicalMaxMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 2a: TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds=310 and TransitionTime=0 " + "(immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperatureMireds = 310U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 2b: TH sends MoveToColorTemperatur command to DUT with ColorTemperatureMireds=250 and TransitionTime=300 " + "(30s)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperatureMireds = 250U; + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 2d: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 2e: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 2f: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 3a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 3b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_6_2Suite : public TestCommand +{ +public: + Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 33, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_6_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mConfigWait; + chip::Optional mTimeout; + + uint16_t ColorTempPhysicalMinMiredsValue; + uint16_t ColorTempPhysicalMaxMiredsValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMinMiredsValue = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMaxMiredsValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorTemperatureMireds", value, ColorTempPhysicalMaxMiredsValue)); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorTemperatureMireds", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1a: TH reads ColorTempPhysicalMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1b: TH reads ColorTempPhysicalMaxMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 6: { + LogStep( + 6, + "Step 2a: TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds=(ColorTempPhysicalMinMireds + " + "ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperatureMireds = + static_cast((ColorTempPhysicalMinMiredsValue + ColorTempPhysicalMaxMiredsValue) / 2); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 2b: TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/40"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 40); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 2d: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 2e: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 3a: TH sends MoveColorTemperature command to DUT with MoveMode = 0x03(down), Rate = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(3); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 20); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 3b: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 3c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 3d: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4a: TH sends MoveColorTemperature command to DUT with MoveMode = 0x01(up), Rate = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 20); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, + "Step 4b: After 10 seconds, TH sends MoveColorTemperature command to DUT with MoveMode = 0x00(stop), Rate = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(0); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 20); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Step 4c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Wait 2s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "Step 4d: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 5a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "Step 5b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 30: { + LogStep(30, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 31: { + LogStep(31, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_6_3Suite : public TestCommand +{ +public: + Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 27, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_6_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mConfigWait; + chip::Optional mTimeout; + + uint16_t ColorTempPhysicalMinMiredsValue; + uint16_t ColorTempPhysicalMaxMiredsValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMinMiredsValue = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMaxMiredsValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMaxMiredsValue - 1)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorTemperatureMireds", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1a: TH reads ColorTempPhysicalMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1b: TH reads ColorTempPhysicalMaxMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 6: { + LogStep( + 6, + "Step 2a: TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds=(ColorTempPhysicalMinMireds + " + "ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperatureMireds = + static_cast((ColorTempPhysicalMinMiredsValue + ColorTempPhysicalMaxMiredsValue) / 2); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 2b: TH sends StepColorTemperature command to DUT with StepMode = 0x01 (up), StepSize = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/2 and TransitionTime = 200 (20s)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type value; + value.stepMode = static_cast(1); + value.stepSize = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 2); + value.transitionTime = 200U; + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 2d: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 2e: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 3a: TH sends StepColorTemperature command to DUT with StepMode = 0x03 (down), StepSize = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds) and TransitionTime = 200 (20s)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type value; + value.stepMode = static_cast(3); + value.stepSize = static_cast(ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue); + value.transitionTime = 200U; + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 3b: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 3c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 3d: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 24: { + LogStep(24, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_6_5Suite : public TestCommand +{ +public: + Test_TC_CC_6_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_5", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_6_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mConfigWait; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable StartUpColorTemperatureMiredsValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + StartUpColorTemperatureMiredsValue = value; + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (StartUpColorTemperatureMiredsValue.IsNull()) + { + VerifyOrReturn(CheckValueNull("startUpColorTemperatureMireds", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("startUpColorTemperatureMireds", value)); + VerifyOrReturn(CheckValue("startUpColorTemperatureMireds.Value()", value.Value(), + StartUpColorTemperatureMiredsValue.Value())); + } + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorTemperatureMireds", value, StartUpColorTemperatureMiredsValue)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 2U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 0c: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 0d: TH reads ColorTempPhysicalMinMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 0e: TH reads ColorTempPhysicalMaxMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 1: TH reads from the DUT the StartUpColorTemperatureMireds attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A4010 && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::StartUpColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2a: TH writes to StartUpColorTemperatureMireds attribute with value StartUpColorTemperatureMireds"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CC.S.A4010 && CC.S.F04"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 2b: TH reads StartUpColorTemperatureMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4010 && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::StartUpColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 2b: Verify that the DUT response contains StartUpColorTemperatureMireds that matches the " + "StartUpColorTemperatureMireds set in Step 2a"); + VerifyOrDo(!ShouldSkip("CC.S.A4010 && CC.S.F04 && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 3a: Reboot target device"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 3b: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 4a: TH reads from the DUT the StartUpColorTemperatureMireds attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::StartUpColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4b: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 5b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_7_2Suite : public TestCommand +{ +public: + Test_TC_CC_7_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_2", 31, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_7_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 21250U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 28750U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 25500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 34500U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 29750U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 40250U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 29750U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 40250U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 17000U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 23000U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 12750U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 17250U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11500U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11500U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 3U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=20000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 20000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH sends EnhancedMoveHue command to DUT with MoveMode=0x01 (up) and Rate=500 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 500U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH sends EnhancedMoveHue command to DUT with MoveMode=0x00 (stop) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; + value.moveMode = static_cast(0); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 2f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait 2s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 2g: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 3a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=25000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 25000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 3b: TH sends EnhancedMoveHue command to DUT with MoveMode=0x03 (down) and Rate=500 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; + value.moveMode = static_cast(3); + value.rate = 500U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 3c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 3d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 3e: TH sends EnhancedMoveHue command to DUT with MoveMode=0x00 (stop) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; + value.moveMode = static_cast(0); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value, + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Step 3f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, "Wait 2s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 3g: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_7_3Suite : public TestCommand +{ +public: + Test_TC_CC_7_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_3", 29, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_7_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 6800U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9200U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11500U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 10200U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 13800U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 10200U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 13800U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11500U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 6800U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9200U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5100U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6900U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5100U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6900U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 3U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 6000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 2b: TH sends EnhancedStepHue command to DUT with StepMode=0x01 (up), StepSize=6000 and " + "TransitionTime=300 (30s)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type value; + value.stepMode = static_cast(1); + value.stepSize = 6000U; + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedStepHue::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 2f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 5a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 12000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, + "Step 5b: TH sends EnhancedStepHue command to DUT with StepMode=0x03 (down), StepSize=6000 and " + "TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type value; + value.stepMode = static_cast(3); + value.stepSize = 6000U; + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedStepHue::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 5c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 2d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 22: { + LogStep(22, "Step 2e: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Step 2f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 6a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Step 6b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_7_4Suite : public TestCommand +{ +public: + Test_TC_CC_7_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_4", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_7_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 17000U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 23000U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 42U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 58U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 16000U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 20000U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 50U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 80U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 13600U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 18400U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 68U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 92U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, 16000U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentSaturation", value, 80U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 3U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=20000, Saturation=50 and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C43.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type value; + value.enhancedHue = 20000U; + value.saturation = 50U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Commands::EnhancedMoveToHueAndSaturation::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 3a: TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=16000, Saturation=80 and " + "TransitionTime=200 (20s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C43.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type value; + value.enhancedHue = 16000U; + value.saturation = 80U; + value.transitionTime = 200U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Commands::EnhancedMoveToHueAndSaturation::Id, value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 3b: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3b: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 3c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3c: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 3d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3d: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_8_1Suite : public TestCommand +{ +public: + Test_TC_CC_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_8_1", 39, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_8_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t ColorTempPhysicalMinMireds; + uint16_t ColorTempPhysicalMaxMireds; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 216U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 216U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMinMireds = value; + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + ColorTempPhysicalMaxMireds = value; + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMireds)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMireds)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMireds)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMireds)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 21250U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 28750U)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 21250U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 28750U)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: H sends MoveToHue command to DUT with Hue=200, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 200U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2b: TH sends MoveHue command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH sends StopMoveStep command to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 2d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Wait 2s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2e: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3a: TH sends MoveToSaturation command to DUT with Saturation=150 and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 150U; + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 3b: TH sends MoveSaturation command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(1); + value.rate = 5U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 3c: TH sends StopMoveStep command to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Step 3d: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Wait 2s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 3e: TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4a: TH reads ColorTempPhysicalMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 4b: TH reads ColorTempPhysicalMaxMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4c: TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds= " + "ColorTempPhysicalMaxMireds / 2 and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperatureMireds = static_cast((ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds) / 2); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, + "Step 4d: TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/40"); + VerifyOrDo(!ShouldSkip("CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = static_cast((ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds) / 40); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMireds; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMireds; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Step 4e: TH sends StopMoveStep command to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.C4b.Rsp && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Step 4f: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.A0007 && CC.S.C4b.Rsp && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Wait 2s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 4g: TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.A0007 && CC.S.C4b.Rsp && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorTemperatureMireds::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=20000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 20000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 5b: TH sends EnhancedMoveHue command to DUT with MoveMode=0x01 (up) and Rate=500 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 500U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value, + chip::NullOptional + + ); + } + case 32: { + LogStep(32, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 33: { + LogStep(33, "Step 5c: TH sends StopMoveStep command to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value, + chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Step 5d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4000 && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 35: { + LogStep(35, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 36: { + LogStep(36, "Step 5e: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4000 && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 37: { + LogStep(37, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 38: { + LogStep(38, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestColorControl_9_1Suite : public TestCommand +{ +public: + TestColorControl_9_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestColorControl_9_1", 72, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~TestColorControl_9_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(400)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mCluster; + chip::Optional mEndpoint; + + uint16_t ColorLoopStartEnhancedHueStep5d; + uint16_t ColorLoopStoredEnhancedHueStep6c; + uint16_t ColorLoopStartEnhancedHueStep8d; + uint16_t ColorLoopStoredEnhancedHueStep9c; + uint16_t ColorLoopStartEnhancedHueStep12d; + uint16_t ColorLoopStoredEnhancedHueStep13c; + uint16_t ColorLoopStartEnhancedHueStep15d; + uint16_t ColorLoopStoredEnhancedHueStep16b; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopTime", value, 5U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 160U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep5d = value; + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep5d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep5d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep6c = value; + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep6c)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 1U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep8d = value; + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep8d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep8d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep9c = value; + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep9c)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, 16384U)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep12d = value; + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep12d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep12d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep13c = value; + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep13c)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 1U)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep15d = value; + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep15d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep15d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep16b = value; + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep16b)); + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH writes 0 to the Options attribute"); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "TH sends On command to DUT"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "TH sends EnhancedMoveToHue command to DUT with EnhancedHue=0x4000, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 16384U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait for 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x0 " + "(De-activate) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction attribute " + "to 0x0 (decrement hue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Read ColorLoopDirection attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x4 (UpdateTime) and Time attribute to 5 (5s " + "for one loop) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(4U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 5U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Read ColorLoopTime attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x8 (UpdateStartHue) and StartHue attribute to " + "0x00A0 to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(8U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 160U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Read ColorLoopStartEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x1 " + "(start from ColorLoopStartEnhancedHue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(1); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read ColorLoopStoredEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Saving value for comparison in step 8d read ColorLoopStartEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x0 " + "(De-activate) to DUT"); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Saving value for comparison in step 6c read ColorLoopStoredEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction attribute " + "to 0x1 (increment hue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(1); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Read ColorLoopDirection attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x1 " + "(start from ColorLoopStartEnhancedHue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(1); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Read ColorLoopStoredEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Saving value for comparision in step 8d read ColorLoopStartEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 34: { + LogStep(34, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 35: { + LogStep(35, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x0 " + "(De-activate) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 36: { + LogStep(36, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 37: { + LogStep(37, "Saving value for comparision in step 9c read ColorLoopStoredEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 38: { + LogStep(38, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 39: { + LogStep(39, + "TH sends EnhancedMoveToHue command to DUT with EnhancedHue=0x4000, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 16384U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 40: { + LogStep(40, "Wait 10ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10UL; + return WaitForMs(kIdentityAlpha, value); + } + case 41: { + LogStep(41, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 42: { + LogStep(42, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction attribute " + "to 0x0 (decrement hue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Read ColorLoopDirection attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 44: { + LogStep(44, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x2 " + "(start from EnhancedCurrentHue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(2); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 45: { + LogStep(45, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 46: { + LogStep(46, "Read ColorLoopStoredEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 47: { + LogStep(47, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 48: { + LogStep(48, "Saving value for comparision in step 12d read ColorLoopStartEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 49: { + LogStep(49, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 50: { + LogStep(50, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 51: { + LogStep(51, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 52: { + LogStep(52, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x0 " + "(De-activate) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 53: { + LogStep(53, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 54: { + LogStep(54, "Saving value for comparision in step 13c read ColorLoopStoredEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 55: { + LogStep(55, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 56: { + LogStep(56, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction attribute " + "to 0x1 (increment hue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(1); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 57: { + LogStep(57, "Read ColorLoopDirection attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 58: { + LogStep(58, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x2 " + "(start from EnhancedCurrentHue) to DUT"); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(2); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 59: { + LogStep(59, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 60: { + LogStep(60, "Read ColorLoopStoredEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 61: { + LogStep(61, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 62: { + LogStep(62, "Saving value for comparision in step 15d read ColorLoopStartEnhancedHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 63: { + LogStep(63, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 64: { + LogStep(64, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 65: { + LogStep(65, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 66: { + LogStep(66, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x0 " + "(De-activate) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 67: { + LogStep(67, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 68: { + LogStep(68, "Saving value for comparision in step 16b read ColorLoopStoredEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 69: { + LogStep(69, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 70: { + LogStep(70, "Turn Off light for color control tests"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 71: { + LogStep(71, "Check on/off attribute value is false after off command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestColorControl_9_2Suite : public TestCommand +{ +public: + TestColorControl_9_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestColorControl_9_2", 31, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestColorControl_9_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(400)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t ColorLoopStartEnhancedHueValue; + uint16_t ColorLoopStartEnhancedHue; + uint16_t ColorLoopStoredEnhancedHueValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopTime", value, 5U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 160U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 1U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHue = value; + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueValue = value; + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueValue)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH writes 0 to the Options attribute"); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "TH sends On command to DUT"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "TH sends EnhancedMoveToHue command to DUT with EnhancedHue=0x4000, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 16384U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait for 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0xF, Action attribute to 0x0 (De-activate), " + "Direction attribute to 0x0 (decrement hue), Time attribute to 30, and StartHue attribute to 0x00A0 to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(15U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 5U; + value.startHue = 160U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read ColorLoopDirection attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read ColorLoopTime attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Read ColorLoopStartEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x1 " + "(start from ColorLoopStartEnhancedHue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(1); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Read ColorLoopActive attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Read ColorLoopStoredEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Saving value for comparision read ColorLoopStartEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction attribute " + "to 0x1 (increment hue) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(1); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Read ColorLoopDirection attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Saving value for comparision read ColorLoopStartEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Wait for 5S"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action attribute to 0x0 " + "(De-activate) to DUT."); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Read ColorLoopActive attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Saving value for comparision read ColorLoopStoredEnhancedHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Read EnhancedCurrentHue attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Turn off light for color control tests"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Check on/off attribute value is false after off command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CDOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_CDOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CDOCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CDOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip( + " !CDOCONC.S.F00 && !CDOCONC.S.F01 && !CDOCONC.S.F02 && !CDOCONC.S.F03 && !CDOCONC.S.F04 && !CDOCONC.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F02 && CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F02 && !CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F03 && CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F03 && !CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F04 && CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F04 && !CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F05 && CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F05 && !CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip(" !PICS_EVENT_LIST_ENABLED "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0007 && CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when CDOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when CDOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "CDOCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "CDOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when CDOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !CDOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CDOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_CDOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CDOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CDOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_CMOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CMOCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CMOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip( + " !CMOCONC.S.F00 && !CMOCONC.S.F01 && !CMOCONC.S.F02 && !CMOCONC.S.F03 && !CMOCONC.S.F04 && !CMOCONC.S.F05 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F02 && CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F02 && !CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F03 && CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F03 && !CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F04 && CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F04 && !CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F05 && CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F05 && !CMOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0007 && CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when CMOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when CMOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "CMOCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "CMOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when CMOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !CMOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: TH1 reads GeneratedCommandList from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_CMOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CMOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CMOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_FLDCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FLDCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLDCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip( + " !FLDCONC.S.F00 && !FLDCONC.S.F01 && !FLDCONC.S.F02 && !FLDCONC.S.F03 && !FLDCONC.S.F04 && !FLDCONC.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F02 && FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F02 && !FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F03 && FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F03 && !FLDCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F04 && FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F04 && !FLDCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F05 && FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F05 && !FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0007 && FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when FLDCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when FLDCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "FLDCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "FLDCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when FLDCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !FLDCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_FLDCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FLDCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLDCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_NDOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_NDOCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_NDOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip( + " !NDOCONC.S.F00 && !NDOCONC.S.F01 && !NDOCONC.S.F02 && !NDOCONC.S.F03 && !NDOCONC.S.F04 && !NDOCONC.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F02 && NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F02 && !NDOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F03 && NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F03 && !NDOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F04 && NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F04 && NDOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F05 && NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F05 && !NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0007 && NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when NDOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when NDOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "NDOCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "NDOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when NDOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !NDOCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_NDOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_NDOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_NDOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_OZCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OZCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip(" !OZCONC.S.F00 && !OZCONC.S.F01 && !OZCONC.S.F02 && !OZCONC.S.F03 && !OZCONC.S.F04 && !OZCONC.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F02 && OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F02 && !OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F03 && OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F03 && !OZCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F04 && OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F04 && !OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F05 && OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F05 && !OZCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0007 && OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when OZCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when OZCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "OZCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "OZCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when OZCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !OZCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: Read the global attribute: EventList. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_OZCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OZCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMHCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMHCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMHCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip( + " !PMHCONC.S.F00 && !PMHCONC.S.F01 && !PMHCONC.S.F02 && !PMHCONC.S.F03 && !PMHCONC.S.F04 && !PMHCONC.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F02 && PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F02 && !PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F03 && PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F03 && !PMHCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F04 && PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F04 && PMHCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F05 && PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F05 && !PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0007 && PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when PMHCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when PMHCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMHCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMHCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when PMHCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !PMHCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMHCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMHCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMHCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMICONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMICONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMICONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip( + " !PMICONC.S.F00 && !PMICONC.S.F01 && !PMICONC.S.F02 && !PMICONC.S.F03 && !PMICONC.S.F04 && !PMICONC.S.F05 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F02 && PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given PMICONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F02 && !PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F03 && PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F03 && !PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F04 && PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F04 && !PMICONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F05 && PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F05 && !PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0007 && PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when PMICONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when PMICONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMICONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMICONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when PMICONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !PMICONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7b: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMICONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMICONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMICONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMKCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMKCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMKCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip( + " !PMKCONC.S.F00 && !PMKCONC.S.F01 && !PMKCONC.S.F02 && !PMKCONC.S.F03 && !PMKCONC.S.F04 && !PMKCONC.S.F05 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F02 && PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F02 && !PMKCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F03 && PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F03 && !PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F04 && PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F04 && !PMKCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F05 && PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F05 && !PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0007 && PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when PMKCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when PMKCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMKCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMKCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when PMKCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !PMKCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4l: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMKCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMKCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMKCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_RNCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RNCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RNCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo( + !ShouldSkip(" !RNCONC.S.F00 && !RNCONC.S.F01 && !RNCONC.S.F02 && !RNCONC.S.F03 && !RNCONC.S.F04 && !RNCONC.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F02 && RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F02 && !RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F03 && RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F03 && !RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F04 && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F04 && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F05 && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F05 && !RNCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0007 && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep( + 18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when RNCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when RNCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "RNCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "RNCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when RNCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !RNCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep( + 27, + "Step 4l: TH reads the AttributeList attribute from the DUT. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in " + "the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) and " + "(0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: Read the global attribute AcceptedCommandList. 1. The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: Read the global attribute: GeneratedCommandList. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_RNCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RNCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RNCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: H reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_TVOCCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TVOCCONC_1_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TVOCCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap and check for either bit 0 or 1 set"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F00 && !TVOCCONC.S.F01 && !TVOCCONC.S.F02 && !TVOCCONC.S.F03 && !TVOCCONC.S.F04 " + "&& !TVOCCONC.S.F05 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F02 && TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F02 && !TVOCCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F03 && TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F03 && !TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F04 && TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F04 && !TVOCCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F05 && TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3m: Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F05 && !TVOCCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4b: Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0007 && TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, + "Step 4c: Check the optional attribute Uncertainty is excluded from AttributeList when TVOCCONC.S.A0007 is not " + "set"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.A0007 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 4d: Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue " + "and Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 4e: Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are " + "excluded from AttributeList when TVOCCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 4f: Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, + "Step 4g: Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "TVOCCONC.S.F04 (PEA) is not set"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F04 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 4h: Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + "AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4i: Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "TVOCCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F05 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4j: Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4k: Check that LevelValue is excluded from AttributeList when TVOCCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip(" !TVOCCONC.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 4b: Read the global attribute: AttributeList. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, + "Step 6b: Read the global attribute: AcceptedCommandList. 1. The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 7b: Read the global attribute: GeneratedCommandList. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_TVOCCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TVOCCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TVOCCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 604800UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::LevelValue::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestIcdManagementClusterSuite : public TestCommand +{ +public: + TestIcdManagementClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestIcdManagementCluster", 26, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestIcdManagementClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("idleModeInterval", value, 2000UL)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("activeModeInterval", value, 300UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("activeModeThreshold", value, 300U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("ICDCounter", value, 0UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clientsSupportedPerFabric", value, 2U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("registeredClients", iter_0, 0)); + } + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("ICDCounter", value.ICDCounter, 0UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("ICDCounter", value.ICDCounter, 0UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("registeredClients", iter_0, 0)); + VerifyOrReturn(CheckValue("registeredClients[0].checkInNodeID", iter_0.GetValue().checkInNodeID, 101ULL)); + VerifyOrReturn( + CheckValue("registeredClients[0].monitoredSubject", iter_0.GetValue().monitoredSubject, 1001ULL)); + VerifyOrReturn(CheckValueAsString( + "registeredClients[0].key", iter_0.GetValue().key, + chip::ByteSpan( + chip::Uint8::from_const_char("\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"), 16))); + VerifyOrReturn(CheckNextListItemDecodes("registeredClients", iter_0, 1)); + VerifyOrReturn(CheckValue("registeredClients[1].checkInNodeID", iter_0.GetValue().checkInNodeID, 201ULL)); + VerifyOrReturn( + CheckValue("registeredClients[1].monitoredSubject", iter_0.GetValue().monitoredSubject, 2001ULL)); + VerifyOrReturn(CheckValueAsString("registeredClients[1].key", iter_0.GetValue().key, + chip::ByteSpan(chip::Uint8::from_const_char(" !\042#$%&'()*+,-./"), 16))); + VerifyOrReturn(CheckNoMoreListItems("registeredClients", iter_0, 2)); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("ICDCounter", value.ICDCounter, 0UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("registeredClients", iter_0, 0)); + VerifyOrReturn(CheckValue("registeredClients[0].checkInNodeID", iter_0.GetValue().checkInNodeID, 101ULL)); + VerifyOrReturn( + CheckValue("registeredClients[0].monitoredSubject", iter_0.GetValue().monitoredSubject, 1002ULL)); + VerifyOrReturn(CheckValueAsString( + "registeredClients[0].key", iter_0.GetValue().key, + chip::ByteSpan(chip::Uint8::from_const_char("\001\021!1AQaq\201\221\241\261\301\321\341\361"), 16))); + VerifyOrReturn(CheckNextListItemDecodes("registeredClients", iter_0, 1)); + VerifyOrReturn(CheckValue("registeredClients[1].checkInNodeID", iter_0.GetValue().checkInNodeID, 201ULL)); + VerifyOrReturn( + CheckValue("registeredClients[1].monitoredSubject", iter_0.GetValue().monitoredSubject, 2001ULL)); + VerifyOrReturn(CheckValueAsString("registeredClients[1].key", iter_0.GetValue().key, + chip::ByteSpan(chip::Uint8::from_const_char(" !\042#$%&'()*+,-./"), 16))); + VerifyOrReturn(CheckNoMoreListItems("registeredClients", iter_0, 2)); + } + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("ICDCounter", value.ICDCounter, 0UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("registeredClients", iter_0, 0)); + VerifyOrReturn(CheckValue("registeredClients[0].checkInNodeID", iter_0.GetValue().checkInNodeID, 101ULL)); + VerifyOrReturn( + CheckValue("registeredClients[0].monitoredSubject", iter_0.GetValue().monitoredSubject, 1002ULL)); + VerifyOrReturn(CheckValueAsString( + "registeredClients[0].key", iter_0.GetValue().key, + chip::ByteSpan(chip::Uint8::from_const_char("\001\021!1AQaq\201\221\241\261\301\321\341\361"), 16))); + VerifyOrReturn(CheckNextListItemDecodes("registeredClients", iter_0, 1)); + VerifyOrReturn(CheckValue("registeredClients[1].checkInNodeID", iter_0.GetValue().checkInNodeID, 201ULL)); + VerifyOrReturn( + CheckValue("registeredClients[1].monitoredSubject", iter_0.GetValue().monitoredSubject, 2002ULL)); + VerifyOrReturn(CheckValueAsString( + "registeredClients[1].key", iter_0.GetValue().key, + chip::ByteSpan(chip::Uint8::from_const_char("\002\022\0422BRbr\202\222\242\262\302\322\342/"), 16))); + VerifyOrReturn(CheckNoMoreListItems("registeredClients", iter_0, 2)); + } + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("registeredClients", iter_0, 0)); + VerifyOrReturn(CheckValue("registeredClients[0].checkInNodeID", iter_0.GetValue().checkInNodeID, 201ULL)); + VerifyOrReturn( + CheckValue("registeredClients[0].monitoredSubject", iter_0.GetValue().monitoredSubject, 2002ULL)); + VerifyOrReturn(CheckValueAsString( + "registeredClients[0].key", iter_0.GetValue().key, + chip::ByteSpan(chip::Uint8::from_const_char("\002\022\0422BRbr\202\222\242\262\302\322\342/"), 16))); + VerifyOrReturn(CheckNoMoreListItems("registeredClients", iter_0, 1)); + } + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("registeredClients", iter_0, 0)); + } + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read IdleModeInterval"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::IdleModeInterval::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read ActiveModeInterval"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ActiveModeInterval::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read ActiveModeThreshold"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ActiveModeThreshold::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read ICDCounter"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::ICDCounter::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Read ClientsSupportedPerFabric"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ClientsSupportedPerFabric::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Unregister 1.0"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; + value.checkInNodeID = 101ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, + value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Unregister 2.0"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; + value.checkInNodeID = 102ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, + value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Unregister 3.0"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; + value.checkInNodeID = 102ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, + value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Read RegisteredClients"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Register 1.0 (key too short)"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type value; + value.checkInNodeID = 101ULL; + value.monitoredSubject = 1001ULL; + value.key = + chip::ByteSpan(chip::Uint8::from_const_char( + "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036garbage: not in length on purpose"), + 15); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::RegisterClient::Id, + value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Register 1.0 (key too long)"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type value; + value.checkInNodeID = 101ULL; + value.monitoredSubject = 1001ULL; + value.key = chip::ByteSpan( + chip::Uint8::from_const_char( + "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\377garbage: not in length on purpose"), + 17); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::RegisterClient::Id, + value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Register 1.1"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type value; + value.checkInNodeID = 101ULL; + value.monitoredSubject = 1001ULL; + value.key = chip::ByteSpan( + chip::Uint8::from_const_char( + "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037garbage: not in length on purpose"), + 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::RegisterClient::Id, + value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Register 2.1"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type value; + value.checkInNodeID = 201ULL; + value.monitoredSubject = 2001ULL; + value.key = chip::ByteSpan(chip::Uint8::from_const_char(" !\042#$%&'()*+,-./garbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::RegisterClient::Id, + value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Register 3.1"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type value; + value.checkInNodeID = 301ULL; + value.monitoredSubject = 3001ULL; + value.key = chip::ByteSpan(chip::Uint8::from_const_char("0123456789:;<=>?garbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::RegisterClient::Id, + value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Read RegisteredClients"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Register 1.1"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type value; + value.checkInNodeID = 101ULL; + value.monitoredSubject = 1002ULL; + value.key = chip::ByteSpan( + chip::Uint8::from_const_char("\001\021!1AQaq\201\221\241\261\301\321\341\361garbage: not in length on purpose"), + 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::RegisterClient::Id, + value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Read RegisteredClients"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Register 2.2 (wrong verification key)"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type value; + value.checkInNodeID = 201ULL; + value.monitoredSubject = 2002ULL; + value.key = chip::ByteSpan( + chip::Uint8::from_const_char("\002\022\0422BRbr\202\222\242\262\302\322\342/garbage: not in length on purpose"), + 16); + value.verificationKey.Emplace(); + value.verificationKey.Value() = + chip::ByteSpan(chip::Uint8::from_const_char(" !\042#$%&'()*+,-//garbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::RegisterClient::Id, + value, chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Read RegisteredClients"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Unregister 1.1 (wrong key)"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; + value.checkInNodeID = 101ULL; + value.verificationKey.Emplace(); + value.verificationKey.Value() = chip::ByteSpan( + chip::Uint8::from_const_char("\001!!1AQaq\201\221\241\261\301\321\341\361garbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, + value, chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Read RegisteredClients"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Unregister 2.1"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; + value.checkInNodeID = 201ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, + value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Read RegisteredClients"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Unregister 1.3"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; + value.checkInNodeID = 101ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, + value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Unregister 2.2"); + ListFreer listFreer; + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; + value.checkInNodeID = 102ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, + value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPCREDS_1_2Suite : public TestCommand +{ +public: + Test_TC_OPCREDS_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPCREDS_1_2", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPCREDS_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 6a: TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 7a: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BINFO_1_1Suite : public TestCommand +{ +public: + Test_TC_BINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_1_1", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BINFO_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: TH reads optional attribute(ManufacturingDate) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4c: TH reads optional attribute(PartNumber) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4d: TH reads optional attribute(ProductURL) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4e: TH reads optional attribute(ProductLabel) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4f: TH reads optional attribute(SerialNumber) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4g: TH reads optional attribute(LocalConfigDisabled) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4h: TH reads optional attribute(Reachable) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4i: TH reads optional attribute(UniqueID) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 4j: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 5a: TH1 reads EventList from DUT"); + VerifyOrDo(!ShouldSkip(" !BINFO.S.E00 && !BINFO.S.E01 && !BINFO.S.E02 && !BINFO.S.A0011 && PICS_EVENT_LIST_ENABLED"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5b: Read BINFO.S.E00(StartUp) event in EventList"); + VerifyOrDo(!ShouldSkip("BINFO.S.E00 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 5c: Read BINFO.S.E01(ShutDown) event in EventList"); + VerifyOrDo(!ShouldSkip("BINFO.S.E01 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 5d: Read BINFO.S.E02(Leave) event in EventList"); + VerifyOrDo(!ShouldSkip("BINFO.S.E02 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 5e: Read (ReachableChanged) event in EventList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 5f: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 21: { + LogStep(21, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BINFO_2_1Suite : public TestCommand +{ +public: + Test_TC_BINFO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_2_1", 71, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BINFO_2_1Suite() + { + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + VendorNameValueBuffer = nullptr; + } + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + ProductNameValueBuffer = nullptr; + } + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + NodeLabelValueBuffer = nullptr; + } + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + HardwareVersionStringValueBuffer = nullptr; + } + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + SoftwareVersionStringValueBuffer = nullptr; + } + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + ManufacturingDateValueBuffer = nullptr; + } + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + PartNumberValueBuffer = nullptr; + } + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + ProductURLValueBuffer = nullptr; + } + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + ProductLabelValueBuffer = nullptr; + } + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + SerialNumberValueBuffer = nullptr; + } + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + UniqueIDValueBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t DataModelRevisionValue; + char * VendorNameValueBuffer = nullptr; + chip::CharSpan VendorNameValue; + chip::VendorId VendorIDValue; + char * ProductNameValueBuffer = nullptr; + chip::CharSpan ProductNameValue; + uint16_t ProductIDValue; + char * NodeLabelValueBuffer = nullptr; + chip::CharSpan NodeLabelValue; + uint16_t HardwareVersionValue; + char * HardwareVersionStringValueBuffer = nullptr; + chip::CharSpan HardwareVersionStringValue; + uint32_t SoftwareVersionValue; + char * SoftwareVersionStringValueBuffer = nullptr; + chip::CharSpan SoftwareVersionStringValue; + char * ManufacturingDateValueBuffer = nullptr; + chip::CharSpan ManufacturingDateValue; + char * PartNumberValueBuffer = nullptr; + chip::CharSpan PartNumberValue; + char * ProductURLValueBuffer = nullptr; + chip::CharSpan ProductURLValue; + char * ProductLabelValueBuffer = nullptr; + chip::CharSpan ProductLabelValue; + char * SerialNumberValueBuffer = nullptr; + chip::CharSpan SerialNumberValue; + char * UniqueIDValueBuffer = nullptr; + chip::CharSpan UniqueIDValue; + chip::app::Clusters::BasicInformation::Structs::CapabilityMinimaStruct::DecodableType CapabilityMinimaValue; + chip::app::Clusters::BasicInformation::Structs::ProductAppearanceStruct::DecodableType ProductAppearancevalue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + DataModelRevisionValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("dataModelRevision", value, DataModelRevisionValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + } + VendorNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(VendorNameValueBuffer, value.data(), value.size()); + VendorNameValue = chip::CharSpan(VendorNameValueBuffer, value.size()); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("vendorName", value, VendorNameValue)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "vendor_id", "vendor_id")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65521U)); + VendorIDValue = value; + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorID", value, VendorIDValue)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + } + ProductNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductNameValueBuffer, value.data(), value.size()); + ProductNameValue = chip::CharSpan(ProductNameValueBuffer, value.size()); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productName", value, ProductNameValue)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + ProductIDValue = value; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productID", value, ProductIDValue)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + } + NodeLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(NodeLabelValueBuffer, value.data(), value.size()); + NodeLabelValue = chip::CharSpan(NodeLabelValueBuffer, value.size()); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("newnode", 7))); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 16)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("in", 2))); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + HardwareVersionValue = value; + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareVersion", value, HardwareVersionValue)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 1)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + } + HardwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(HardwareVersionStringValueBuffer, value.data(), value.size()); + HardwareVersionStringValue = chip::CharSpan(HardwareVersionStringValueBuffer, value.size()); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("hardwareVersionString", value, HardwareVersionStringValue)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967294UL)); + SoftwareVersionValue = value; + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("softwareVersion", value, SoftwareVersionValue)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 1)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + } + SoftwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SoftwareVersionStringValueBuffer, value.data(), value.size()); + SoftwareVersionStringValue = chip::CharSpan(SoftwareVersionStringValueBuffer, value.size()); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("softwareVersionString", value, SoftwareVersionStringValue)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 8)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 16)); + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + } + ManufacturingDateValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ManufacturingDateValueBuffer, value.data(), value.size()); + ManufacturingDateValue = chip::CharSpan(ManufacturingDateValueBuffer, value.size()); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("manufacturingDate", value, ManufacturingDateValue)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + } + PartNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(PartNumberValueBuffer, value.data(), value.size()); + PartNumberValue = chip::CharSpan(PartNumberValueBuffer, value.size()); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("partNumber", value, PartNumberValue)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "long_char_string", "long_char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 256)); + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + } + ProductURLValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductURLValueBuffer, value.data(), value.size()); + ProductURLValue = chip::CharSpan(ProductURLValueBuffer, value.size()); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productURL", value, ProductURLValue)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + } + ProductLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductLabelValueBuffer, value.data(), value.size()); + ProductLabelValue = chip::CharSpan(ProductLabelValueBuffer, value.size()); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productLabel", value, ProductLabelValue)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + } + SerialNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SerialNumberValueBuffer, value.data(), value.size()); + SerialNumberValue = chip::CharSpan(SerialNumberValueBuffer, value.size()); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("serialNumber", value, SerialNumberValue)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, false)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + } + UniqueIDValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(UniqueIDValueBuffer, value.data(), value.size()); + UniqueIDValue = chip::CharSpan(UniqueIDValueBuffer, value.size()); + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("uniqueID", value, UniqueIDValue)); + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::BasicInformation::Structs::CapabilityMinimaStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CapabilityMinimaValue = value; + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::BasicInformation::Structs::CapabilityMinimaStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::BasicInformation::Structs::ProductAppearanceStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "ProductAppearanceStruct", "ProductAppearanceStruct")); + ProductAppearancevalue = value; + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::BasicInformation::Structs::ProductAppearanceStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: During Commissioning, TH Saves the CountryCode Information from SetRegulatoryConfig command"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 2: TH reads DataModelRevision from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::DataModelRevision::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH writes DataModelRevision from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 4388U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::DataModelRevision::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH reads DataModelRevision from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::DataModelRevision::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH reads VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorName::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: TH writes VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("samplegarbage: not in length on purpose", 6); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::VendorName::Id, value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: reads VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorName::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 8: TH reads VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Verify that VendorID matches the value assigned to this manufacturer"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 9: TH writes VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::VendorId value; + value = static_cast(17); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 10: TH reads VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 11: TH reads ProductName from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductName::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 12: TH writes ProductName from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductgarbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductName::Id, value, chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 13: TH reads ProductName from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductName::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 14: TH reads ProductID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::ProductID::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 15: TH writes ProductID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 17697U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::ProductID::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 16: TH reads ProductID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::ProductID::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 17: TH reads NodeLabel from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 18: TH writes NodeLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newnodegarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 19: TH reads NodeLabel from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 20a: TH reads Location from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, "Verify that the Location is same as CountryCode value saved from step1"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 20b: TH write Location from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("ingarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 20c: TH reads Location from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 21: TH reads HardwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::HardwareVersion::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 22: TH writes HardwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 17713U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::HardwareVersion::Id, value, chip::NullOptional, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 23: TH reads HardwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::HardwareVersion::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 24: TH reads HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::HardwareVersionString::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 25: TH writes HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newhardwareversiongarbage: not in length on purpose", 18); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::HardwareVersionString::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 30: { + LogStep(30, "Step 26: TH reads HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::HardwareVersionString::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "Step 27: TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SoftwareVersion::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, + "Verify that the SoftwareVersion is not displayed to the end-user through any device specific means (ex: " + "screen, audio)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 33: { + LogStep(33, "Step 28: TH writes SoftwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 33299UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SoftwareVersion::Id, value, chip::NullOptional, chip::NullOptional); + } + case 34: { + LogStep(34, "Step 29: TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SoftwareVersion::Id, true, chip::NullOptional); + } + case 35: { + LogStep(35, "Step 30: TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SoftwareVersionString::Id, true, chip::NullOptional); + } + case 36: { + LogStep(36, "Step 31: TH writes SoftwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("1.0garbage: not in length on purpose", 3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SoftwareVersionString::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 37: { + LogStep(37, "Step 32: TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SoftwareVersionString::Id, true, chip::NullOptional); + } + case 38: { + LogStep(38, "Step 33: TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ManufacturingDate::Id, true, chip::NullOptional); + } + case 39: { + LogStep(39, "Verify if the first 8 characters specify date according to ISO 8601, i.e, YYYYMMDD"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 40: { + LogStep(40, "Step 34: TH writes ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("20210814789452INgarbage: not in length on purpose", 16); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ManufacturingDate::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 41: { + LogStep(41, "Step 35: TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ManufacturingDate::Id, true, chip::NullOptional); + } + case 42: { + LogStep(42, "Step 36: TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::PartNumber::Id, + true, chip::NullOptional); + } + case 43: { + LogStep(43, "Step 37: TH writes PartNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newpartgarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::PartNumber::Id, value, chip::NullOptional, chip::NullOptional); + } + case 44: { + LogStep(44, "Step 38: TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::PartNumber::Id, + true, chip::NullOptional); + } + case 45: { + LogStep(45, "Step 39: TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::ProductURL::Id, + true, chip::NullOptional); + } + case 46: { + LogStep(46, + "Verify that it specifies a link to a specific web page, Verify that it follows the syntax rules specified in " + "RFC 3986."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 47: { + LogStep(47, "Step 40: TH writes ProductURL from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("https://www.example.comgarbage: not in length on purpose", 23); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductURL::Id, value, chip::NullOptional, chip::NullOptional); + } + case 48: { + LogStep(48, "Step 41: TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::ProductURL::Id, + true, chip::NullOptional); + } + case 49: { + LogStep(49, "Step 42: TH reads ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductLabel::Id, true, chip::NullOptional); + } + case 50: { + LogStep(50, "Verify that it does not include the name of the vendor as defined within the VendorName attribute"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 51: { + LogStep(51, "Step 43: TH writes ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductlabelgarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductLabel::Id, value, chip::NullOptional, chip::NullOptional); + } + case 52: { + LogStep(52, "Step 44: TH reads ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductLabel::Id, true, chip::NullOptional); + } + case 53: { + LogStep(53, "Step 45: TH reads SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SerialNumber::Id, true, chip::NullOptional); + } + case 54: { + LogStep(54, "Step 46: TH writes SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newserialnumbergarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SerialNumber::Id, value, chip::NullOptional, chip::NullOptional); + } + case 55: { + LogStep(55, "Step 47: TH reads SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SerialNumber::Id, true, chip::NullOptional); + } + case 56: { + LogStep(56, "Step 48: TH reads LocalConfigDisabled from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, true, chip::NullOptional); + } + case 57: { + LogStep(57, "Step 49: TH sets LocalConfigDisabled to True"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 58: { + LogStep(58, "Step 50: TH reads LocalConfigDisabled from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, true, chip::NullOptional); + } + case 59: { + LogStep(59, "Step 51: TH reads Reachable from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Reachable::Id, + true, chip::NullOptional); + } + case 60: { + LogStep(60, "Step 52a: TH sends Write request message to DUT to change value of Reachable to false"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Reachable::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 61: { + LogStep(61, "Step 52b: TH reads Reachable from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Reachable::Id, + true, chip::NullOptional); + } + case 62: { + LogStep(62, "Step 53: TH reads UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::UniqueID::Id, + true, chip::NullOptional); + } + case 63: { + LogStep(63, "Step 54: TH writes UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newidgarbage: not in length on purpose", 5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::UniqueID::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 64: { + LogStep(64, "Step 55: TH reads UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::UniqueID::Id, + true, chip::NullOptional); + } + case 65: { + LogStep(65, "Step 56: TH reads CapabilityMinima attribute from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::CapabilityMinima::Id, true, chip::NullOptional); + } + case 66: { + LogStep(66, "Step 57: TH writes CapabilityMinima from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::BasicInformation::Structs::CapabilityMinimaStruct::Type value; + + value.caseSessionsPerFabric = 4U; + value.subscriptionsPerFabric = 4U; + + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::CapabilityMinima::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 67: { + LogStep(67, "Step 58: TH reads CapabilityMinima attribute from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::CapabilityMinima::Id, true, chip::NullOptional); + } + case 68: { + LogStep(68, "Step 59: TH reads ProductAppearance from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductAppearance::Id, true, chip::NullOptional); + } + case 69: { + LogStep(69, "Step 60: TH writes ProductAppearance to the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::BasicInformation::Structs::ProductAppearanceStruct::Type value; + + value.finish = static_cast(3); + value.primaryColor.SetNonNull(); + value.primaryColor.Value() = static_cast(4); + + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductAppearance::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 70: { + LogStep(70, "Step 61: TH reads ProductAppearance attribute from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductAppearance::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BINFO_2_2Suite : public TestCommand +{ +public: + Test_TC_BINFO_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_2_2", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BINFO_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint32_t SoftwareVersionValue; + bool ReachableValue; + uint8_t CurrentFabricIndexValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + SoftwareVersionValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); + ReachableValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CurrentFabricIndexValue = value; + } + break; + case 4: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::BasicInformation::Events::StartUp::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "StartUp", "StartUp")); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 5: + switch (mTestSubStepIndex) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 6: + switch (mTestSubStepIndex) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::BasicInformation::Events::StartUp::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("startUp.softwareVersion", value.softwareVersion, SoftwareVersionValue)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + switch (mTestSubStepIndex) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: TH reads SoftwareVersion attribute from DUT and saves for future use"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::SoftwareVersion::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Precondition: TH reads Reachable attribute from DUT and saves for future use"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Reachable::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Precondition: TH saves the FabricIndex during commissioning"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Precondition: TH subscribes to StartUp event on the Basic Information cluster of the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return SubscribeEvent(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Events::StartUp::Id, 30, + 100, false, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 5: { + LogStep(5, "Precondition: TH subscribes to ShutDown event on the Basic Information cluster of the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 0; + return SubscribeEvent(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Events::ShutDown::Id, 30, + 100, false, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 6: { + LogStep(6, "Precondition: TH subscribes to Leave event on the Basic Information cluster of the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.E02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 0; + return SubscribeEvent(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Events::Leave::Id, 30, + 100, false, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 7: { + LogStep(7, "Step 1: Reboot the DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 1: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2: TH reads the StartUp event from DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Events::StartUp::Id, false, + chip::NullOptional); + } + case 11: { + LogStep(11, "Verify that StartUp event has priority set as CRITICAL"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && BINFO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("If priority set as CRITICAL enter 'y' for successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 3: TH subscribes to the ShutDown event on the DUT. Shutdown DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 0; + return SubscribeEvent(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Events::ShutDown::Id, 30, + 100, false, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 13: { + LogStep(13, "Verify that ShutDown event has priority set as CRITICAL"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && BINFO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("If priority set as CRITICAL enter 'y' for successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_1_3Suite : public TestCommand +{ +public: + Test_TC_CNET_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_1_3", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !CNET.S.F00 && !CNET.S.F01 && !CNET.S.F02 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Read the global attribute: FeatureMap when CNET.S.F00 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Read the global attribute: FeatureMap when CNET.S.F01 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Read the global attribute: FeatureMap when CNET.S.F02 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 4b: Read mandatory attributes in AttributeList if CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) is true"); + VerifyOrDo(!ShouldSkip("CNET.S.F00 || CNET.S.F01 || CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4c: Read the optional attribute(ScanMaxTimeSeconds): AttributeList"); + VerifyOrDo(!ShouldSkip("CNET.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4d: Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CNET.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 4e: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep( + 13, + "Step 6a: Read AcceptedCommandList If DUT supports Wi-Fi/Thread related features CNET.S.F00(WI),CNET.S.F01(TH)"); + VerifyOrDo(!ShouldSkip("( CNET.S.F00 || CNET.S.F01 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 6b: Read AcceptedCommandList If DUT supports Wi-Fi related features (CNET.S.F00(WI) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 6c: Read AcceptedCommandList If DUT supports Thread related features(CNET.S.F01(TH) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 6d: Read AcceptedCommandList If DUT supports Ethernet related features(CNET.S.F02(TH) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Step 6e: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, + "Step 7a: Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related features(CNET.S.F00(WI) or " + "CNET.S.F01(TH) is true)"); + VerifyOrDo(!ShouldSkip("( CNET.S.F00 || CNET.S.F01 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep( + 19, + "Step 7b: Read the GeneratedCommandList If DUT supports Ethernet related features(CNET.S.F02(ET) must be true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 7c: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DESC_1_1Suite : public TestCommand +{ +public: + Test_TC_DESC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DESC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DLOG_1_1Suite : public TestCommand +{ +public: + Test_TC_DLOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_1_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DLOG_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: TWait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), DiagnosticLogs::Id, + DiagnosticLogs::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TTH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), DiagnosticLogs::Id, DiagnosticLogs::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TTH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), DiagnosticLogs::Id, DiagnosticLogs::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TTH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), DiagnosticLogs::Id, DiagnosticLogs::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 6a: TTH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), DiagnosticLogs::Id, + DiagnosticLogs::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 6b: TTH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 7a: TTH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), DiagnosticLogs::Id, + DiagnosticLogs::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 7b: TTH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGETH_1_1Suite : public TestCommand +{ +public: + Test_TC_DGETH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGETH_1_1", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGETH_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip(" !DGETH.S.F00 && !DGETH.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given DGETH.S.F00 ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGETH.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given DGETH.S.F01 ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGETH.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4b: TH reads optional attribute(PHYRate) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4c: TH reads optional attribute(FullDuplex) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep( + 9, + "Step 4d: TH reads optional attribute(PacketRxCount) and Feature dependent(DGETH.S.F00(PKTCNT)) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep( + 10, + "Step 4e: TH reads optional attribute(PacketRxCount) and Feature dependent(DGETH.S.F00(PKTCNT)) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep( + 11, + "Step 4f: TH reads optional attribute(PacketRxCount) and Feature dependent(DGETH.S.F01(ERRCNT)) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep( + 12, + "Step 4g: TH reads optional attribute(PacketRxCount) and Feature dependent(DGETH.S.F01(ERRCNT)) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep( + 13, + "Step 4h: TH reads optional attribute(PacketRxCount) and Feature dependent(DGETH.S.F01(ERRCNT)) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4i: TH reads optional attribute(CarrierDetect) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4j: TH reads optional attribute(TimeSinceReset) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 4k: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 6a: TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("( DGETH.S.F00 || DGETH.S.F01 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 6b: TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGETH.S.F00 && !DGETH.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Step 6c: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 21: { + LogStep(21, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGETH_2_1Suite : public TestCommand +{ +public: + Test_TC_DGETH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGETH_2_1", 17, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGETH_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read PHYRate attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read FullDuplex attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::FullDuplex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read PacketRxCount attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "Step 4b: Read PacketRxCount value from DUT and verify the number of packets received on ethernet network " + "interface"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 5a: Read PacketTxCount attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 5b: Read PacketTxCount value from DUT and verify the number of packets received on ethernet network " + "interface"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 6a: Read TxErrCount attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::TxErrCount::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 6b: Read TxErrCount value from DUT and verify value indicates the number of failed packet transmission " + "on ethernet network interface"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 7a: Read CollisionCount attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::CollisionCount::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 7b: Read CollisionCount value from DUT and verify value indicates the number of collision occurred while " + "transmitting packets on ethernet network interface"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 8a: Read OverrunCount attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::OverrunCount::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 8b: Read OverrunCount value from DUT and verify value indicates the number of packets dropped due to " + "lack of buffer memory on ethernet network interface"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 9a: Read CarrierDetect attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::CarrierDetect::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 9b: Read CarrierDetect value from DUT and verify value indicates the presence of carrier detect control " + "signal on ethernet network interface"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 10a: Read TimeSinceReset attribute constraints"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::TimeSinceReset::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 10b: Read TimeSinceReset value from DUT and verify the value indicates the duration of time, in minutes"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGETH_2_2Suite : public TestCommand +{ +public: + Test_TC_DGETH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGETH_2_2", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGETH_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint64_t PacketRxCountValue; + uint64_t PacketTxCountValue; + uint64_t TxErrCountValue; + uint64_t CollisionCountValue; + uint64_t OverrunCountValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + PacketRxCountValue = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + PacketTxCountValue = value; + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TxErrCountValue = value; + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CollisionCountValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + OverrunCountValue = value; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value", value, TxErrCountValue)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value", value, CollisionCountValue)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value", value, OverrunCountValue)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a.1: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a.2: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2a.3: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2a.4: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2a.5: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2a.6: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2a.7: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2a.8: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 2a.9: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 2a.10: TH reads PHYRate attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PHYRate::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2b: TH reads PacketRxCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 2c: TH reads PacketTxCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 2d: TH reads TxErrCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::TxErrCount::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 2e: TH reads CollisionCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::CollisionCount::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 2f: TH reads OverrunCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::OverrunCount::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 2g: Sends ResetCounts command"); + VerifyOrDo(!ShouldSkip("DGETH.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Commands::ResetCounts::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Step 2h: TH reads PacketRxCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0002 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 2i: TH reads PacketTxCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0003 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 2j: TH reads TxErrCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::TxErrCount::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 2k: TH reads CollisionCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::CollisionCount::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 2l: TH reads OverrunCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::OverrunCount::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLW_1_1Suite : public TestCommand +{ +public: + Test_TC_FLW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLW_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: Read the optional attribute(Tolerance) in AttributeList"); + VerifyOrDo(!ShouldSkip("FLW.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 4c: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLW_2_1Suite : public TestCommand +{ +public: + Test_TC_FLW_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLW_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredVariable; + chip::app::DataModel::Nullable MaxMeasuredVariable; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65533U)); + MinMeasuredVariable = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredVariable)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + MaxMeasuredVariable = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredVariable)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredVariable)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2048U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute: MinMeasuredValue"); + VerifyOrDo(!ShouldSkip("FLW.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the mandatory attribute: MaxMeasuredValue"); + VerifyOrDo(!ShouldSkip("FLW.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the mandatory attribute: MeasuredValue"); + VerifyOrDo(!ShouldSkip("FLW.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the Tolerance attribute"); + VerifyOrDo(!ShouldSkip("FLW.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::Tolerance::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLABEL_1_1Suite : public TestCommand +{ +public: + Test_TC_FLABEL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLABEL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FixedLabel::Id, FixedLabel::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FixedLabel::Id, FixedLabel::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FixedLabel::Id, FixedLabel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FixedLabel::Id, FixedLabel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLABEL_2_1Suite : public TestCommand +{ +public: + Test_TC_FLABEL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_2_1", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLABEL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads LabelList from the DUT"); + VerifyOrDo(!ShouldSkip("FLABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FixedLabel::Id, FixedLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH tries to write LabelList attribute of the DUT by setting Label = Test_Label, Value= Test_Value"); + VerifyOrDo(!ShouldSkip("FLABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("Test_Labelgarbage: not in length on purpose", 10); + listHolder_0->mList[0].value = chip::Span("Test_Valuegarbage: not in length on purpose", 10); + + value = + chip::app::DataModel::List(listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FixedLabel::Id, FixedLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads LabelList from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && FLABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_1_1Suite : public TestCommand +{ +public: + Test_TC_FAN_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 2b: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !FAN.S.F00 && !FAN.S.F01 && !FAN.S.F02 && !FAN.S.F03 && !FAN.S.F04 && !FAN.S.F05 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2c: Given FAN.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FAN.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2d: Given FAN.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FAN.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2e: Given FAN.S.F02(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FAN.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2f: Given FAN.S.F03(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FAN.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2g: Given FAN.S.F04(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FAN.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2h: Given FAN.S.F05(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FAN.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3b: Read the feature dependent FAN.S.F00 (SPD) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("FAN.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3c: Read the feature dependent FAN.S.F02(RCK) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("FAN.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3d: Read the feature dependent FAN.S.F03(WND) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("FAN.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3e: Read the feature dependent FAN.S.F05(DIR) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("FAN.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 3f: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip(" !FAN.S.C00.Rsp "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Step 4b: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 5a: Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("FAN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 5b: TH reads from the DUT the GeneratedCommandList attribute. 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values " + "in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed " + "MEI range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the " + "Test Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_2_1Suite : public TestCommand +{ +public: + Test_TC_FAN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::FanModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::FanModeSequenceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the the FanMode attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the the FanModeSequence attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanModeSequence::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the the PercentSetting attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the the PercentCurrent attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentCurrent::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_2_2Suite : public TestCommand +{ +public: + Test_TC_FAN_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_2_2", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t SpeedMaxValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + SpeedMaxValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, SpeedMaxValue)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, SpeedMaxValue)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the the SpeedMax attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedMax::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the the SpeedSetting attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0005 && FAN.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the the SpeedCurrent attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0006 && FAN.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedCurrent::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_2_3Suite : public TestCommand +{ +public: + Test_TC_FAN_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_2_3", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the the RockSupport attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::RockSupport::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the the RockSetting attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::RockSetting::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_2_4Suite : public TestCommand +{ +public: + Test_TC_FAN_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_2_4", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the the WindSupport attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::WindSupport::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the the WindSetting attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A000A"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::WindSetting::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_3_1Suite : public TestCommand +{ +public: + Test_TC_FAN_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_3_1", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigPercentSetting", 0, UINT8_MAX, &mConfigPercentSetting); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mConfigPercentSetting; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::FanModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("fanMode", value, 3U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("percentSetting", value)); + VerifyOrReturn(CheckValue("percentSetting.Value()", value.Value(), 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("percentCurrent", value, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValue("percentCurrent", value, mConfigPercentSetting.HasValue() ? mConfigPercentSetting.Value() : 30U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("percentSetting", value)); + VerifyOrReturn(CheckValue("percentSetting.Value()", value.Value(), + mConfigPercentSetting.HasValue() ? mConfigPercentSetting.Value() : 30U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::FanModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("fanMode", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: TH writes a supported FanMode attribute that is other than off to DUT"); + VerifyOrDo(!ShouldSkip("FAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::FanControl::FanModeEnum value; + value = static_cast(3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("FAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2b: TH reads from the DUT the the FanMode attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2.1a: TH writes the Off value of FanMode attribute to DUT"); + VerifyOrDo(!ShouldSkip("FAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::FanControl::FanModeEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("FAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 2.1b: TH reads from the DUT the PercentSetting attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2.1c: TH reads from the DUT the PercentCurrent attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentCurrent::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3a: TH writes PercentSetting attribute a non-zero value to DUT"); + VerifyOrDo(!ShouldSkip("FAN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = mConfigPercentSetting.HasValue() ? mConfigPercentSetting.Value() : 30U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("FAN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 3b: TH reads from the DUT the PercentCurrent attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentCurrent::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3c: TH reads from the DUT the PercentSetting attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3.1a: TH writes PercentSetting attribute a zero value to DUT"); + VerifyOrDo(!ShouldSkip("FAN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("FAN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 3.1b: TH reads from the DUT the the FanMode attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_3_2Suite : public TestCommand +{ +public: + Test_TC_FAN_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_3_2", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t rSpeedMax; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + rSpeedMax = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("speedSetting", value)); + VerifyOrReturn(CheckValue("speedSetting.Value()", value.Value(), rSpeedMax)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("speedCurrent", value, rSpeedMax)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the SpeedMax attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedMax::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH writes to the DUT the a value less than or equal to the value read in step 2"); + VerifyOrDo(!ShouldSkip("FAN.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = rSpeedMax; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("FAN.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 4: TH reads from the DUT the SpeedSetting attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH reads from the DUT the SpeedCurrent attribute"); + VerifyOrDo(!ShouldSkip("FAN.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedCurrent::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FAN_3_6Suite : public TestCommand +{ +public: + Test_TC_FAN_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FAN_3_6", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FAN_3_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::AirflowDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("airflowDirection", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::AirflowDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("airflowDirection", value, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH writes a value of Forward to the DUT"); + VerifyOrDo(!ShouldSkip("FAN.S.A000B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::FanControl::AirflowDirectionEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AirflowDirection::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("FAN.S.A000B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 3: TH reads from the DUT the AirflowDirection attribute and check it is forwards"); + VerifyOrDo(!ShouldSkip("FAN.S.A000B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AirflowDirection::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH writes a value of Reverse to the DUT"); + VerifyOrDo(!ShouldSkip("FAN.S.A000B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::FanControl::AirflowDirectionEnum value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AirflowDirection::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("FAN.S.A000B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 5: TH reads from the DUT the AirflowDirection attribute and check it is reverse"); + VerifyOrDo(!ShouldSkip("FAN.S.A000B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::AirflowDirection::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CGEN_1_1Suite : public TestCommand +{ +public: + Test_TC_CGEN_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CGEN_1_1", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CGEN_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::EventList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CGEN_2_1Suite : public TestCommand +{ +public: + Test_TC_CGEN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CGEN_2_1", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CGEN_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 1ULL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfo::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH1 reads the BreadCrumb Attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CGEN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH1 writes the BreadCrumb attribute as 1 to the DUT"); + VerifyOrDo(!ShouldSkip("CGEN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint64_t value; + value = 1ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH1 reads the BreadCrumb attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CGEN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH1 reads the RegulatoryConfig attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CGEN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::RegulatoryConfig::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH1 reads the LocationCapability attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CGEN.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::LocationCapability::Id, true, chip::NullOptional); + } + case 6: { + LogStep( + 6, + "Step 6: TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute " + "has the following field: FailSafeExpiryLengthSeconds field value is within a duration range of 0 to 65535"); + VerifyOrDo(!ShouldSkip("CGEN.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::BasicCommissioningInfo::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: TH1 reads SupportsConcurrentConnection attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CGEN.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::SupportsConcurrentConnection::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGGEN_1_1Suite : public TestCommand +{ +public: + Test_TC_DGGEN_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGGEN_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGGEN_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: Read optional attribute(UpTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4c: Read optional attribute(TotalOperationalHours) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4d: Read optional attribute(BootReason) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4e: Read optional attribute(ActiveHardwareFaults) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4f: Read optional attribute(ActiveRadioFaults) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4g: Read optional attribute(ActiveNetworkFaults) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 4h: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 5b: Read optional event(HardwareFaultChange) in EventList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.E00 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 5c: Read optional event(RadioFaultChange) in EventList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.E01 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5d: Read optional event(NetworkFaultChange) in EventList"); + VerifyOrDo(!ShouldSkip("DGGEN.S.E02 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 5e: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GRPKEY_1_1Suite : public TestCommand +{ +public: + Test_TC_GRPKEY_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GRPKEY_1_1", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GRPKEY_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip(" !GRPKEY.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given GRPKEY.S.F00(CS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip(" !PICS_EVENT_LIST_ENABLED "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 4b: The list SHALL NOT contain any additional values in the standard or scoped range: (0x0000_0000 - " + "0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain values in the Manufacturer Extensible " + "Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), " + "these values SHALL be ignored. 3.TThe list SHALL NOT contain any values in the Test Vendor or invalid range: " + "(0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), " + "where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 5a: TH1 reads EventList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 5b: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 6a: TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 7a: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GRPKEY_2_2Suite : public TestCommand +{ +public: + Test_TC_GRPKEY_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GRPKEY_2_2", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GRPKEY_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t Max_GrpKey; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + Max_GrpKey = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", value.groupKeySet.groupKeySetID, 26U)); + VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", value.groupKeySet.groupKeySecurityPolicy, 0U)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", value.groupKeySet.epochKey0)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", value.groupKeySet.epochStartTime0)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime0.Value()", value.groupKeySet.epochStartTime0.Value(), 1ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", value.groupKeySet.epochKey1)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", value.groupKeySet.epochStartTime1)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime1.Value()", value.groupKeySet.epochStartTime1.Value(), + 18446744073709551613ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", value.groupKeySet.epochKey2)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", value.groupKeySet.epochStartTime2)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), + 18446744073709551614ULL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", value.groupKeySet.groupKeySetID, 26U)); + VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", value.groupKeySet.groupKeySecurityPolicy, 0U)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", value.groupKeySet.epochKey0)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", value.groupKeySet.epochStartTime0)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime0.Value()", value.groupKeySet.epochStartTime0.Value(), 1ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", value.groupKeySet.epochKey1)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", value.groupKeySet.epochStartTime1)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime1.Value()", value.groupKeySet.epochStartTime1.Value(), + 17446744073709551613ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", value.groupKeySet.epochKey2)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", value.groupKeySet.epochStartTime2)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), + 17446744073709551614ULL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads MaxGroupKeysPerFabric attribute from GroupKeyManagement cluster on DUT using a " + "fabric-filtered read. Save the value as Max_GrpKey for future use."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as 0x01a"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; + value.groupKeySetID = 26U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 4: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNull(); + value.groupKeySet.epochStartTime1.SetNull(); + value.groupKeySet.epochKey2.SetNull(); + value.groupKeySet.epochStartTime2.SetNull(); + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 5: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNull(); + value.groupKeySet.epochStartTime2.SetNull(); + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 6: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNull(); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 7: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNull(); + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 8: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 0ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 9: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNull(); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 10: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNull(); + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, + "Step 11: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochStartTime1 is " + "earlier than EpochStartTime0"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 1ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, + "Step 12: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochKey1 and " + "EpochStartTime1 are null when EpochKey2 and EpochStartTime2 are not null"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNull(); + value.groupKeySet.epochStartTime1.SetNull(); + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, + "Step 13: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochKey2 is set to " + "null and EpochStartTime2 is not null"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNull(); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, + "Step 14: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochKey2 is not null " + "and EpochStartTime2 is null"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNull(); + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, + "Step 15: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochStartTime2 is " + "earlier than EpochStartTime1"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Step 16: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = + chip::ByteSpan(chip::Uint8::from_const_char("\xd0garbage: not in length on purpose"), 1); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Step 16: Repeat the step by sending EpochKey1 with 1 byte value (< 16 bytes)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = + chip::ByteSpan(chip::Uint8::from_const_char("\xd1garbage: not in length on purpose"), 1); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Step 16: Note: Repeat the step by sending EpochKey2 with 1 byte value (< 16 bytes)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = + chip::ByteSpan(chip::Uint8::from_const_char("\xd2garbage: not in length on purpose"), 1); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 19: { + LogStep(19, + "Step 16a: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: Repeat step 16 by " + "sending KeySetWrite Command with EpochKey0, EpochKey1 and EpochKey2 having 15 bytes value (< 16 byte)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xdegarbage: not in length on purpose"), + 15); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, + "Step 16a: Repeat step 16a by sending KeySetWrite Command with EpochKey1 having 15 bytes value (< 16 byte)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xdegarbage: not in length on purpose"), + 15); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 21: { + LogStep(21, + "Step 16a: Repeat step 16a by sending KeySetWrite Command with EpochKey2 having 15 bytes value (< 16 byte)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xdegarbage: not in length on purpose"), + 15); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, + "Step 16b: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: Repeat step 16 by " + "sending KeySetWrite Command with EpochKey0, EpochKey1 and EpochKey2 having 17 bytes value (> 16 bytes)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xdegarbage: not in length on purpose"), + 17); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, + "Step 16b: Repeat step 16 by sending KeySetWrite Command with EpochKey1 having 17 bytes value (> 16 bytes)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xdegarbage: not in length on purpose"), + 17); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, + "Step 16b: Repeat step 16 by sending KeySetWrite Command with EpochKey2 having 17 bytes value (> 16 bytes)"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xdegarbage: not in length on purpose"), + 17); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, + "Step 17: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0. Note: KeySetWrite " + "command is sent with different EpochKeys,EpochStartTime1 and EpochStartTime2 values"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 26U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd3\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd4\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 17446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd5\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 17446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Step 18: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as 0x01a"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; + value.groupKeySetID = 26U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, + value, chip::NullOptional + + ); + } + case 27: { + LogStep(27, + "Step 19: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as 0x01b that does not " + "exist in the GroupKeyMap attribute list."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; + value.groupKeySetID = 27U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, + value, chip::NullOptional + + ); + } + case 28: { + LogStep(28, + "Step 20: TH removes the Group key set that was added by sending a KeySetRemove command to the " + "GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; + value.groupKeySetID = 26U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional + + ); + } + case 29: { + LogStep(29, + "Step 21: TH sends KeySetWrite command to DUT until size of list for TH’s fabric in GroupKeyMap attribute " + "contains Max_GrpKey entries, starting with GroupKeySetID 1 and incrementing by 1 each time."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Step 23: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used yet."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 3U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 18446744073709551613ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 18446744073709551614ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 31: { + LogStep(31, "Step 24: TH sends KeySetReadAllIndices command to DUT."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C05.Rsp && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, + "Step 22: TH removes the Group key set that was added by sending a KeySetRemove command to the " + "GroupKeyManagement cluster with the GroupKeySetID field set to 0x0"); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; + value.groupKeySetID = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional + + ); + } + case 33: { + LogStep( + 33, + "Step 23: TH removes the Group key set that was added by sending a KeySetRemove command to the GroupKeyManagement " + "cluster with the GroupKeySetID field set to 0x01b that does not exist in the GroupKeyMap attribute list."); + VerifyOrDo(!ShouldSkip("GRPKEY.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; + value.groupKeySetID = 27U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ICDM_1_1Suite : public TestCommand +{ +public: + Test_TC_ICDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_1_1", 19, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ICDM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads ClusterRevision attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads FeatureMap attribute from DUT"); + VerifyOrDo(!ShouldSkip("ICDM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads FeatureMap attribute from DUT"); + VerifyOrDo(!ShouldSkip(" !ICDM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads AttributeList attribute from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: Read the optional attribute(RegisteredClients) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4c: Read the optional attribute(IcdCounter) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4d: Read the optional attribute(ClientsSupportedPerFabric) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 4e: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 5a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 6a: TH reads AcceptedCommandList attribute from DUT"); + VerifyOrDo(!ShouldSkip(" !ICDM.S.F00 && !ICDM.S.C03.Rsp "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 6b: TH reads AcceptedCommandList attribute from DUT if ICDM.S.F00 is true"); + VerifyOrDo(!ShouldSkip("ICDM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 6c: Read the optional command (StayActiveRequest) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 6d: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 7a: TH reads GeneratedCommandList attribute from DUT"); + VerifyOrDo(!ShouldSkip(" !ICDM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 7a: TH reads GeneratedCommandList attribute from DUT"); + VerifyOrDo(!ShouldSkip("ICDM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ICDM_2_1Suite : public TestCommand +{ +public: + Test_TC_ICDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_2_1", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ICDM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint32_t IdleModeIntervalValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 500UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 64800000UL)); + IdleModeIntervalValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 300UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, IdleModeIntervalValue)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 300U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the IdleModeInterval attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::IdleModeInterval::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the ActiveModeInterval attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ActiveModeInterval::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the ActiveModeThreshold attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ActiveModeThreshold::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the RegisteredClients attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the IcdCounter attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::ICDCounter::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the ClientsSupportedPerFabric attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ClientsSupportedPerFabric::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_1_1Suite : public TestCommand +{ +public: + Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: Read the optional command(TriggerEffect) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 6: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 7: Read EventList attribute from the DUT. For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_2_1Suite : public TestCommand +{ +public: + Test_TC_I_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_1", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Identify::IdentifyTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the IdentifyTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("I.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::IdentifyTime::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the IdentifyType attribute from the DUT"); + VerifyOrDo(!ShouldSkip("I.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::IdentifyType::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_2_2Suite : public TestCommand +{ +public: + Test_TC_I_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_2", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 51U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 69U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 42U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 58U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("identifyTime", value, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x003c (60s)."); + VerifyOrDo(!ShouldSkip("I.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::Identify::Type value; + value.identifyTime = 60U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::Identify::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 2b: TH reads immediately IdentifyTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("I.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::IdentifyTime::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 2c: After 10 seconds, the TH reads IdentifyTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("I.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::IdentifyTime::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 3: TH sends IdentifyQuery command to DUT and Verify IdentifyQueryResponse command to TH,with the Timeout " + "field set to a value in the range 0x0000 to 0x0032"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x0000 (stop identifying)."); + VerifyOrDo(!ShouldSkip("I.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::Identify::Type value; + value.identifyTime = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::Identify::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 4b: TH reads immediately IdentifyTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("I.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::IdentifyTime::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6a: TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT"); + VerifyOrDo(!ShouldSkip("I.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 15U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::IdentifyTime::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Wait 5000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 6b: After 5 seconds, the TH reads IdentifyTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("I.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::IdentifyTime::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_2_3Suite : public TestCommand +{ +public: + Test_TC_I_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_3", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 2a: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and the " + "effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(0); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "DUT executes a blink effect"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, + "Step 2b: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and the " + "effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(1); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "DUT executes a breathe effect"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 2c: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and the " + "effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(2); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "DUT executes an okay effect"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 2d: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel change " + "and the effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(11); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "DUT executes a channel change effect"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 2e: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and the " + "effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(1); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "DUT executes a breathe effect"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, + "Step 2f: TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe finish effect and " + "the effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(254); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "DUT stops the breathe effect after the current effect sequence"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, + "Step 2g: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and the " + "effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(1); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "DUT executes a breathe effect"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, + "Step 2h: TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect and " + "the effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(255); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "DUT stops the breathe effect as soon as possible."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, + "Step 3a: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and the " + "effect variant field set to 0x42 unknown"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(0); + value.effectVariant = static_cast(66); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Check DUT executes a blink effect."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, + "Step 3b: TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect and " + "the effect variant field set to 0x00 default"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type value; + value.effectIdentifier = static_cast(255); + value.effectVariant = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Commands::TriggerEffect::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "DUT stops any effect that may be still running as soon as possible"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ILL_1_1Suite : public TestCommand +{ +public: + Test_TC_ILL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ILL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: Read the optional attribute(Tolerance) in AttributeList"); + VerifyOrDo(!ShouldSkip("ILL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4c: Read the optional attribute(LightSensorType) in AttributeList"); + VerifyOrDo(!ShouldSkip("ILL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 5: Read EventList attribute from the DUT.For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 6: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 7: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ILL_2_1Suite : public TestCommand +{ +public: + Test_TC_ILL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_2_1", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ILL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65533U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 2U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2048U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads MinMeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("ILL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads MaxMeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("ILL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads MeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("ILL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads Tolerance attribute from DUT"); + VerifyOrDo(!ShouldSkip("ILL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::Tolerance::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads LightSensorType attribute from DUT"); + VerifyOrDo(!ShouldSkip("ILL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::LightSensorType::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ILL_2_2Suite : public TestCommand +{ +public: + Test_TC_ILL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_2_2", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ILL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: TH reads MinMeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("ILL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2b: TH reads MaxMeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("ILL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: Cover the sensor or darken the room"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for Successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Wait 1s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 4: After a few seconds, TH reads MeasuredValue attribute from DUT."); + VerifyOrDo(!ShouldSkip("ILL.S.A0000 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: Expose the sensor again to light"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for Successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Wait 1s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 6: After a few seconds, TH reads MeasuredValue attribute from DUT."); + VerifyOrDo(!ShouldSkip("ILL.S.A0000 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_1_1Suite : public TestCommand +{ +public: + Test_TC_LVL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16384UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !LVL.S.F00 && !LVL.S.F01 && !LVL.S.F02 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Given LVL.S.F00(OO) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("LVL.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Given LVL.S.F01(LT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2d: Given LVL.S.F02(FQ) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("LVL.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3b: Read the optional attribute(StartUpCurrentLevel and RemainingTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3c: Read the optional attribute(CurrentFrequency, MinFrequency and MinFrequency) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3d: Read the optional attribute(MinLevel) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3e: Read the optional attribute(MaxLevel) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3f: Read the optional attribute(OnOffTransitionTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3g: Read the optional attribute(OnTransitionTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3h: Read the optional attribute(OffTransitionTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3i: Read the optional attribute(DefaultMoveRate) in AttributeList"); + VerifyOrDo(!ShouldSkip("LVL.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4a.1: Read the Feature-dependent(LVL.S.F02) command in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("LVL.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4b: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 5: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_2_1Suite : public TestCommand +{ +public: + Test_TC_LVL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_2_1", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable CurrentLevelValue; + uint8_t MinLevelValue; + uint8_t MinLevelFeatureMapNotSupportedValue; + uint8_t MaxLevelValue; + uint8_t MaxLevelFeatureMapNotSupportedValue; + uint16_t MinFrequencyValue; + uint16_t MaxFrequencyValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + CurrentLevelValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("minLevel", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + MinLevelValue = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + MinLevelFeatureMapNotSupportedValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("maxLevel", value, 254U)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelValue)); + MaxLevelValue = value; + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + MaxLevelFeatureMapNotSupportedValue = value; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxLevelValue)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxLevelFeatureMapNotSupportedValue)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + MinFrequencyValue = value; + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + MaxFrequencyValue = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinFrequencyValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxFrequencyValue)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxLevelValue)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxLevelFeatureMapNotSupportedValue)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Reads the CurrentLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Reads the RemainingTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::RemainingTime::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: Reads the MinLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0002 && LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3b: Reads the MinLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0002 && !LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4: Reads the MaxLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0003 && LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4a: Reads the MaxLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0003 && !LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4b & 4C Reads the CurrentLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.F01 && LVL.S.A0002 && LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4b & 4C Reads the CurrentLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0002 && LVL.S.A0003 && !LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 5: Reads the CurrentFrequency attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6: Reads the MinFrequency attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinFrequency::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 7: Reads the MaxFrequency attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxFrequency::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 7b & 7C Reads the CurrentFrequency attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 8: Reads the OnOffTransitionTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 9a: Reads the OnLevel attribute "); + VerifyOrDo(!ShouldSkip("LVL.S.F01 && LVL.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 9b: Reads the OnLevel attribute "); + VerifyOrDo(!ShouldSkip("LVL.S.A0011 && !LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 10: Reads the OnTransitionTime attribute "); + VerifyOrDo(!ShouldSkip("LVL.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 11: Reads the OffTransitionTime attribute "); + VerifyOrDo(!ShouldSkip("LVL.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 12: Reads the DefaultMoveRate attribute "); + VerifyOrDo(!ShouldSkip("LVL.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 13: Reads the Options attribute "); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Step 14: Reads the StartUpCurrentLevel attribute "); + VerifyOrDo(!ShouldSkip("LVL.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::StartUpCurrentLevel::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_2_2Suite : public TestCommand +{ +public: + Test_TC_LVL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_2_2", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("OnOffTransitionTimeConfigValue", 0, UINT16_MAX, &mOnOffTransitionTimeConfigValue); + AddArgument("OnLevelConfigValue", 0, UINT8_MAX, &mOnLevelConfigValue); + AddArgument("OnTransitionTimeConfigValue", 0, UINT16_MAX, &mOnTransitionTimeConfigValue); + AddArgument("OffTransitionTimeConfigValue", 0, UINT16_MAX, &mOffTransitionTimeConfigValue); + AddArgument("DefaultMoveRateConfigValue", 0, UINT8_MAX, &mDefaultMoveRateConfigValue); + AddArgument("StartUpCurrentLevelConfigValue", 0, UINT8_MAX, &mStartUpCurrentLevelConfigValue); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mOnOffTransitionTimeConfigValue; + chip::Optional mOnLevelConfigValue; + chip::Optional mOnTransitionTimeConfigValue; + chip::Optional mOffTransitionTimeConfigValue; + chip::Optional mDefaultMoveRateConfigValue; + chip::Optional mStartUpCurrentLevelConfigValue; + chip::Optional mTimeout; + + uint16_t OnOffTransitionTimeValue; + chip::app::DataModel::Nullable OnLevelValue; + chip::app::DataModel::Nullable OnTransitionTimeValue; + chip::app::DataModel::Nullable OffTransitionTimeValue; + chip::app::DataModel::Nullable DefaultMoveRatevalue; + chip::app::DataModel::Nullable StartUpCurrentLevelValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + OnOffTransitionTimeValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValue("onOffTransitionTime", value, + mOnOffTransitionTimeConfigValue.HasValue() ? mOnOffTransitionTimeConfigValue.Value() : 10U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, OnOffTransitionTimeValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + OnLevelValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("onLevel", value)); + VerifyOrReturn(CheckValue("onLevel.Value()", value.Value(), + mOnLevelConfigValue.HasValue() ? mOnLevelConfigValue.Value() : 5U)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, OnLevelValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + OnTransitionTimeValue = value; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("onTransitionTime", value)); + VerifyOrReturn(CheckValue("onTransitionTime.Value()", value.Value(), + mOnTransitionTimeConfigValue.HasValue() ? mOnTransitionTimeConfigValue.Value() : 5U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, OnTransitionTimeValue)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + OffTransitionTimeValue = value; + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("offTransitionTime", value)); + VerifyOrReturn(CheckValue("offTransitionTime.Value()", value.Value(), + mOffTransitionTimeConfigValue.HasValue() ? mOffTransitionTimeConfigValue.Value() : 10U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, OffTransitionTimeValue)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + DefaultMoveRatevalue = value; + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("defaultMoveRate", value)); + VerifyOrReturn(CheckValue("defaultMoveRate.Value()", value.Value(), + mDefaultMoveRateConfigValue.HasValue() ? mDefaultMoveRateConfigValue.Value() : 111U)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, DefaultMoveRatevalue)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + StartUpCurrentLevelValue = value; + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("startUpCurrentLevel", value)); + VerifyOrReturn( + CheckValue("startUpCurrentLevel.Value()", value.Value(), + mStartUpCurrentLevelConfigValue.HasValue() ? mStartUpCurrentLevelConfigValue.Value() : 5U)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, StartUpCurrentLevelValue)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: Reads the OnOffTransitionTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: writes the OnOffTransitionTime attribute on the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = mOnOffTransitionTimeConfigValue.HasValue() ? mOnOffTransitionTimeConfigValue.Value() : 10U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 1c: Reads the OnOffTransitionTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2a: Reads the OnLevel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2b: writes the OnLevel attribute on the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = mOnLevelConfigValue.HasValue() ? mOnLevelConfigValue.Value() : 5U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2c: Reads the OnLevel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3a: Reads the OnTransitionTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3b: Writes the OnTransitionTime attribute on the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = mOnTransitionTimeConfigValue.HasValue() ? mOnTransitionTimeConfigValue.Value() : 5U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3c: Reads the OnTransitionTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4a: Reads the OffTransitionTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4b: Writes the OffTransitionTime attribute on the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = mOffTransitionTimeConfigValue.HasValue() ? mOffTransitionTimeConfigValue.Value() : 10U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4c: Reads the OffTransitionTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 5a: Reads the DefaultMoveRate attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 5b: Writes the DefaultMoveRate attribute on the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = mDefaultMoveRateConfigValue.HasValue() ? mDefaultMoveRateConfigValue.Value() : 111U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5c: Reads the DefaultMoveRate attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 6a: Reads the StartUpCurrentLevel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::StartUpCurrentLevel::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 6b: Rwrites the StartUpCurrentLevel attribute on the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = mStartUpCurrentLevelConfigValue.HasValue() ? mStartUpCurrentLevelConfigValue.Value() : 5U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::StartUpCurrentLevel::Id, value, chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 6c: Rreads the StartUpCurrentLevel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::StartUpCurrentLevel::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "writes back default value of OnOffTransitionTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_3_1Suite : public TestCommand +{ +public: + Test_TC_LVL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_3_1", 47, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 50U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 50U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 85U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 127U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 173U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 200U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 200U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 200U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("options", value, 0U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 100U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 100U)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 100U)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 160U)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("options", value, 1U)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 100U)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 120U)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 120U)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 160U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Check on/off attribute value is true after on command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Precondition: write default value of OnOffTransitionTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1a: TH writes NULL to the OnLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2a: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C04.Rsp && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 2b: TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and TransitionTime =0 (immediate)"); + VerifyOrDo(!ShouldSkip("LVL.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type value; + value.level = 50U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevelWithOnOff::Id, + value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && LVL.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C04.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3a: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C04.Rsp && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 50U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 3c: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 4a: TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). This " + "means the level should increase by 150 units in 30s, so 5 units/s"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 200U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 300U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 4b: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 4c: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 4d: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 5000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 4e: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Step 4f: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Step 5a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 5b: TH reads Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Step 5c: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Step 5d: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 100U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Step 5e: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 5f: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Step 5g: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 120U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Step 5h: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, "Step 5i: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 140U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 32: { + LogStep(32, "Step 5j: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, "Step 5k: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 160U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Step 5l: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Step 6a: TH writes 1 to the Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(1U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 36: { + LogStep(36, "Step 6b: TH reads Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, true, + chip::NullOptional); + } + case 37: { + LogStep(37, "Step 6c: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 38: { + LogStep(38, "Step 6d: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 100U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Step 6e: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 40: { + LogStep(40, "Step 6f: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 41: { + LogStep(41, "Step 6g: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 120U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 42: { + LogStep(42, "Step 6h: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 43: { + LogStep(43, "Step 6i: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 140U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 44: { + LogStep(44, "Step 6j: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 45: { + LogStep(45, "Step 6k: TH sends a MoveToLevel command to the DUT with"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 160U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 46: { + LogStep(46, "Step 6l: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_4_1Suite : public TestCommand +{ +public: + Test_TC_LVL_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_4_1", 26, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable CurrentLevelValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + CurrentLevelValue = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 50U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 85U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 127U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 173U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 254U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Check on/off attribute value is true after on command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Precondition: write default value of OnOffTransitionTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1b: TH reads the MaxLevel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2a: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp && LVL.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 2b: TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 (units/s)"); + VerifyOrDo(!ShouldSkip("LVL.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type value; + value.moveMode = static_cast(0); + value.rate.SetNonNull(); + value.rate.Value() = 10U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveWithOnOff::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && LVL.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 5000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3a: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 50U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Step 3c: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 (units/s)"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::Move::Type value; + value.moveMode = static_cast(0); + value.rate.SetNonNull(); + value.rate.Value() = 5U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Move::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 4b: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 4c: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 4d: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Wait 19s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 19000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 4e: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Precondition send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_5_1Suite : public TestCommand +{ +public: + Test_TC_LVL_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_5_1", 23, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_5_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 50U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 85U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 127U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 173U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 200U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 200U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 200U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Check on/off attribute value is true after on command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Precondition: write default value of OnOffTransitionTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2a: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp && LVL.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, + "Step 2b: TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 and TransitionTime " + "=0 (immediate)"); + VerifyOrDo(!ShouldSkip("LVL.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type value; + value.stepMode = static_cast(0); + value.stepSize = 50U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::StepWithOnOff::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && LVL.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3a: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 50U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 3c: Reads current level attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 4a: TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and TransitionTime =300"); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::Step::Type value; + value.stepMode = static_cast(0); + value.stepSize = 150U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 300U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Step::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 4b: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 4c: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 4d: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Wait 5000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 4e: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Step 4f: TH reads CurrentLevel attribute from DUT (after DUT has finished the transition)"); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Precondition send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_6_1Suite : public TestCommand +{ +public: + Test_TC_LVL_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_6_1", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_6_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 50U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 64U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 86U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 85U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: write default value of OnOffTransitionTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1a: H writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 1b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 2a: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 50U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 2b: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 2c: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field " + "set to 0x05 (5 units/s)"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::Move::Type value; + value.moveMode = static_cast(0); + value.rate.SetNonNull(); + value.rate.Value() = 5U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Move::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 2d: Wait 5000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 3: Sends stop command to DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::Stop::Type value; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Stop::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Physically verify that the device has stopped transitioning"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && LVL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 4: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.C03.Rsp && LVL.S.A0000"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 5: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field " + "set to 0x05 (5 units/s)"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::Move::Type value; + value.moveMode = static_cast(0); + value.rate.SetNonNull(); + value.rate.Value() = 5U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Move::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Wait 5000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 6: TH sends a StopWithOnOff command to the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type value; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::StopWithOnOff::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Physically verify that the device has stopped transitioning"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && LVL.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 7: Reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.C07.Rsp && LVL.S.A0000"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Precondition send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_7_1Suite : public TestCommand +{ +public: + Test_TC_LVL_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_7_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("RandomLevelValue", 0, UINT8_MAX, &mRandomLevelValue); + AddArgument("RandomFrequencyValue", 0, UINT16_MAX, &mRandomFrequencyValue); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_7_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mRandomLevelValue; + chip::Optional mRandomFrequencyValue; + chip::Optional mTimeout; + + uint8_t minLevelValue; + uint8_t maxLevelValue; + uint16_t CurrentFrequencyValue; + uint16_t MinFrequencyValue; + uint16_t MaxFrequencyValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + minLevelValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + maxLevelValue = value; + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), + mRandomLevelValue.HasValue() ? mRandomLevelValue.Value() : 100U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + CurrentFrequencyValue = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + MinFrequencyValue = value; + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinFrequencyValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + MaxFrequencyValue = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinFrequencyValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxFrequencyValue)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentFrequency", value, + mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentFrequency", value, + mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentFrequency", value, + mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: write default value of OnOffTransitionTime attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 1a: TH reads the MinLevel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1b: TH reads the MaxLevel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 1c: TH sends a MoveToLevel command to DUT, with the Level field set to a value between the MinLevel and " + "MaxLevel values (if present, otherwise between 0x01 and 0xFE) and the TransitionTime field set to 0x0000 " + "(move immediately)."); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = mRandomLevelValue.HasValue() ? mRandomLevelValue.Value() : 100U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 1d: TH reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 2a: TH reads the CurrentFrequency attribute."); + VerifyOrDo(!ShouldSkip("LVL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 2b: TH reads the MinFrequency attribute."); + VerifyOrDo(!ShouldSkip("LVL.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinFrequency::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2c: TH reads the MaxFrequency attribute and check, if fmax < fmin, FAIL the test."); + VerifyOrDo(!ShouldSkip("LVL.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxFrequency::Id, true, + chip::NullOptional); + } + case 12: { + LogStep( + 12, + "Step 2d: sanity check on values read in steps 2a..2c, if fc < fmin, FAIL the test and fc > fmax, FAIL the test"); + VerifyOrDo(!ShouldSkip("LVL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 3a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to a random value " + "frand, chosen such that: fmin < frand < fmax"); + VerifyOrDo(!ShouldSkip("LVL.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Type value; + value.frequency = mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToClosestFrequency::Id, + value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 3b: TH reads the CurrentFrequency attribute."); + VerifyOrDo(!ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to fmax + 1"); + VerifyOrDo(!ShouldSkip("LVL.S.C08.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 4b: TH reads the CurrentFrequency attribute."); + VerifyOrDo(!ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004 && PICS_USER_PROMPT"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 5a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to fmin - 1"); + VerifyOrDo(!ShouldSkip("LVL.S.C08.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 5b: TH reads the CurrentFrequency attribute."); + VerifyOrDo(!ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004 && PICS_USER_PROMPT"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LCFG_1_1Suite : public TestCommand +{ +public: + Test_TC_LCFG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LCFG_1_1", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LCFG_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), LocalizationConfiguration::Id, + LocalizationConfiguration::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), LocalizationConfiguration::Id, + LocalizationConfiguration::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), LocalizationConfiguration::Id, + LocalizationConfiguration::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), LocalizationConfiguration::Id, + LocalizationConfiguration::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), LocalizationConfiguration::Id, + LocalizationConfiguration::Attributes::EventList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), LocalizationConfiguration::Id, + LocalizationConfiguration::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), LocalizationConfiguration::Id, + LocalizationConfiguration::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LUNIT_1_2Suite : public TestCommand +{ +public: + Test_TC_LUNIT_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_1_2", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LUNIT_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip(" !LUNIT.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, UnitLocalization::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: Given LUNIT.S.F00(TEMP) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("LUNIT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, UnitLocalization::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: TH reads Feature dependent(LUNIT.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("LUNIT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, UnitLocalization::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6: TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 7: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LUNIT_3_1Suite : public TestCommand +{ +public: + Test_TC_LUNIT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_3_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LUNIT_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 1U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 2U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads TemperatureUnit attribute from DUT"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH writes 0 (Fahrenheit) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH writes 1 (Celsius) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: TH writes 2 (Kelvin) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + value = static_cast(2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 8: TH writes 5 to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnitEnum value; + value = static_cast(5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LTIME_1_2Suite : public TestCommand +{ +public: + Test_TC_LTIME_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_2", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LTIME_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4c: TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::EventList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6: TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 7: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LTIME_3_1Suite : public TestCommand +{ +public: + Test_TC_LTIME_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_3_1", 12, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LTIME_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hourFormat", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hourFormat", value, 1U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 12)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads HourFormat attribute from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::HourFormat::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: If (LTIME.S.A0000.12HR) TH writes 0 to HourFormat attribute"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0000.12HR"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::HourFormat::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads HourFormat attribute"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::HourFormat::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: If (LTIME.S.A0000.24HR) TH writes 1 to HourFormat attribute"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0000.24HR"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::HourFormat::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH reads HourFormat attribute"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::HourFormat::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: TH reads ActiveCalendarType attribute from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::ActiveCalendarType::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: TH reads SupportedCalendarTypes attribute from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::SupportedCalendarTypes::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 8: TH writes value in PIXIT.LTIME.SCT to ActiveCalendarType attribute, followed by reading the " + "ActiveCalendarType attribute value"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0001 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 9: Repeat step 8 for all the values in PIXIT.LTIME.SCT"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0001 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 10: TH writes 50 to ActiveCalendarType attribute"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum value; + value = static_cast(50); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::ActiveCalendarType::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 11: TH writes 5 to HourFormat attribute"); + VerifyOrDo(!ShouldSkip("LTIME.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value; + value = static_cast(5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::HourFormat::Id, value, chip::NullOptional, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LWM_1_1Suite : public TestCommand +{ +public: + Test_TC_LWM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LWM_1_1", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LWM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the ClusterRevision attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, + "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if LWM.S.F00(DEPONOFF)"); + VerifyOrDo(!ShouldSkip("LWM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads from the DUT the FeatureMap attribute."); + VerifyOrDo(!ShouldSkip(" !LWM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads from the DUT the AttributeList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads from the DUT the AttributeList attribute."); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: Read the optional attribute(StartUpMode) in AttributeList"); + VerifyOrDo(!ShouldSkip("LWM.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4c: Read the Feature dependent attribute(DEPONOFF) in AttributeList"); + VerifyOrDo(!ShouldSkip("LWM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 4d: TH reads AttributeList attribute from DUT 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in " + "the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 5a: TH reads from the DUT the EventList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::EventList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 5b: TH reads EventList attribute from DUT 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignore 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 6a: TH reads from the DUT the AcceptedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 6b: TH reads AcceptedCommandList attribute from DUT.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 7a: TH reads from the DUT the GeneratedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where[1688447564.178537][4220:4222] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute " + "0x0000_FFF8 DataVersion: 1795162772 [1688447564.178684][4220:4222] CHIP:TOO: GeneratedCommandList: 0 " + "entries [1688447564.178984][4220:4222] CHIP:EM: <<< [E:5540i S:25125 M:256711779 (Ack:197472718)] (S) Msg TX " + "to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) XXXX is the allowed MEI range " + "(0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LWM_2_1Suite : public TestCommand +{ +public: + Test_TC_LWM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LWM_2_1", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("NewMode_CHANGE_OK", 0, UINT8_MAX, &mNewModeChangeOk); + AddArgument("NewMode_CHANGE_FAIL", 0, UINT8_MAX, &mNewModeChangeFail); + AddArgument("invalid_mode_th", 0, UINT8_MAX, &mInvalidModeTh); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LWM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mNewModeChangeOk; + chip::Optional mNewModeChangeFail; + chip::Optional mInvalidModeTh; + chip::Optional mTimeout; + + uint8_t old_current_mode_dut; + uint8_t Step6_current_mode_dut; + uint8_t Step10_current_mode_dut; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::LaundryWasherMode::Structs::ModeOptionStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 2)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + old_current_mode_dut = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + Step6_current_mode_dut = value; + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, Step6_current_mode_dut)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + Step10_current_mode_dut = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, mNewModeChangeOk.HasValue() ? mNewModeChangeOk.Value() : 2U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, mNewModeChangeOk.HasValue() ? mNewModeChangeOk.Value() : 2U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1:Commission DUT to TH (can be skipped if done in a preceding test)."); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the SupportedModes attribute."); + VerifyOrDo(!ShouldSkip("LWM.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::SupportedModes::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the CurrentMode attribute."); + VerifyOrDo(!ShouldSkip("LWM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::CurrentMode::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th"); + VerifyOrDo(!ShouldSkip("LWM.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::Type value; + value.newMode = old_current_mode_dut; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, LaundryWasherMode::Commands::ChangeToMode::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep( + 4, + "Step 5: Manually put the device in a state from which it will FAIL to transition to PIXIT.LWM.MODE_CHANGE_FAIL"); + VerifyOrDo(!ShouldSkip("LWM.S.M.CAN_TEST_MODE_FAILURE && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the CurrentMode attribute."); + VerifyOrDo(!ShouldSkip("LWM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::CurrentMode::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set to PIXIT.LWM.MODE_CHANGE_FAIL"); + VerifyOrDo(!ShouldSkip("LWM.S.M.CAN_TEST_MODE_FAILURE && LWM.S.C00.Rsp && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 8: TH reads from the DUT the CurrentMode attribute."); + VerifyOrDo(!ShouldSkip("LWM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::CurrentMode::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 9: Manually put the device in a state from which it will SUCCESSFULLY transition to " + "PIXIT.LWM.MODE_CHANGE_OK"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 10: TH reads from the DUT the CurrentMode attribute."); + VerifyOrDo(!ShouldSkip("LWM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::CurrentMode::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set to PIXIT.LWM.MODE_CHANGE_OK"); + VerifyOrDo(!ShouldSkip("LWM.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::Type value; + value.newMode = mNewModeChangeOk.HasValue() ? mNewModeChangeOk.Value() : 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, LaundryWasherMode::Commands::ChangeToMode::Id, + value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, + "Step 12: TH reads from the DUT the CurrentMode attribute. Verify that the DUT response contains an integer " + "value equal to PIXIT.LWM.MODE_CHANGE_OK"); + VerifyOrDo(!ShouldSkip("LWM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::CurrentMode::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set to invalid_mode_th"); + VerifyOrDo(!ShouldSkip("LWM.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::Type value; + value.newMode = mInvalidModeTh.HasValue() ? mInvalidModeTh.Value() : 5U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, LaundryWasherMode::Commands::ChangeToMode::Id, + value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, + "Step 14: TH reads from the DUT the CurrentMode attribute. Verify that the DUT response contains an integer " + "value equal to PIXIT.LWM.MODE_CHANGE_OK"); + VerifyOrDo(!ShouldSkip("LWM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LaundryWasherMode::Id, + LaundryWasherMode::Attributes::CurrentMode::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LOWPOWER_1_1Suite : public TestCommand +{ +public: + Test_TC_LOWPOWER_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_LOWPOWER_1_1", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LOWPOWER_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65530UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 6)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 5)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_KEYPADINPUT_1_2Suite : public TestCommand +{ +public: + Test_TC_KEYPADINPUT_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_KEYPADINPUT_1_2", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_KEYPADINPUT_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !KEYPADINPUT.S.F00 && KEYPADINPUT.S.F01 && !KEYPADINPUT.S.F02 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Given (KEYPADINPUT.S.F00(NV)) FeatureMap bit mask is set or not"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Given (KEYPADINPUT.S.F01(LK)) FeatureMap bit mask is set or not"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2d: Given (KEYPADINPUT.S.F02(NK)) FeatureMap bit mask is set or not"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_1_3Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_1_3", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !APPLAUNCHER.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3b: Read the optional attribute(CatalogList) in AttributeList"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3c: Read the optional attribute(CurrentApp) in AttributeList"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_1_4Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_1_4", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !MEDIAINPUT.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2: Given MEDIAINPUT.S.F00(NU) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3b: Read the optional attribute(InputList) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3c: Read the optional attribute(CurrentInput) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WAKEONLAN_1_5Suite : public TestCommand +{ +public: + Test_TC_WAKEONLAN_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WAKEONLAN_1_5", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WAKEONLAN_1_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3b: Read the optional attribute(MACAddress) in AttributeList"); + VerifyOrDo(!ShouldSkip("WAKEONLAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CHANNEL_1_6Suite : public TestCommand +{ +public: + Test_TC_CHANNEL_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CHANNEL_1_6", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CHANNEL_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("( !CHANNEL.S.F00 && !CHANNEL.S.F01 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Given CCHANNEL.S.F00(CL) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Given CHANNEL.S.F01(LI) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3b: Read the optional attribute(ChannelList): AttributeList"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3c: Reading optional attribute(Lineup) in AttributeList"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3d: Read the optional attribute(CurrentChannel): AttributeList"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4a: Read the optional command(ChangeChannel) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4b: Read the optional command(ChangeChannelByNumber) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4c: Read the optional command(SkipChannel) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 5a: Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("( !CHANNEL.S.F00 && !CHANNEL.S.F01 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 5b: Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.F00 || CHANNEL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAPLAYBACK_1_7Suite : public TestCommand +{ +public: + Test_TC_MEDIAPLAYBACK_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAPLAYBACK_1_7", 24, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAPLAYBACK_1_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !MEDIAPLAYBACK.S.F00 && !MEDIAPLAYBACK.S.F01 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Given MEDIAPLAYBACK.S.F00(AS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Given MEDIAPLAYBACK.S.F01(VS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3b: Read the optional attribute(StartTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3c: Read the optional attribute(Duration) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3d: Read the optional attribute(SampledPosition) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3e: Read the optional attribute(PlaybackSpeed) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3f: Read the optional attribute(SeekRangeEnd) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3g: Read the optional attribute(SeekRangeStart) in AttributeList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4b: Read the optional command(StartOver) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4c: Read the optional command(Previous) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4d: Read the optional command(Next) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4e: Read the optional command(Rewind) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4f: Read the optional command(FastForward) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4g: Read the optional command(SkipForward) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 4h: Read the optional command(SkipBackward) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C09.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 4i: Read the optional command(Seek) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_AUDIOOUTPUT_1_8Suite : public TestCommand +{ +public: + Test_TC_AUDIOOUTPUT_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_AUDIOOUTPUT_1_8", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_AUDIOOUTPUT_1_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("AUDIOOUTPUT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !AUDIOOUTPUT.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TGTNAV_1_9Suite : public TestCommand +{ +public: + Test_TC_TGTNAV_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TGTNAV_1_9", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TGTNAV_1_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, TargetNavigator::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3b: Read the optional attribute(CurrentTarget) in AttributeList"); + VerifyOrDo(!ShouldSkip("TGTNAV.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, TargetNavigator::Attributes::EventList::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APBSC_1_10Suite : public TestCommand +{ +public: + Test_TC_APBSC_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_APBSC_1_10", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APBSC_1_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Read FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3b: Read the optional attribute(VendorName) in AttributeList"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3c: Read the optional attribute(VendorID) in AttributeList"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3d: Read the optional attribute(ProductID) in AttributeList"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::EventList::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_1_11Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_1_11", 13, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_1_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("( !CONTENTLAUNCHER.S.F00 && !CONTENTLAUNCHER.S.F01 )"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Given CONTENTLAUNCHER.S.F00 (CS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Given CONTENTLAUNCHER.S.F01(UP) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3b: Read the optional attribute(AcceptHeader): AttributeList"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3c: Read the optional attribute(SupportedStreamingProtocols): AttributeList"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4a: Read the optional command(LaunchContent) in AcceptedCommandList attribute"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.C.C00.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4b: Read the optional command(LaunchURL) in AcceptedCommandList attribute"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.C.C01.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 6: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Attributes::EventList::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ALOGIN_1_12Suite : public TestCommand +{ +public: + Test_TC_ALOGIN_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ALOGIN_1_12", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ALOGIN_1_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, + AccountLogin::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, + AccountLogin::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 6: TH reads EventList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::EventList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LOWPOWER_2_1Suite : public TestCommand +{ +public: + Test_TC_LOWPOWER_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_LOWPOWER_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LOWPOWER_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH sends Sleep command to DUT"); + VerifyOrDo(!ShouldSkip("LOWPOWER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LowPower::Commands::Sleep::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Commands::Sleep::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_KEYPADINPUT_3_2Suite : public TestCommand +{ +public: + Test_TC_KEYPADINPUT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_KEYPADINPUT_3_2", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_KEYPADINPUT_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH sends CEC Settings Keys(0x0A) to DUT"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.F01 && KEYPADINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(10); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 2: TH sends CEC Home Keys(0x09) to DUT"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.F01 && KEYPADINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_KEYPADINPUT_3_3Suite : public TestCommand +{ +public: + Test_TC_KEYPADINPUT_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_KEYPADINPUT_3_3", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_KEYPADINPUT_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: Send Numbers1"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(33); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: Send Numbers2"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(34); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1c: Send Numbers3"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(35); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 1d: Send Numbers4"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(36); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 1e: Send Numbers5"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(37); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 1f: Send Numbers6"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(38); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 1g: Send Numbers7"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(39); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 1h: Send Numbers8"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(40); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 1i: Send Numbers9"); + VerifyOrDo(!ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(41); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_5Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_5", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads CatalogList attribute from the DUT and where each entry in the list is a CSA-issued Vendor " + "Id of type unsigned 16 bit integer ranging between 0-65536 for the catalog"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::CatalogList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_6Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_6", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable< + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads CurrentApp attribute from the DUT and Verify the in-focus application attributes, which " + "should include the display Application ID(type:uint16) Catalog Vendor ID(type:string) or Null if there is no " + "current in-focus application"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::CurrentApp::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_7Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_7", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mCatalogVendorId; + chip::Optional mApplicationId; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Launch an app with the provided a application ID"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); + + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + value.data.Emplace(); + value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("Hello Worldgarbage: not in length on purpose"), 11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Commands::LaunchApp::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 2: TH sends a LaunchApp command to DUT to launch an app which is not available"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); + + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = + chip::Span("NonAvailableAppgarbage: not in length on purpose", 15); + + value.data.Emplace(); + value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("Hello Worldgarbage: not in length on purpose"), 11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Commands::LaunchApp::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_10Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_10", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of " + "available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_11", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Index", 0, UINT8_MAX, &mIndex); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mIndex; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentInput", value, mIndex.HasValue() ? mIndex.Value() : 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of " + "available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, + "Step 2: TH sends SelectInput command to DUT to select an input by passing the index of the preferred input."); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::SelectInput::Type value; + value.index = mIndex.HasValue() ? mIndex.Value() : 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::SelectInput::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3: TH reads _CurrentInput attribute from the DUT to show the current input selected."); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0001 && MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::CurrentInput::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_12", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of " + "available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Show Input Status Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::ShowInputStatus::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3: Hide Input Status Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::HideInputStatus::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_13", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Index", 0, UINT8_MAX, &mIndex); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mIndex; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads the InputList attribute from the DUT to show list of Inputs available"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH sends a RenameInput command to DUT to rename an input from the list returned in step 1"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::RenameInput::Type value; + value.index = mIndex.HasValue() ? mIndex.Value() : 1U; + value.name = chip::Span("A1garbage: not in length on purpose", 2); + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::RenameInput::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3: TH reads the InputList attribute from the DUT to show list of Inputs available"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CHANNEL_5_1Suite : public TestCommand +{ +public: + Test_TC_CHANNEL_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CHANNEL_5_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CHANNEL_5_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads the ChannelList attribute from the DUT to show list of Inputs available and Verify that the " + "response contains a list of the known TV channels. Each list element should consist of the following,Major " + "number (unsigned 16-bit integer, mandatory),Minor number (unsigned 16-bit integer, mandatory),Name (String, " + "optional),Call sign (String, optional),Affiliate call sign (String, optional)"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CHANNEL_5_2Suite : public TestCommand +{ +public: + Test_TC_CHANNEL_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CHANNEL_5_2", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("majornumber", 0, UINT16_MAX, &mMajornumber); + AddArgument("minornumber", 0, UINT16_MAX, &mMinornumber); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CHANNEL_5_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mMajornumber; + chip::Optional mMinornumber; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, + mMajornumber.HasValue() ? mMajornumber.Value() : 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, + mMinornumber.HasValue() ? mMinornumber.Value() : 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads the ChannelList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, + "Step 2: TH sends a ChangeChannelByNumber command to the DUT with channel information (major and minor " + "numbers) from the list in step 1"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = mMajornumber.HasValue() ? mMajornumber.Value() : 9U; + value.minorNumber = mMinornumber.HasValue() ? mMinornumber.Value() : 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 2a: Verify that the channel has changed on the device"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CHANNEL.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if channel has changed on the devicegarbage: not in length on purpose", 53); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 3: TH reads the CurrentChannel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0002 && CHANNEL.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CHANNEL_5_3Suite : public TestCommand +{ +public: + Test_TC_CHANNEL_5_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CHANNEL_5_3", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("majornumber", 0, UINT16_MAX, &mMajornumber); + AddArgument("minornumber", 0, UINT16_MAX, &mMinornumber); + AddArgument("majornumber2", 0, UINT16_MAX, &mMajornumber2); + AddArgument("minornumber2", 0, UINT16_MAX, &mMinornumber2); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CHANNEL_5_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mMajornumber; + chip::Optional mMinornumber; + chip::Optional mMajornumber2; + chip::Optional mMinornumber2; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, + mMajornumber.HasValue() ? mMajornumber.Value() : 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, + mMinornumber.HasValue() ? mMinornumber.Value() : 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, + mMajornumber2.HasValue() ? mMajornumber2.Value() : 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, + mMinornumber2.HasValue() ? mMinornumber2.Value() : 1U)); + VerifyOrReturn(CheckConstraintType("value", "ChannelInfoStruct", "ChannelInfoStruct")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH reads the Lineup attribute from the DUT to show list of Inputs available and Verify that the " + "response contains a lineup info object"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::Lineup::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH reads the ChannelList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH reads the CurrentChannel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH sends a SkipChannel command to the DUT with a value of 1"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 4a: Verify that the channel has changed on the device"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CHANNEL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if channel has changed on the devicegarbage: not in length on purpose", 53); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 5: TH reads the CurrentChannel attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CHANNEL.S.A0002 && CHANNEL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAPLAYBACK_6_1Suite : public TestCommand +{ +public: + Test_TC_MEDIAPLAYBACK_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAPLAYBACK_6_1", 12, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAPLAYBACK_6_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 1U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 2U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Media content in a paused state at the beginning of the content"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Pause::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1: Reads the CurrentState attribute"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C01.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2: Sends a Play command"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Play::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Play::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify that the media state is playing"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if media state is playinggarbage: not in length on purpose", 42); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 3: Reads the CurrentState attribute"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4: sends a Pause command"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Pause::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Verify that the media is paused"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if media state is pausedgarbage: not in length on purpose", 41); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 5: Reads the CurrentState attribute"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp && MEDIAPLAYBACK.S.A0000"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 6: Sends a Stop command"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Stop::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Stop::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Verify that the media is stoped"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if media state is stopedgarbage: not in length on purpose", 41); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 7: Reads the CurrentState attribute"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C02.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAPLAYBACK_6_2Suite : public TestCommand +{ +public: + Test_TC_MEDIAPLAYBACK_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAPLAYBACK_6_2", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAPLAYBACK_6_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("sampledPosition", value)); + VerifyOrReturn(CheckValueNonNull("sampledPosition.Value().position", value.Value().position)); + VerifyOrReturn(CheckValue("sampledPosition.Value().position.Value()", value.Value().position.Value(), 10000ULL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("sampledPosition", value)); + VerifyOrReturn(CheckValueNonNull("sampledPosition.Value().position", value.Value().position)); + VerifyOrReturn(CheckValue("sampledPosition.Value().position.Value()", value.Value().position.Value(), 0ULL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Media content in a paused state at the beginning of the content"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Pause::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1: Reads the CurrentState attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C01.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2: Sends a Play command to the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Play::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Play::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify that the media state is playing"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if media state is playinggarbage: not in length on purpose", 42); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 3: Reads the CurrentState attribute"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4: Sends a StartOver command to the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::StartOver::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::StartOver::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Verify that the media is started over"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if media is started overgarbage: not in length on purpose", 41); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 5: Sends a Next command to the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Next::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Next::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Verify that the next media item in the queue has been loaded"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media item in the queue has been loadedgarbage: not in length on purpose", 59); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 6: Sends a Previous command to the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Previous::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Previous::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Verify that the previous media item in the queue has been loaded"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if previous media item in the queue has been loadedgarbage: not in length on purpose", 68); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 7: Sends a SkipForward command to the DUT "); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type value; + value.deltaPositionMilliseconds = 10000ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::SkipForward::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Verify that the media has skipped forward 10 seconds"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media has skipped forward 10 secondsgarbage: not in length on purpose", 56); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 8: Reads the SampledPosition attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C08.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::SampledPosition::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 9: Sends a SkipBackward command to the DUT "); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C09.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type value; + value.deltaPositionMilliseconds = 10000ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::SkipBackward::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Verify that the media has skipped backward 10 seconds"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C09.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media has skipped backward 10 secondsgarbage: not in length on purpose", 57); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 10: Reads the SampledPosition attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C09.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::SampledPosition::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAPLAYBACK_6_3Suite : public TestCommand +{ +public: + Test_TC_MEDIAPLAYBACK_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAPLAYBACK_6_3", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("SeekPosition", 0, UINT64_MAX, &mSeekPosition); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAPLAYBACK_6_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mSeekPosition; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("sampledPosition", value)); + VerifyOrReturn(CheckValueNonNull("sampledPosition.Value().position", value.Value().position)); + VerifyOrReturn(CheckValue("sampledPosition.Value().position.Value()", value.Value().position.Value(), 10000ULL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 5U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Media content in a paused state at the beginning of the content"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Pause::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1: TH sends a Seek command to the DUT with a Position value of 10000"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Seek::Type value; + value.position = 10000ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Seek::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Verify that the media has moved to 10 seconds from the starting point"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media has moved to 10 seconds from the starting pointgarbage: not in length on purpose", 73); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 2: TH reads the SampledPosition attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C0b.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::SampledPosition::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3: TH reads the StartTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0001 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4: TH reads the SeekRangeEnd attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 5: TH reads the SeekRangeStart attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 6: TH reads the Duration attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 7: TH sends a Seek command to the DUT with a Position value beyond the furthest valid position (ex: " + "beyond the duration of the media)"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Seek::Type value; + value.position = mSeekPosition.HasValue() ? mSeekPosition.Value() : 100000000ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Seek::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "verify that the media has not moved."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if media has not movedgarbage: not in length on purpose", 39); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAPLAYBACK_6_4Suite : public TestCommand +{ +public: + Test_TC_MEDIAPLAYBACK_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAPLAYBACK_6_4", 23, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAPLAYBACK_6_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, 0.0f)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, 1.0f)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, 2.0f)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 0U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, -1.0f)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, -2.0f)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, 1.0f)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Media content in a paused state at the beginning of the content"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Pause::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1: Reads the CurrentState attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C01.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2: Reads the PlaybackSpeed attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C01.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3: Sends a FastForward command"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::FastForward::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "verify that the media state is playing"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if media state is playinggarbage: not in length on purpose", 42); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4: Reads the CurrentState attribute"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C07.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: Reads the PlaybackSpeed attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C07.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6: Sends a FastForward command"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::FastForward::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "verify that the media play speed has increased."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if media play speed has increased.garbage: not in length on purpose", 51); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 7: Reads the PlaybackSpeed attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C07.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 8: Sends a Rewind command to the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Rewind::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "verify that the media play has reversed direction."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media play has reversed directiongarbage: not in length on purpose", 53); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 9: Reads the CurrentState attribute"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C06.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 10: Reads the PlaybackSpeed attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 11: Sends a Rewind command to the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Rewind::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "verify that the media play speed has increased in the reverse direction."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media play speed has increased in the reverse directiongarbage: not in length on purpose", 75); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 12: Reads the PlaybackSpeed attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 13: Sends a Play command"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Play::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Commands::Play::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "verify that the media is has resumed playing forward at the default speed."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media is has resumed playing forward at the default speedgarbage: not in length on purpose", + 77); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 14: Reads the PlaybackSpeed attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 15: Sends consecutive FastForward commands"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 22: { + LogStep(22, "Step 16: Sends consecutive Rewind commands"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_AUDIOOUTPUT_7_1Suite : public TestCommand +{ +public: + Test_TC_AUDIOOUTPUT_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_AUDIOOUTPUT_7_1", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Index", 0, UINT8_MAX, &mIndex); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_AUDIOOUTPUT_7_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mIndex; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentOutput", value, mIndex.HasValue() ? mIndex.Value() : 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Reads the OutputList attribute"); + VerifyOrDo(!ShouldSkip("AUDIOOUTPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::OutputList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Sends a SelectAudioOutput command"); + VerifyOrDo(!ShouldSkip("AUDIOOUTPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type value; + value.index = mIndex.HasValue() ? mIndex.Value() : 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Commands::SelectOutput::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3: Reads the CurrentOutput attribute"); + VerifyOrDo(!ShouldSkip("AUDIOOUTPUT.S.A0001 && AUDIOOUTPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::CurrentOutput::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_AUDIOOUTPUT_7_2Suite : public TestCommand +{ +public: + Test_TC_AUDIOOUTPUT_7_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_AUDIOOUTPUT_7_2", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Index", 0, UINT8_MAX, &mIndex); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_AUDIOOUTPUT_7_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mIndex; + chip::Optional mTimeout; + + chip::app::DataModel::DecodableList + audioOutputListValues; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + audioOutputListValues = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads the OutputList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("AUDIOOUTPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::OutputList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep( + 2, + "Step 2: TH sends a RenameOutput command to the DUT with an index from the list in step 1 and the name 'CertTest'"); + VerifyOrDo(!ShouldSkip("AUDIOOUTPUT.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type value; + value.index = mIndex.HasValue() ? mIndex.Value() : 1U; + value.name = chip::Span("CertTestgarbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Commands::RenameOutput::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 3: TH reads the OutputList attribute from the DUT. Verify that the output at the index provided in step " + "2 has the name CertTest"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && AUDIOOUTPUT.S.A0001 && AUDIOOUTPUT.S.C01.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TGTNAV_8_1Suite : public TestCommand +{ +public: + Test_TC_TGTNAV_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TGTNAV_8_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("targetvalue", 0, UINT8_MAX, &mTargetvalue); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TGTNAV_8_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTargetvalue; + chip::Optional mTimeout; + + chip::app::DataModel::DecodableList + TargetListValues; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + TargetListValues = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentTarget", value, mTargetvalue.HasValue() ? mTargetvalue.Value() : 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: Reads the CurrentTarget attribute"); + VerifyOrDo(!ShouldSkip("TGTNAV.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::CurrentTarget::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: Reads the TargetList attribute"); + VerifyOrDo(!ShouldSkip("TGTNAV.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, TargetNavigator::Attributes::TargetList::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2a: Sends a NavigateTarget command"); + VerifyOrDo(!ShouldSkip("TGTNAV.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type value; + value.target = mTargetvalue.HasValue() ? mTargetvalue.Value() : 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, TargetNavigator::Commands::NavigateTarget::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 2b: Reads the CurrentTarget attribute"); + VerifyOrDo(!ShouldSkip("TGTNAV.S.A0001 && TGTNAV.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::CurrentTarget::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APBSC_9_1Suite : public TestCommand +{ +public: + Test_TC_APBSC_9_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_APBSC_9_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APBSC_9_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "vendor_id", "vendor_id")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 256)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "ApplicationStruct", "ApplicationStruct")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: Reads the VendorName attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::VendorName::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Reads the VendorID attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: Reads the ApplicationName attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::ApplicationName::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: Reads the ProductID attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::ProductID::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: Reads the Application attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::Application::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: Reads the Status attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::Status::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: Reads the ApplicationVersion attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::ApplicationVersion::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 8: Reads the AllowedVendorList attribute"); + VerifyOrDo(!ShouldSkip("APBSC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AllowedVendorList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_1Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_10_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_1", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_10_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads the AcceptHeader attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Attributes::AcceptHeader::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH reads the SupportedStreamingProtocols attribute from the DUT"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::SupportedStreamingProtocols::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WAKEONLAN_4_1Suite : public TestCommand +{ +public: + Test_TC_WAKEONLAN_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WAKEONLAN_4_1", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WAKEONLAN_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 12)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads the MACAddress attribute from the DUT"); + VerifyOrDo(!ShouldSkip("WAKEONLAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::MACAddress::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH sends a Sleep command to DUT"); + VerifyOrDo(!ShouldSkip("LOWPOWER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LowPower::Commands::Sleep::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Commands::Sleep::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3: TH sends a Wake-On LAN magic packet containing the MAC address from step 1"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ALOGIN_12_1Suite : public TestCommand +{ +public: + Test_TC_ALOGIN_12_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ALOGIN_12_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("TempAccountIdentifier", &mTempAccountIdentifier); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ALOGIN_12_1Suite() + { + if (setupPINBuffer != nullptr) + { + chip::Platform::MemoryFree(setupPINBuffer); + setupPINBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTempAccountIdentifier; + chip::Optional mCatalogVendorId; + chip::Optional mApplicationId; + chip::Optional mTimeout; + + char * setupPINBuffer = nullptr; + chip::CharSpan setupPIN; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (setupPINBuffer != nullptr) + { + chip::Platform::MemoryFree(setupPINBuffer); + } + setupPINBuffer = static_cast(chip::Platform::MemoryAlloc(value.setupPIN.size())); + memcpy(setupPINBuffer, value.setupPIN.data(), value.setupPIN.size()); + setupPIN = chip::CharSpan(setupPINBuffer, value.setupPIN.size()); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Launch an app with the provided a application ID"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); + + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + value.data.Emplace(); + value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("Hello Worldgarbage: not in length on purpose"), 11); + return SendCommand(kIdentityAlpha, GetEndpoint(3), ApplicationLauncher::Id, + ApplicationLauncher::Commands::LaunchApp::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1: TH sends a GetSetupPIN command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type value; + value.tempAccountIdentifier = + mTempAccountIdentifier.HasValue() ? mTempAccountIdentifier.Value() : chip::Span("1111", 4); + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::GetSetupPIN::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 2: TH sends a Login command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Login::Type value; + value.tempAccountIdentifier = + mTempAccountIdentifier.HasValue() ? mTempAccountIdentifier.Value() : chip::Span("1111", 4); + value.setupPIN = setupPIN; + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Login::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3: TH sends a Logout command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Logout::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Logout::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_3Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_3", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("data", &mData); + AddArgument("SearchValue", &mSearchValue); + AddArgument("ExternalIdName", &mExternalIdName); + AddArgument("ExternalIdValue", &mExternalIdValue); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_10_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mData; + chip::Optional mSearchValue; + chip::Optional mExternalIdName; + chip::Optional mExternalIdValue; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set " + "to false"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(0); + listHolder_1->mList[0].value = + mSearchValue.HasValue() ? mSearchValue.Value() : chip::Span("exampleValue", 12); + listHolder_1->mList[0].externalIDList.Emplace(); + + { + auto * listHolder_4 = + new ListHolder(1); + listFreer.add(listHolder_4); + + listHolder_4->mList[0].name = + mExternalIdName.HasValue() ? mExternalIdName.Value() : chip::Span("name", 4); + listHolder_4->mList[0].value = + mExternalIdValue.HasValue() ? mExternalIdValue.Value() : chip::Span("value", 5); + + listHolder_1->mList[0].externalIDList.Value() = + chip::app::DataModel::List( + listHolder_4->mList, 1); + } + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = false; + value.data.Emplace(); + value.data.Value() = mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Verify that DUT present via its user interface a list of matches based on the provided search criteria."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if DUT present via its user interface a list of matches based " + "on the provided search criteria.garbage: not in length on purpose", + 111); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, + "Step 2: TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set " + "to true"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(0); + listHolder_1->mList[0].value = + mSearchValue.HasValue() ? mSearchValue.Value() : chip::Span("exampleValue", 12); + listHolder_1->mList[0].externalIDList.Emplace(); + + { + auto * listHolder_4 = + new ListHolder(1); + listFreer.add(listHolder_4); + + listHolder_4->mList[0].name = + mExternalIdName.HasValue() ? mExternalIdName.Value() : chip::Span("name", 4); + listHolder_4->mList[0].value = + mExternalIdValue.HasValue() ? mExternalIdValue.Value() : chip::Span("value", 5); + + listHolder_1->mList[0].externalIDList.Value() = + chip::app::DataModel::List( + listHolder_4->mList, 1); + } + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + value.data.Emplace(); + value.data.Value() = mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify that DUT should also begin playing content that best matched the given search criteria"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if DUT begin playing content that best matched the given " + "search criteriagarbage: not in length on purpose", + 89); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("GoodURL", &mGoodURL); + AddArgument("BadURL", &mBadURL); + AddArgument("UnauthorizedURL", &mUnauthorizedURL); + AddArgument("DisplayContent", &mDisplayContent); + AddArgument("providerNameString", &mProviderNameString); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_10_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mGoodURL; + chip::Optional mBadURL; + chip::Optional mUnauthorizedURL; + chip::Optional mDisplayContent; + chip::Optional mProviderNameString; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + mDisplayContent.HasValue() ? mDisplayContent.Value() + : chip::Span("exampleData", 11))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH sends a LaunchURL command to the DUT with a known good content URL string"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span("https://csa-iot.org/", 20); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Verify that DUT launched the content at the given URL"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT launched the content at the given URLgarbage: not in length on purpose", 61); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH sends a LaunchURL command to the DUT with a known good content URL string and a display string"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span("https://csa-iot.org/", 20); + value.displayString.Emplace(); + value.displayString.Value() = + mDisplayContent.HasValue() ? mDisplayContent.Value() : chip::Span("exampleData", 11); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, + "Verify that DUT launched the content at the given URL with the given display string in the " + "application-specific description area"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if DUT launched the content at the given URL with the given display " + "string in the application-specific description areagarbage: not in length on purpose", + 136); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 3: TH sends a LaunchURL command to the DUT with a known good content URL string and a brand information " + "object."); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span("https://csa-iot.org/", 20); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, + "Verify that DUT launched the content at the given URL with the player interface updated as per the provided " + "branding information"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if DUT launched the content at the given URL with the player interface " + "updated as per the provided branding informationgarbage: not in length on purpose", + 136); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 4: TH sends a LaunchURL command to the DUT with a known unreachable content URL string."); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mBadURL.HasValue() ? mBadURL.Value() : chip::Span("https://badurl", 14); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 5: TH sends a LaunchURL command to the DUT with a known un-authorized content URL string."); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = + mUnauthorizedURL.HasValue() ? mUnauthorizedURL.Value() : chip::Span("https://csa-iot.org/badauth", 27); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 27, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("PopularityName", &mPopularityName); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_10_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mPopularityName; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Actor and " + "Value as An Actor’s name, for example, Gaby sHoffman"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(0); + listHolder_1->mList[0].value = chip::Span("Gaby sHoffmangarbage: not in length on purpose", 13); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, + "Step 2: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Channel and " + "Value as Channel Name name, for example, PBS"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(1); + listHolder_1->mList[0].value = chip::Span("PBSgarbage: not in length on purpose", 3); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 3: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Character and " + "Value as Character’s name,for example,Snow White"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(2); + listHolder_1->mList[0].value = chip::Span("Snow Whitegarbage: not in length on purpose", 10); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = false; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 4: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Director and " + "Value as Director’s name, for example, Spike Lee"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(3); + listHolder_1->mList[0].value = chip::Span("Spike Leegarbage: not in length on purpose", 9); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 5: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Event and " + "Value as An Event’s name , for example Football games"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(4); + listHolder_1->mList[0].value = chip::Span("Football gamesgarbage: not in length on purpose", 14); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, + "Step 6: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Franchise and " + "Value as Franchise’s name,for example Star Wars"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(5); + listHolder_1->mList[0].value = chip::Span("Star Warsgarbage: not in length on purpose", 9); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, + "Step 7: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Genre and " + "Value as Genre’s name, for example Horror"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(6); + listHolder_1->mList[0].value = chip::Span("Horrorgarbage: not in length on purpose", 6); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, + "Step 8: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As League and " + "Value as League’s name, for example NCAA"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(7); + listHolder_1->mList[0].value = chip::Span("NCAAgarbage: not in length on purpose", 4); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, + "Step 9: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Popularity " + "and Value as Popularity’s name"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(8); + listHolder_1->mList[0].value = + mPopularityName.HasValue() ? mPopularityName.Value() : chip::Span("popular content", 15); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, + "Step 10: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Provider and " + "Value as Provider’s name, for example Netflix"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(9); + listHolder_1->mList[0].value = chip::Span("Netflixgarbage: not in length on purpose", 7); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 21: { + LogStep(21, + "Step 11: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Sport and " + "Value as Sport’s name, for example, football"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(10); + listHolder_1->mList[0].value = chip::Span("footballgarbage: not in length on purpose", 8); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, + "Step 12: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As SportsTeam " + "and Value as SportTeam’s name , for example Arsenel"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(11); + listHolder_1->mList[0].value = chip::Span("Arsenelgarbage: not in length on purpose", 7); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 25: { + LogStep(25, + "Step 13: TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Type and " + "Value as Type’s name, for example TVSeries"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(12); + listHolder_1->mList[0].value = chip::Span("TVSeriesgarbage: not in length on purpose", 8); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MOD_1_1Suite : public TestCommand +{ +public: + Test_TC_MOD_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_1", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MOD_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap attribute from the DUT"); + VerifyOrDo(!ShouldSkip("MOD.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: TH reads the FeatureMap attribute from the DUT"); + VerifyOrDo(!ShouldSkip(" !MOD.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: TH reads the optional attribute(StartUpMode) in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("MOD.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4c: TH reads the optional attribute(OnMode) in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("MOD.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 4d: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 5a: TH reads from the DUT the EventList attribute"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 6a: TH reads AcceptedCommandList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 7a: TH reads GeneratedCommandList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class OTA_SuccessfulTransferSuite : public TestCommand +{ +public: + OTA_SuccessfulTransferSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("OTA_SuccessfulTransfer", 11, credsIssuerConfig) + { + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("requestorNodeId", 0, UINT64_MAX, &mRequestorNodeId); + AddArgument("providerNodeId", 0, UINT64_MAX, &mProviderNodeId); + AddArgument("providerPayload", &mProviderPayload); + AddArgument("providerDiscriminator", 0, UINT16_MAX, &mProviderDiscriminator); + AddArgument("providerPort", 0, UINT16_MAX, &mProviderPort); + AddArgument("providerKvs", &mProviderKvs); + AddArgument("otaImageFilePath", &mOtaImageFilePath); + AddArgument("rawImageFilePath", &mRawImageFilePath); + AddArgument("rawImageContent", &mRawImageContent); + AddArgument("downloadImageFilePath", &mDownloadImageFilePath); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~OTA_SuccessfulTransferSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mEndpoint; + chip::Optional mRequestorNodeId; + chip::Optional mProviderNodeId; + chip::Optional mProviderPayload; + chip::Optional mProviderDiscriminator; + chip::Optional mProviderPort; + chip::Optional mProviderKvs; + chip::Optional mOtaImageFilePath; + chip::Optional mRawImageFilePath; + chip::Optional mRawImageContent; + chip::Optional mDownloadImageFilePath; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Create OTA image"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::CreateOtaImage::Type value; + value.otaImageFilePath = + mOtaImageFilePath.HasValue() ? mOtaImageFilePath.Value() : chip::Span("/tmp/otaImage", 13); + value.rawImageFilePath = + mRawImageFilePath.HasValue() ? mRawImageFilePath.Value() : chip::Span("/tmp/rawImage", 13); + value.rawImageContent = + mRawImageContent.HasValue() ? mRawImageContent.Value() : chip::Span("Have a hootenanny!", 18); + return CreateOtaImage(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Start the provider with an image"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("chip-ota-provider-appgarbage: not in length on purpose", 21); + value.discriminator.Emplace(); + value.discriminator.Value() = mProviderDiscriminator.HasValue() ? mProviderDiscriminator.Value() : 50U; + value.port.Emplace(); + value.port.Value() = mProviderPort.HasValue() ? mProviderPort.Value() : 5560U; + value.kvs.Emplace(); + value.kvs.Value() = + mProviderKvs.HasValue() ? mProviderKvs.Value() : chip::Span("/tmp/chip_kvs_provider", 22); + value.filepath.Emplace(); + value.filepath.Value() = + mOtaImageFilePath.HasValue() ? mOtaImageFilePath.Value() : chip::Span("/tmp/otaImage", 13); + return Start(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Commission the provider from alpha"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mProviderNodeId.HasValue() ? mProviderNodeId.Value() : 12648430ULL; + value.payload = + mProviderPayload.HasValue() ? mProviderPayload.Value() : chip::Span("MT:-24J0IX4122-.548G00", 22); + return PairWithCode(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Wait for the commissioned provider to be retrieved for alpha"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mProviderNodeId.HasValue() ? mProviderNodeId.Value() : 12648430ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Install ACL for QueryImage"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 41UL; + listHolder_3->mList[0].endpoint.SetNull(); + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Stop the requestor"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Start the requestor with an OTA download path"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.otaDownloadPath.Emplace(); + value.otaDownloadPath.Value() = mDownloadImageFilePath.HasValue() ? mDownloadImageFilePath.Value() + : chip::Span("/tmp/downloadedImage", 20); + return Start(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Wait for the commissioned requestor to be retrieved for alpha"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mRequestorNodeId.HasValue() ? mRequestorNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Send an announce OTA provider command to the requestor"); + ListFreer listFreer; + chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOTAProvider::Type value; + value.providerNodeID = mProviderNodeId.HasValue() ? mProviderNodeId.Value() : 12648430ULL; + value.vendorID = static_cast(0); + value.announcementReason = static_cast(0); + value.endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OtaSoftwareUpdateRequestor::Id, + OtaSoftwareUpdateRequestor::Commands::AnnounceOTAProvider::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Wait for transfer complete message"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMessage::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("defaultgarbage: not in length on purpose", 7); + value.message = chip::Span("OTA image downloadedgarbage: not in length on purpose", 20); + return WaitForMessage(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Compare original file to downloaded file"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::CompareFiles::Type value; + value.file1 = mRawImageFilePath.HasValue() ? mRawImageFilePath.Value() : chip::Span("/tmp/rawImage", 13); + value.file2 = mDownloadImageFilePath.HasValue() ? mDownloadImageFilePath.Value() + : chip::Span("/tmp/downloadedImage", 20); + return CompareFiles(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OCC_1_1Suite : public TestCommand +{ +public: + Test_TC_OCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_1_1", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OCC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OCC_2_1Suite : public TestCommand +{ +public: + Test_TC_OCC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_1", 13, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OCC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Reads mandatory attribute constrains: Occupancy"); + VerifyOrDo(!ShouldSkip("OCC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::Occupancy::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Reads mandatory attribute constrains: OccupancySensorType"); + VerifyOrDo(!ShouldSkip("OCC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::OccupancySensorType::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Reads mandatory attribute constrains: OccupancySensorTypeBitmap"); + VerifyOrDo(!ShouldSkip("OCC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Reads optional attribute: PIROccupiedToUnoccupiedDelay"); + VerifyOrDo(!ShouldSkip("OCC.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::PIROccupiedToUnoccupiedDelay::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: Reads optional attribute constrains: PIRUnoccupiedToOccupiedDelay"); + VerifyOrDo(!ShouldSkip("OCC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::PIRUnoccupiedToOccupiedDelay::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: Reads optional attribute constrains: PIRUnoccupiedToOccupiedThreshold"); + VerifyOrDo(!ShouldSkip("OCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::PIRUnoccupiedToOccupiedThreshold::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: Read optional attribute: UltrasonicOccupiedToUnoccupiedDelay"); + VerifyOrDo(!ShouldSkip("OCC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: Read attribute: UltrasonicUnoccupiedToOccupiedDelay"); + VerifyOrDo(!ShouldSkip("OCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: Read attribute: UltrasonicUnoccupiedToOccupiedThreshold"); + VerifyOrDo(!ShouldSkip("OCC.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: Reads optional attribute constrains: PhysicalContactOccupiedToUnoccupiedDelay"); + VerifyOrDo(!ShouldSkip("OCC.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 12: Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedDelay"); + VerifyOrDo(!ShouldSkip("OCC.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedThreshold"); + VerifyOrDo(!ShouldSkip("OCC.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OCC_2_3Suite : public TestCommand +{ +public: + Test_TC_OCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_3", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OCC_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Reads mandatory attribute constrains: OccupancySensorType"); + VerifyOrDo(!ShouldSkip("OCC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::OccupancySensorType::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Reads mandatory attribute constrains: OccupancySensorTypeBitmap"); + VerifyOrDo(!ShouldSkip("OCC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OO_1_1Suite : public TestCommand +{ +public: + Test_TC_OO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_1_1", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OO_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16384UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16385UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16386UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16387UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 66UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("( !OO.S.F00 && !OO.S.F01 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given OO.S.F00(LT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given OO.S.F01(DF) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4b: Read the feature dependent(OO.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("OO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 4c: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 6b: Read the feature dependent(OO.S.F00) commands in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 6c: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OO_2_1Suite : public TestCommand +{ +public: + Test_TC_OO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_2_1", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OO_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute: OnOff"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read LT attribute: GlobalSceneControl"); + VerifyOrDo(!ShouldSkip("OO.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read LT attribute: OnTime"); + VerifyOrDo(!ShouldSkip("OO.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Read LT attribute: OffWaitTime"); + VerifyOrDo(!ShouldSkip("OO.S.A4002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: Read LT attribute: StartUpOnOff"); + VerifyOrDo(!ShouldSkip("OO.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OO_2_2Suite : public TestCommand +{ +public: + Test_TC_OO_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_2_2", 23, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OO_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: Send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 2b: Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3b: Check on/off attribute value is true after on command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3c: Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 3d: Check on/off attribute value is true after on command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4a: Send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 4b: Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4c: Send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 4d: Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 5c: Send Toggle Command"); + VerifyOrDo(!ShouldSkip("OO.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Toggle::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Toggle::Id, value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 5d: Check on/off attribute value is true after toggle command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Send Toggle Command"); + VerifyOrDo(!ShouldSkip("OO.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Toggle::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Toggle::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Check on/off attribute value is false after toggle command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 6a: Operate on device to set OnOff attribute manually to on"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && OO.M.ManuallyControlled && OO.S.A0000"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 6b: Check on/off attribute value is true after on command"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && OO.S.A0000 && OO.M.ManuallyControlled"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 6c: Operate on device to set OnOff attribute manually to off"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && OO.M.ManuallyControlled && OO.S.A0000"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 6d: Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && OO.S.A0000 && OO.M.ManuallyControlled"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Reset Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OO_2_4Suite : public TestCommand +{ +public: + Test_TC_OO_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_2_4", 32, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OO_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 3a: TH writes a value of 0 to StartUpOnOff attribute of DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Reboot target device"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 3c: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 3d: TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4a: TH writes a value of 1 to StartUpOnOff attribute of DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4b: Reboot target device"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 4c: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 4d: TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 5a: TH writes a value of 2 to StartUpOnOff attribute of DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 5b: Reboot target device"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 5c: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 5d: TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 5e: Reboot target device"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 5f: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 5g: TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 6a: TH writes NULL to StartUpOnOff attribute of DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 6b: Reboot target device"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 6c: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Step 6d: TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 6e: TH sends Off command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Step 6f: TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 6g: Reboot target device"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 29: { + LogStep(29, "Step 6h: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 6i: TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPSTATE_1_1Suite : public TestCommand +{ +public: + Test_TC_OPSTATE_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPSTATE_1_1", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPSTATE_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 4c: TH reads AttributeList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 5a: TH reads from the DUT the EventList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 5b: TH reads from the DUT the optional event(OperationCompletion) in EventList."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && OPSTATE.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 5c: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 6a: Read the optional command(Start) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 6b: Read the optional command(Stop) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 6c: Read the optional command(Pause) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 6d: Read the optional command(Resume) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 6e: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 7a: Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("!OPSTATE.S.C00 || !OPSTATE.S.C01 || !OPSTATE.S.C02 || !OPSTATE.S.C03"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 7a: Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("(OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || OPSTATE.S.C03)"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPSTATE_2_4Suite : public TestCommand +{ +public: + Test_TC_OPSTATE_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPSTATE_2_4", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPSTATE_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + switch (mTestSubStepIndex) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 3)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Set up a subscription to the OperationalError event"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 0; + return SubscribeEvent(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Events::OperationalError::Id, 100, 5000, false, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: At the DUT take the vendor defined action to generate an OperationalError event"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.E00 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the OperationalState attribute"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.A0004 && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PS_1_1Suite : public TestCommand +{ +public: + Test_TC_PS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PS_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 31UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 31UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 25UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !PS.S.F00 && !PS.S.F01 && !PS.S.F02 && !PS.S.F03 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given PS.S.F00(WIRED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PS.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given PS.S.F01(BAT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PS.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3c: Given PS.S.F02(RECHG) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PS.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3d: Given PS.S.F03(REPLC) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PS.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4a: Read the Feature dependent(PS.S.F00-WIRED) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("PS.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4b: Read the Feature dependent(PS.S.F01-BAT) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("PS.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4c: Read the Feature dependent(PS.S.F02-RECHG) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("PS.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4d: Read the Feature dependent(PS.S.F03-REPLC) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("PS.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 5: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 6: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 7a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && !PS.S.E00 && !PS.S.E01 && !PS.S.E02 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 7b: Read PS.S.E00(WiredFaultChange) event in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PS.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 7c: Read PS.S.E01(BatFaultChange) event in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PS.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 7d: Read PS.S.E02(BatChargeFaultChange) event in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PS.S.E02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 7e: Read EventList attribute from the DUT.For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PS_2_1Suite : public TestCommand +{ +public: + Test_TC_PS_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_1", 33, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PS_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PowerSource::PowerSourceStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 60)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PowerSource::WiredCurrentTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 8)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 200U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PowerSource::BatChargeLevelEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PowerSource::BatReplaceabilityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 8)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 60)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PowerSource::BatCommonDesignationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum16", "enum16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 80U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 20)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 20)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PowerSource::BatApprovedChemistryEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum16", "enum16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PowerSource::BatChargeStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 16)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Test Harness Client reads Status attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Status::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Test Harness Client reads Order attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Order::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Test Harness Client reads Description attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Description::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Test Harness Client reads WiredAssessedInputVoltage attribue from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::WiredAssessedInputVoltage::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: Test Harness Client reads WiredAssessedInputFrequency attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::WiredAssessedInputFrequency::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: Test Harness Client reads WiredCurrentType attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredCurrentType::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: Test Harness Client reads WiredAssessedCurrent attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredAssessedCurrent::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: Test Harness Client reads WiredNominalVoltage from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredNominalVoltage::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: Test Harness Client reads WiredMaximumCurrent from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredMaximumCurrent::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: Test Harness Client reads WiredPresent from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredPresent::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 12: Test Harness Client reads ActiveWiredFaults from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ActiveWiredFaults::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: Test Harness Client reads BatVoltage from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatVoltage::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 14: Test Harness Client reads BatPercentRemaining from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatPercentRemaining::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 15: Test Harness Client reads BatTimeRemaining from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatTimeRemaining::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 16: Test Harness Client reads BatChargeLevel from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatChargeLevel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 17: Test Harness Client reads BatReplacementNeeded from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatReplacementNeeded::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 18: Test Harness Client reads BatReplaceability from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatReplaceability::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 19: Test Harness Client reads BatPresent from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatPresent::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Step 20: Test Harness Client readsActiveBatFaults from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ActiveBatFaults::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 21: Test Harness Client reads BatReplacementDescription from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatReplacementDescription::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 22: Test Harness Client reads BatCommonDesignation from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatCommonDesignation::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 23: Test Harness Client reads BatANSIDesignation from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatANSIDesignation::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 24: Test Harness Client reads BatIECDesignation from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatIECDesignation::Id, + true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 25: Test Harness Client reads BatApprovedChemistry from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatApprovedChemistry::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 26: Test Harness Client reads BatCapacity from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatCapacity::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Step 27: Test Harness Client reads BatQuantity from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatQuantity::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Step 28: Test Harness Client reads BatChargeState from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatChargeState::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 29: Test Harness Client reads BatTimeToFullCharge from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatTimeToFullCharge::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 30: Test Harness Client reads BatFunctionalWhileCharging from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A001c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatFunctionalWhileCharging::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Step 31: Test Harness Client reads BatChargingCurrent from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A001d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatChargingCurrent::Id, + true, chip::NullOptional); + } + case 31: { + LogStep(31, "Step 32: Test Harness Client reads ActiveBatChargeFaults from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A001e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::ActiveBatChargeFaults::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "Step 33: Test Harness Client reads EndpointList from Server DUT"); + VerifyOrDo(!ShouldSkip("PS.S.A001f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::EndpointList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PRS_1_1Suite : public TestCommand +{ +public: + Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_1_1", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PRS_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !PRS.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: Given PRS.S.F00(EXT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PRS.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global mandatory attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: Read the global mandatory attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: Read the optional attribute(ScaledValue) in AttributeList"); + VerifyOrDo(!ShouldSkip("PRS.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4c: Read the optional attribute(MinScaledValue) in AttributeList"); + VerifyOrDo(!ShouldSkip("PRS.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4d: Read the optional attribute(MaxScaledValue) in AttributeList"); + VerifyOrDo(!ShouldSkip("PRS.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4e: Read the optional attribute(Scale) in AttributeList"); + VerifyOrDo(!ShouldSkip("PRS.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4f: Read the optional attribute(Tolerance) in AttributeList"); + VerifyOrDo(!ShouldSkip("PRS.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4g: Read the optional attribute(ScaledTolerance) in AttributeList"); + VerifyOrDo(!ShouldSkip("PRS.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 4h: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, + "Step 5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PRS_2_1Suite : public TestCommand +{ +public: + Test_TC_PRS_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PRS_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + chip::app::DataModel::Nullable MinScaledValue; + chip::app::DataModel::Nullable MaxScaledValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2048U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); + MinScaledValue = value; + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinScaledValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + MaxScaledValue = value; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinScaledValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxScaledValue)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2048U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8s", "int8s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -127)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute constraints: MinMeasuredValue"); + VerifyOrDo(!ShouldSkip("PRS.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the mandatory attribute constraints: MaxMeasuredValue"); + VerifyOrDo(!ShouldSkip("PRS.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the mandatory attribute constraints: MeasuredValue"); + VerifyOrDo(!ShouldSkip("PRS.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Read the optional attribute: Tolerance"); + VerifyOrDo(!ShouldSkip("PRS.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::Tolerance::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: Read the optional attribute: MinScaledValue"); + VerifyOrDo(!ShouldSkip("PRS.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::MinScaledValue::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: Read the optional attribute: MaxScaledValue"); + VerifyOrDo(!ShouldSkip("PRS.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::MaxScaledValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: Read the optional attribute: ScaledValue"); + VerifyOrDo(!ShouldSkip("PRS.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::ScaledValue::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: Read the optional attribute: ScaledTolerance"); + VerifyOrDo(!ShouldSkip("PRS.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::ScaledTolerance::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: Read the optional attribute: Scale"); + VerifyOrDo(!ShouldSkip("PRS.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::Scale::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PRS_2_2Suite : public TestCommand +{ +public: + Test_TC_PRS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_2", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PRS_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable ValueBeforeChange; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ValueBeforeChange = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, ValueBeforeChange)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the MeasuredValue attribute"); + VerifyOrDo(!ShouldSkip("PRS.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Operate on device to change the pressure significantly"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PRS.M.PressureChange"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Wait 2s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 4: After a few seconds, TH reads from the DUT the MeasuredValue attribute"); + VerifyOrDo(!ShouldSkip("PRS.S.A0000 && PRS.M.PressureChange"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PCC_1_1Suite : public TestCommand +{ +public: + Test_TC_PCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PCC_1_1", 50, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PCC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 64UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 32UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 32UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 21UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 22UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 33UL)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap attribute from the DUT"); + VerifyOrDo( + !ShouldSkip(" !PCC.S.F00 && !PCC.S.F01 && !PCC.S.F02 && !PCC.S.F03 && !PCC.S.F04 && !PCC.S.F05 && !PCC.S.F06 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given PCC.S.F00(PRSCONST) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PCC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given PCC.S.F01(PRSCOMP) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PCC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given PCC.S.F02(FLW) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PCC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given PCC.S.F03(SPD) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PCC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given PCC.S.F04(TEMP) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PCC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given PCC.S.F05(AUTO) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PCC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given PCC.S.F06(LOCAL) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PCC.S.F06"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4b: TH reads optional attribute(MinConstPressure) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4c TH reads optional attribute(MaxConstPressure) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4d: TH reads optional attribute(MinCompPressure) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4e: TH reads optional attribute(MaxCompPressure) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4f: TH reads optional attribute(MinConstSpeed) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4g: TH reads optional attribute(MaxConstSpeed) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4h: TH reads optional attribute(MinConstFlow) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4i: TH reads optional attribute(MaxConstFlow) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 4j: TH reads optional attribute(MinConstTemp) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 4k: TH reads optional attribute(MaxConstTemp) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 4l: TH reads optional attribute(PumpStatus) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 4m: TH reads optional attribute(Speed) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 4n: TH reads optional attribute(LifetimeRunningHours) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4o: TH reads optional attribute(Power) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4p: TH reads optional attribute(LifetimeEnergyConsumed) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4q: TH reads optional attribute(ControlMode) attribute in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, + "Step 4r: TH reads AttributeList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 29: { + LogStep(29, "Step 5a: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && !PCC.S.E00 && !PCC.S.E01 && !PCC.S.E02 && !PCC.S.E03 && !PCC.S.E04 " + "&& !PCC.S.E05 && !PCC.S.E06 && !PCC.S.E07 && !PCC.S.E08 && !PCC.S.E09 && !PCC.S.E0a && " + "!PCC.S.E0b && !PCC.S.E0c && !PCC.S.E0d && !PCC.S.E0e && !PCC.S.E0f && !PCC.S.E10 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Step 5b: TH reads from the DUT the EventList optional (SupplyVoltageLow)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "Step 5c: TH reads from the DUT the EventList optional (SupplyVoltageHigh)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "Step 5d: TH reads from the DUT the EventList optional (PowerMissingPhase)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, "Step 5e: TH reads from the DUT the EventList optional (SystemPressureLow)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 34: { + LogStep(34, "Step 5f: TH reads from the DUT the EventList optional (SystemPressureHigh)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 35: { + LogStep(35, "Step 5g: TH reads from the DUT the EventList optional (DryRunning)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 36: { + LogStep(36, "Step 5h: TH reads from the DUT the EventList optional (MotorTemperatureHigh)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E06"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 37: { + LogStep(37, "Step 5i: TH reads from the DUT the EventList optional (PumpMotorFatalFailure)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E07"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 38: { + LogStep(38, "Step 5j: TH reads from the DUT the EventList optional (ElectronicTemperatureHigh)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 39: { + LogStep(39, "Step 5k: TH reads from the DUT the EventList optional (PumpBlocked)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E09"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 40: { + LogStep(40, "Step 5l: TH reads from the DUT the EventList optional (SensorFailure)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 41: { + LogStep(41, "Step 5m: TH reads from the DUT the EventList optional (ElectronicNonFatalFailure)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E0b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 42: { + LogStep(42, "Step 5n: TH reads from the DUT the EventList optional (ElectronicFatalFailure)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E0c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 43: { + LogStep(43, "Step 5o: TH reads from the DUT the EventList optional (GeneralFault)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E0d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 44: { + LogStep(44, "Step 5p: TH reads from the DUT the EventList optional (Leakage)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E0e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 45: { + LogStep(45, "Step 5q: TH reads from the DUT the EventList optional (AirDetection)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E0f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 46: { + LogStep(46, "Step 5r: TH reads from the DUT the EventList optional (TurbineOperation)attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && PCC.S.E10"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 47: { + LogStep(47, + "Step 5s: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 48: { + LogStep(48, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 49: { + LogStep(49, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PCC_2_1Suite : public TestCommand +{ +public: + Test_TC_PCC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PCC_2_1", 24, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PCC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap16", "bitmap16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 8U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int24u", "int24u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 16777215UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int24u", "int24u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 16777215UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute: MaxPressure"); + VerifyOrDo(!ShouldSkip("PCC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxPressure::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the mandatory attribute: MaxSpeed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxSpeed::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the mandatory attribute: MaxFlow"); + VerifyOrDo(!ShouldSkip("PCC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxFlow::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Read the optional attribute: MinConstPressure"); + VerifyOrDo(!ShouldSkip("PCC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MinConstPressure::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: Read the optional attribute: MaxConstPressure"); + VerifyOrDo(!ShouldSkip("PCC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxConstPressure::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: Read the optional attribute: MinCompPressure"); + VerifyOrDo(!ShouldSkip("PCC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MinCompPressure::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: Read the optional attribute: MaxCompPressure"); + VerifyOrDo(!ShouldSkip("PCC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxCompPressure::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: Read the optional attribute: MinConstSpeed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MinConstSpeed::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: Read the optional attribute: MaxConstSpeed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: Read the optional attribute: MinConstFlow"); + VerifyOrDo(!ShouldSkip("PCC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MinConstFlow::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 12: Read the optional attribute: MaxConstFlow"); + VerifyOrDo(!ShouldSkip("PCC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxConstFlow::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: Read the optional attribute: MinConstTemp"); + VerifyOrDo(!ShouldSkip("PCC.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MinConstTemp::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 14: Read the optional attribute: MaxConstTemp"); + VerifyOrDo(!ShouldSkip("PCC.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::MaxConstTemp::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 15: Read the optional attribute: PumpStatus"); + VerifyOrDo(!ShouldSkip("PCC.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::PumpStatus::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 16: Read attribute: EffectiveOperationMode"); + VerifyOrDo(!ShouldSkip("PCC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 17: Read attribute: EffectiveControlMode"); + VerifyOrDo(!ShouldSkip("PCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 18: Read attribute: Capacity"); + VerifyOrDo(!ShouldSkip("PCC.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::Capacity::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 19: Read the optional attribute: Speed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::Speed::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 20: Read the optional attribute: LifetimeRunningHours"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 21: Read the optional attribute: Power"); + VerifyOrDo(!ShouldSkip("PCC.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::Power::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 22: Read the optional attribute: LifetimeEnergyConsumed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 23: Read optional attribute: OperationMode"); + VerifyOrDo(!ShouldSkip("PCC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::OperationMode::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 24: Read optional attribute: ControlMode"); + VerifyOrDo(!ShouldSkip("PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ControlMode::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PCC_2_2Suite : public TestCommand +{ +public: + Test_TC_PCC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PCC_2_2", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PCC_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveOperationMode", value, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveOperationMode", value, 1U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveOperationMode", value, 2U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveOperationMode", value, 3U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: TH write 0 (Normal) to the OperationMode attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::OperationMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2b: TH reads from the DUT the EffectiveOperationMode attribute"); + VerifyOrDo(!ShouldSkip("PCC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: TH write 1 (Minimum) to the OperationMode attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.F03 && PCC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::OperationMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3b: TH reads from the DUT the EffectiveOperationMode attribute"); + VerifyOrDo(!ShouldSkip("PCC.S.F03 && PCC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH write 2 (Maximum) to the OperationMode attribute to DUT one at a time."); + VerifyOrDo(!ShouldSkip("PCC.S.F03 && PCC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + value = static_cast(2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::OperationMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: TH reads from the DUT the EffectiveOperationMode attribute"); + VerifyOrDo(!ShouldSkip("PCC.S.F03 && PCC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5a: TH write 3 (Local) to the OperationMode attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.F06 && PCC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + value = static_cast(3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::OperationMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 5b: TH reads from the DUT the EffectiveOperationMode attribute"); + VerifyOrDo(!ShouldSkip("PCC.S.F06 && PCC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PCC_2_3Suite : public TestCommand +{ +public: + Test_TC_PCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PCC_2_3", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PCC_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveOperationMode", value, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveControlMode", value, 0U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveControlMode", value, 1U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveControlMode", value, 2U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveControlMode", value, 3U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveControlMode", value, 5U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("effectiveControlMode", value, 7U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: TH write 0 (Normal) to the OperationMode attribute to DUT."); + VerifyOrDo(!ShouldSkip("PCC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::OperationMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2b: TH reads from the DUT the EffectiveOperationMode attribute"); + VerifyOrDo(!ShouldSkip("PCC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: TH write 0 (ConstantSpeed) to the ControlMode attribute to DUT one at a time."); + VerifyOrDo(!ShouldSkip("PCC.S.F03 && PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ControlMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3b: TH reads from the DUT the EffectiveControlMode attribute."); + VerifyOrDo(!ShouldSkip("PCC.S.F03 && PCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH write 1 (ConstantPressure) to the ControlMode attribute to DUT one at a time."); + VerifyOrDo(!ShouldSkip("PCC.S.F00 && PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ControlMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: TH reads from the DUT the EffectiveControlMode attribute."); + VerifyOrDo(!ShouldSkip("PCC.S.F00 && PCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5a: TH write 2 (ProportionalPressure) to the ControlMode attribute to DUT one at a time."); + VerifyOrDo(!ShouldSkip("PCC.S.F01 && PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + value = static_cast(2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ControlMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 5b: TH reads from the DUT the EffectiveControlMode attribute."); + VerifyOrDo(!ShouldSkip("PCC.S.F01 && PCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 6a: TH write 3 (ConstantFlow) to the ControlMode attribute to DUT one at a time."); + VerifyOrDo(!ShouldSkip("PCC.S.F02 && PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + value = static_cast(3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ControlMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6b: TH reads from the DUT the _EffectiveControlMode attribute."); + VerifyOrDo(!ShouldSkip("PCC.S.F02 && PCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 7a: TH write 5 (ConstantTemperature) to the ControlMode attribute to DUT one at a time."); + VerifyOrDo(!ShouldSkip("PCC.S.F04 && PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + value = static_cast(5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ControlMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 7b: TH reads from the DUT the EffectiveControlMode attribute."); + VerifyOrDo(!ShouldSkip("PCC.S.F04 && PCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 8a: TH write 7 (Automatic) to the ControlMode attribute to DUT one at a time."); + VerifyOrDo(!ShouldSkip("PCC.S.F05 && PCC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + value = static_cast(7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::ControlMode::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 8b: TH reads from the DUT the EffectiveControlMode attribute."); + VerifyOrDo(!ShouldSkip("PCC.S.F05 && PCC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PCC_2_4Suite : public TestCommand +{ +public: + Test_TC_PCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PCC_2_4", 13, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PCC_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", value)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", value.Value(), 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", value)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", value.Value(), 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", value)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", value.Value(), 3UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", value)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", value.Value(), 1UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", value)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", value.Value(), 2UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", value)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", value.Value(), 3UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: Write 1 to the LifetimeRunningHours attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 1UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2b: Reads the attribute: LifetimeRunningHours"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3a: Write 2 to the LifetimeRunningHours attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 2UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3b: Reads the attribute: LifetimeRunningHours"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: Write 3 to the LifetimeRunningHours attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 3UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: Reads the attribute: LifetimeRunningHours"); + VerifyOrDo(!ShouldSkip("PCC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5a: Write 1 to the LifetimeEnergyConsumed attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 1UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 5b: Reads the attribute: LifetimeEnergyConsumed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 6a: Write 2 to the LifetimeEnergyConsumed attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 2UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6b: Reads the attribute: LifetimeEnergyConsumed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 7a: Write 3 to the LifetimeEnergyConsumed attribute to DUT"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 3UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 7b: Reads the attribute: LifetimeEnergyConsumed"); + VerifyOrDo(!ShouldSkip("PCC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PumpConfigurationAndControl::Id, + PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PSCFG_1_1Suite : public TestCommand +{ +public: + Test_TC_PSCFG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_1_1", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PSCFG_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), PowerSourceConfiguration::Id, + PowerSourceConfiguration::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), PowerSourceConfiguration::Id, + PowerSourceConfiguration::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), PowerSourceConfiguration::Id, + PowerSourceConfiguration::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), PowerSourceConfiguration::Id, + PowerSourceConfiguration::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 5: TH reads the AcceptedCommandList attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), PowerSourceConfiguration::Id, + PowerSourceConfiguration::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: TH reads the GeneratedCommandList attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), PowerSourceConfiguration::Id, + PowerSourceConfiguration::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 7: Read EventList attribute from the DUT.For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PSCFG_2_1Suite : public TestCommand +{ +public: + Test_TC_PSCFG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PSCFG_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the Sources attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PSCFG.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), PowerSourceConfiguration::Id, + PowerSourceConfiguration::Attributes::Sources::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_REFALM_1_1Suite : public TestCommand +{ +public: + Test_TC_REFALM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_REFALM_1_1", 12, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_REFALM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the ClusterRevision attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAlarm::Id, + RefrigeratorAlarm::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the FeatureMap attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAlarm::Id, + RefrigeratorAlarm::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads from the DUT the AttributeList attribute"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAlarm::Id, + RefrigeratorAlarm::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads from the DUT the AttributeList attribute"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAlarm::Id, + RefrigeratorAlarm::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: TH reads AttributeList attribute from DUT 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in " + "the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 5a: TH reads from the DUT the EventList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAlarm::Id, + RefrigeratorAlarm::Attributes::EventList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 5b: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 6a: TH reads from the DUT the AcceptedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAlarm::Id, + RefrigeratorAlarm::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 6: TH reads AcceptedCommandList attribute from DUT. 1. The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 7a: TH reads from the DUT the AcceptedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAlarm::Id, + RefrigeratorAlarm::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RH_1_1Suite : public TestCommand +{ +public: + Test_TC_RH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RH_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: Read the optional attribute(Tolerance) in AttributeList"); + VerifyOrDo(!ShouldSkip("RH.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 6: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 7: Read EventList attribute from the DUT.For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RH_2_1Suite : public TestCommand +{ +public: + Test_TC_RH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RH_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable CurrentMinMeasured; + chip::app::DataModel::Nullable CurrentMaxMeasured; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + CurrentMinMeasured = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + CurrentMaxMeasured = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, CurrentMaxMeasured)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2048U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the MinMeasuredValue attribute from the DUT"); + VerifyOrDo(!ShouldSkip("RH.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the MaxMeasuredValue attribute from the DUT"); + VerifyOrDo(!ShouldSkip("RH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads the MeasuredValue attribute from the DUT"); + VerifyOrDo(!ShouldSkip("RH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads the Tolerance attribute from the DUT"); + VerifyOrDo(!ShouldSkip("RH.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::Tolerance::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMOKECO_1_1Suite : public TestCommand +{ +public: + Test_TC_SMOKECO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SMOKECO_1_1", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SMOKECO_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 2UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 3UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the FeatureMap attribute"); + VerifyOrDo(!ShouldSkip("!SMOKECO.S.F00 && !SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the FeatureMap attribute(Smoke Alarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.F00 && !SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the FeatureMap attribute(CO Alarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.F01 && !SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the FeatureMap attribute(Smoke Alarm & CO Alarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.F00 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AttributeList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AttributeList attribute(SmokeState)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the AttributeList attribute(COState)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the AttributeList attribute(DeviceMuted)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the AttributeList attribute(InterconnectSmokeAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads from the DUT the AttributeList attribute(InterconnectCOAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH reads from the DUT the AttributeList attribute(ContaminationState)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads from the DUT the AttributeList attribute(SmokeSensitivityLevel)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "TH reads from the DUT the AttributeList attribute(ExpiryDate)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads from the DUT the EventList attribute"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads from the DUT the EventList attribute(SmokeAlarm)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SMOKECO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads from the DUT the EventList attribute(COAlarm)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SMOKECO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "TH reads from the DUT the EventList attribute(AlarmMuted)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SMOKECO.S.E06"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads from the DUT the EventList attribute(MuteEnded)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SMOKECO.S.E07"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads from the DUT the EventList attribute(InterconnectSmokeAlarm)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SMOKECO.S.E08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "TH reads from the DUT the EventList attribute(InterconnectCOAlarm)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SMOKECO.S.E09"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "TH reads from the DUT the AcceptedCommandList attribute"); + VerifyOrDo(!ShouldSkip("!SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "TH reads from the DUT the AcceptedCommandList attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "TH reads from the DUT the GeneratedCommandList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMOKECO_2_1Suite : public TestCommand +{ +public: + Test_TC_SMOKECO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SMOKECO_2_1", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SMOKECO_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 8U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "epoch_s", "epoch_s")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the ExpressedState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the SmokeState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the COState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the BatteryAlert attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::BatteryAlert::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the DeviceMuted attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the TestInProgress attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the HardwareFaultAlert attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::HardwareFaultAlert::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the EndOfServiceAlert attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EndOfServiceAlert::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the InterconnectSmokeAlarm attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the InterconnectCOAlarm attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads from the DUT the ContaminationState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ContaminationState::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH reads from the DUT the SmokeSensitivityLevel attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::SmokeSensitivityLevel::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads from the DUT the ExpiryDate attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpiryDate::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMOKECO_2_2Suite : public TestCommand +{ +public: + Test_TC_SMOKECO_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SMOKECO_2_2", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerSmokeAlarmClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMOKECO_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(990)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningSmokeAlarm; + chip::Optional mTestEventTriggerCriticalSmokeAlarm; + chip::Optional mTestEventTriggerSmokeAlarmClear; + chip::Optional mEventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 1U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_BUSY)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 15: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 2U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 19: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH subscribes to SmokeState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, 3, + 30, true, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningSmokeAlarm.HasValue() ? mTestEventTriggerWarningSmokeAlarm.Value() : 0xffffffff00000090ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads SmokeAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SmokeAlarm::Id, false, + chip::NullOptional); + } + case 8: { + LogStep(8, "Start manually DUT self-test"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH sends SelfTestRequest command to DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Commands::SelfTestRequest::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerCriticalSmokeAlarm.HasValue() ? mTestEventTriggerCriticalSmokeAlarm.Value() + : 0xffffffff0000009cULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads SmokeAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SmokeAlarm::Id, false, + chip::NullOptional); + } + case 16: { + LogStep(16, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerSmokeAlarmClear.HasValue() ? mTestEventTriggerSmokeAlarmClear.Value() : 0xffffffff000000a0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 18: { + LogStep(18, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMOKECO_2_3Suite : public TestCommand +{ +public: + Test_TC_SMOKECO_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SMOKECO_2_3", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerCoAlarmClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMOKECO_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(990)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningCoAlarm; + chip::Optional mTestEventTriggerCriticalCoAlarm; + chip::Optional mTestEventTriggerCoAlarmClear; + chip::Optional mEventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::COAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 1U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_BUSY)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 15: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::COAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 2U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 19: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH subscribes to COState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, 3, + 30, true, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningCoAlarm.HasValue() ? mTestEventTriggerWarningCoAlarm.Value() : 0xffffffff00000091ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads COAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::COAlarm::Id, false, + chip::NullOptional); + } + case 8: { + LogStep(8, "Start manually DUT self-test"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH sends SelfTestRequest command to DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Commands::SelfTestRequest::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCriticalCoAlarm.HasValue() ? mTestEventTriggerCriticalCoAlarm.Value() : 0xffffffff0000009dULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads COAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::COAlarm::Id, false, + chip::NullOptional); + } + case 16: { + LogStep(16, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCoAlarmClear.HasValue() ? mTestEventTriggerCoAlarmClear.Value() : 0xffffffff000000a1ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 18: { + LogStep(18, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMOKECO_2_4Suite : public TestCommand +{ +public: + Test_TC_SMOKECO_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SMOKECO_2_4", 50, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT", 0, UINT64_MAX, &mTestEventTriggerWarningBatteryAlert); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_BATTERY_ALERT", 0, UINT64_MAX, &mTestEventTriggerCriticalBatteryAlert); + AddArgument("TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerBatteryAlertClear); + AddArgument("TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT", 0, UINT64_MAX, &mTestEventTriggerHardwareFaultAlert); + AddArgument("TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerHardwareFaultAlertClear); + AddArgument("TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT", 0, UINT64_MAX, &mTestEventTriggerEndOfServiceAlert); + AddArgument("TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerEndOfServiceAlertClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMOKECO_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(2910)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningBatteryAlert; + chip::Optional mTestEventTriggerCriticalBatteryAlert; + chip::Optional mTestEventTriggerBatteryAlertClear; + chip::Optional mTestEventTriggerHardwareFaultAlert; + chip::Optional mTestEventTriggerHardwareFaultAlertClear; + chip::Optional mTestEventTriggerEndOfServiceAlert; + chip::Optional mTestEventTriggerEndOfServiceAlertClear; + chip::Optional mEventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::LowBattery::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lowBattery.alarmSeverityLevel", value.alarmSeverityLevel, 1U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 11: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::LowBattery::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lowBattery.alarmSeverityLevel", value.alarmSeverityLevel, 2U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 15: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareFaultAlert", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareFaultAlert", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 5U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 20: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::HardwareFault::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareFaultAlert", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 24: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("endOfServiceAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("endOfServiceAlert", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 6U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 29: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::EndOfService::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("endOfServiceAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 33: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 40: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SelfTestComplete::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 42: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 47: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SelfTestComplete::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 49: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH subscribes to BatteryAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::BatteryAlert::Id, + 3, 30, true, chip::NullOptional, chip::NullOptional, + /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Battery Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerWarningBatteryAlert.HasValue() ? mTestEventTriggerWarningBatteryAlert.Value() + : 0xffffffff00000095ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads LowBattery event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::LowBattery::Id, false, + chip::NullOptional); + } + case 8: { + LogStep(8, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical Battery Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerCriticalBatteryAlert.HasValue() ? mTestEventTriggerCriticalBatteryAlert.Value() + : 0xffffffff0000009eULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 10: { + LogStep(10, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads LowBattery event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::LowBattery::Id, false, + chip::NullOptional); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Battery Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerBatteryAlertClear.HasValue() ? mTestEventTriggerBatteryAlertClear.Value() : 0xffffffff000000a5ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH subscribes to HardwareFaultAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::HardwareFaultAlert::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 17: { + LogStep(17, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Hardware Fault Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerHardwareFaultAlert.HasValue() ? mTestEventTriggerHardwareFaultAlert.Value() + : 0xffffffff00000093ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "TH waits for a report of HardwareFaultAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 19: { + LogStep(19, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads HardwareFault event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::HardwareFault::Id, false, + chip::NullOptional); + } + case 21: { + LogStep(21, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Hardware Fault Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerHardwareFaultAlertClear.HasValue() + ? mTestEventTriggerHardwareFaultAlertClear.Value() + : 0xffffffff000000a3ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "TH waits for a report of HardwareFaultAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 23: { + LogStep(23, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 24: { + LogStep(24, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 25: { + LogStep(25, "TH subscribes to EndOfServiceAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::EndOfServiceAlert::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 26: { + LogStep(26, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for End " + "of Service Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerEndOfServiceAlert.HasValue() ? mTestEventTriggerEndOfServiceAlert.Value() : 0xffffffff0000009aULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 27: { + LogStep(27, "TH waits for a report of EndOfServiceAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 28: { + LogStep(28, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "TH reads EndOfService event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::EndOfService::Id, false, + chip::NullOptional); + } + case 30: { + LogStep(30, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for End " + "of Service Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerEndOfServiceAlertClear.HasValue() + ? mTestEventTriggerEndOfServiceAlertClear.Value() + : 0xffffffff000000aaULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 31: { + LogStep(31, "TH waits for a report of EndOfServiceAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 32: { + LogStep(32, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 34: { + LogStep(34, "TH subscribes to TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::TestInProgress::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 35: { + LogStep(35, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 36: { + LogStep(36, "Start manually DUT self-test"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 37: { + LogStep(37, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 38: { + LogStep(38, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 39: { + LogStep(39, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 40: { + LogStep(40, "TH reads SelfTestComplete event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SelfTestComplete::Id, false, + chip::NullOptional); + } + case 41: { + LogStep(41, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 42: { + LogStep(42, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 43: { + LogStep(43, "TH sends SelfTestRequest command to DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Commands::SelfTestRequest::Id, value, + chip::NullOptional + + ); + } + case 44: { + LogStep(44, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 45: { + LogStep(45, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 46: { + LogStep(46, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 47: { + LogStep(47, "TH reads SelfTestComplete event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SelfTestComplete::Id, false, + chip::NullOptional); + } + case 48: { + LogStep(48, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 49: { + LogStep(49, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMOKECO_2_5Suite : public TestCommand +{ +public: + Test_TC_SMOKECO_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SMOKECO_2_5", 75, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_WARNING_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerCoAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_DEVICE_MUTED", 0, UINT64_MAX, &mTestEventTriggerDeviceMuted); + AddArgument("TEST_EVENT_TRIGGER_DEVICE_MUTED_CLEAR", 0, UINT64_MAX, &mTestEventTriggerDeviceMutedClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, + &mTestEventTriggerInterconnectSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_CONTAMINATION_STATE_HIGH", 0, UINT64_MAX, &mTestEventTriggerContaminationStateHigh); + AddArgument("TEST_EVENT_TRIGGER_CONTAMINATION_STATE_LOW", 0, UINT64_MAX, &mTestEventTriggerContaminationStateLow); + AddArgument("TTEST_EVENT_TRIGGER_CONTAMINATION_STATE_CLEAR", 0, UINT64_MAX, &mTtestEventTriggerContaminationStateClear); + AddArgument("TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_HIGH", 0, UINT64_MAX, &mTestEventTriggerSensitivityLevelHigh); + AddArgument("TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_LOW", 0, UINT64_MAX, &mTestEventTriggerSensitivityLevelLow); + AddArgument("TTEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_CLEAR", 0, UINT64_MAX, &mTtestEventTriggerSensitivityLevelClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMOKECO_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(6090)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningSmokeAlarm; + chip::Optional mTestEventTriggerCriticalSmokeAlarm; + chip::Optional mTestEventTriggerSmokeAlarmClear; + chip::Optional mTestEventTriggerWarningCoAlarm; + chip::Optional mTestEventTriggerCriticalCoAlarm; + chip::Optional mTestEventTriggerCoAlarmClear; + chip::Optional mTestEventTriggerDeviceMuted; + chip::Optional mTestEventTriggerDeviceMutedClear; + chip::Optional mTestEventTriggerInterconnectSmokeAlarm; + chip::Optional mTestEventTriggerInterconnectSmokeAlarmClear; + chip::Optional mTestEventTriggerInterconnectCoAlarm; + chip::Optional mTestEventTriggerInterconnectCoAlarmClear; + chip::Optional mTestEventTriggerContaminationStateHigh; + chip::Optional mTestEventTriggerContaminationStateLow; + chip::Optional mTtestEventTriggerContaminationStateClear; + chip::Optional mTestEventTriggerSensitivityLevelHigh; + chip::Optional mTestEventTriggerSensitivityLevelLow; + chip::Optional mTtestEventTriggerSensitivityLevelClear; + chip::Optional mEventNumber; + + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum interconnectSmokeAlarmSeverityLevel; + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum interconnectCOAlarmSeverityLevel; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + interconnectSmokeAlarmSeverityLevel = value; + } + shouldContinue = true; + break; + case 6: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm.alarmSeverityLevel", value.alarmSeverityLevel, + interconnectSmokeAlarmSeverityLevel)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 7U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 11: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + interconnectCOAlarmSeverityLevel = value; + } + shouldContinue = true; + break; + case 16: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm.alarmSeverityLevel", value.alarmSeverityLevel, + interconnectCOAlarmSeverityLevel)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 8U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 21: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 2U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 47: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AlarmMuted::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 50: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::MuteEnded::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 64: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AlarmMuted::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 67: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::MuteEnded::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH subscribes to InterconnectSmokeAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarm.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarm.Value() + : 0xffffffff00000092ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads InterconnectSmokeAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.E08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::InterconnectSmokeAlarm::Id, + false, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarmClear.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarmClear.Value() + : 0xffffffff000000a2ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 10: { + LogStep(10, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 12: { + LogStep(12, "TH subscribes to InterconnectCOAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarm.HasValue() ? mTestEventTriggerInterconnectCoAlarm.Value() + : 0xffffffff00000094ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 16: { + LogStep(16, "TH reads InterconnectCOAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.E09"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::InterconnectCOAlarm::Id, false, + chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarmClear.HasValue() + ? mTestEventTriggerInterconnectCoAlarmClear.Value() + : 0xffffffff000000a4ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 19: { + LogStep(19, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 20: { + LogStep(20, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 22: { + LogStep(22, "TH subscribes to ContaminationState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::ContaminationState::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 23: { + LogStep(23, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State (High) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerContaminationStateHigh.HasValue() + ? mTestEventTriggerContaminationStateHigh.Value() + : 0xffffffff00000096ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 25: { + LogStep(25, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerContaminationStateClear.HasValue() + ? mTtestEventTriggerContaminationStateClear.Value() + : 0xffffffff000000a6ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 27: { + LogStep(27, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State (Low) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerContaminationStateLow.HasValue() ? mTestEventTriggerContaminationStateLow.Value() + : 0xffffffff00000097ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 28: { + LogStep(28, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 29: { + LogStep(29, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerContaminationStateClear.HasValue() + ? mTtestEventTriggerContaminationStateClear.Value() + : 0xffffffff000000a6ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 31: { + LogStep(31, "TH subscribes to SmokeSensitivityLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::SmokeSensitivityLevel::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 32: { + LogStep(32, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level (High) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerSensitivityLevelHigh.HasValue() ? mTestEventTriggerSensitivityLevelHigh.Value() + : 0xffffffff00000098ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 33: { + LogStep(33, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 34: { + LogStep(34, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerSensitivityLevelClear.HasValue() + ? mTtestEventTriggerSensitivityLevelClear.Value() + : 0xffffffff000000a8ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 35: { + LogStep(35, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 36: { + LogStep(36, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level (Low) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerSensitivityLevelLow.HasValue() ? mTestEventTriggerSensitivityLevelLow.Value() + : 0xffffffff00000099ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 37: { + LogStep(37, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 38: { + LogStep(38, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerSensitivityLevelClear.HasValue() + ? mTtestEventTriggerSensitivityLevelClear.Value() + : 0xffffffff000000a8ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 39: { + LogStep(39, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 40: { + LogStep(40, "TH subscribes to DeviceMuted attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, + 3, 30, true, chip::NullOptional, chip::NullOptional, + /* autoResubscribe = */ chip::NullOptional); + } + case 41: { + LogStep(41, "TH reads FeatureMap attribute(Smoke Alarm) from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "TH subscribes to SmokeState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 43: { + LogStep(43, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningSmokeAlarm.HasValue() ? mTestEventTriggerWarningSmokeAlarm.Value() : 0xffffffff00000090ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 44: { + LogStep(44, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 45: { + LogStep(45, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 46: { + LogStep(46, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 47: { + LogStep(47, "TH reads AlarmMuted event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E06"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AlarmMuted::Id, false, + chip::NullOptional); + } + case 48: { + LogStep(48, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMutedClear.HasValue() ? mTestEventTriggerDeviceMutedClear.Value() : 0xffffffff000000abULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 49: { + LogStep(49, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 50: { + LogStep(50, "TH reads MuteEnded event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E07"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::MuteEnded::Id, false, + chip::NullOptional); + } + case 51: { + LogStep(51, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerCriticalSmokeAlarm.HasValue() ? mTestEventTriggerCriticalSmokeAlarm.Value() + : 0xffffffff0000009cULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 52: { + LogStep(52, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 53: { + LogStep(53, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 54: { + LogStep(54, "TH waits 60 Seconds"); + VerifyOrDo(!ShouldSkip("!PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 60000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 55: { + LogStep(55, "TH reads DeviceMuted attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, true, + chip::NullOptional); + } + case 56: { + LogStep(56, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerSmokeAlarmClear.HasValue() ? mTestEventTriggerSmokeAlarmClear.Value() : 0xffffffff000000a0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 57: { + LogStep(57, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.A0001 && SMOKECO.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 58: { + LogStep(58, "TH reads FeatureMap attribute(CO Alarm) from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 59: { + LogStep(59, "TH subscribes to COState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 60: { + LogStep(60, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningCoAlarm.HasValue() ? mTestEventTriggerWarningCoAlarm.Value() : 0xffffffff00000091ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 61: { + LogStep(61, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 62: { + LogStep(62, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 63: { + LogStep(63, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 64: { + LogStep(64, "TH reads AlarmMuted event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E06"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AlarmMuted::Id, false, + chip::NullOptional); + } + case 65: { + LogStep(65, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMutedClear.HasValue() ? mTestEventTriggerDeviceMutedClear.Value() : 0xffffffff000000abULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 66: { + LogStep(66, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 67: { + LogStep(67, "TH reads MuteEnded event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E07"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::MuteEnded::Id, false, + chip::NullOptional); + } + case 68: { + LogStep(68, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCriticalCoAlarm.HasValue() ? mTestEventTriggerCriticalCoAlarm.Value() : 0xffffffff0000009dULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 69: { + LogStep(69, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 70: { + LogStep(70, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 71: { + LogStep(71, "TH waits 60 Seconds"); + VerifyOrDo(!ShouldSkip("!PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 60000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 72: { + LogStep(72, "TH reads DeviceMuted attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, true, + chip::NullOptional); + } + case 73: { + LogStep(73, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCoAlarmClear.HasValue() ? mTestEventTriggerCoAlarmClear.Value() : 0xffffffff000000a1ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 74: { + LogStep(74, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMOKECO_2_6Suite : public TestCommand +{ +public: + Test_TC_SMOKECO_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SMOKECO_2_6", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_WARNING_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerCoAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT", 0, UINT64_MAX, &mTestEventTriggerWarningBatteryAlert); + AddArgument("TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerBatteryAlertClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, + &mTestEventTriggerInterconnectSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarmClear); + AddArgument("HIEST_PRI_ALARM", 0, UINT8_MAX, &mHiestPriAlarm); + AddArgument("HIEST_PRI_ALARM_2", 0, UINT8_MAX, &mHiestPriAlarm2); + AddArgument("HIEST_PRI_ALARM_3", 0, UINT8_MAX, &mHiestPriAlarm3); + AddArgument("HIEST_PRI_ALARM_4", 0, UINT8_MAX, &mHiestPriAlarm4); + AddArgument("HIEST_PRI_ALARM_5", 0, UINT8_MAX, &mHiestPriAlarm5); + } + + ~Test_TC_SMOKECO_2_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(3090)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningSmokeAlarm; + chip::Optional mTestEventTriggerSmokeAlarmClear; + chip::Optional mTestEventTriggerWarningCoAlarm; + chip::Optional mTestEventTriggerCoAlarmClear; + chip::Optional mTestEventTriggerWarningBatteryAlert; + chip::Optional mTestEventTriggerBatteryAlertClear; + chip::Optional mTestEventTriggerInterconnectSmokeAlarm; + chip::Optional mTestEventTriggerInterconnectSmokeAlarmClear; + chip::Optional mTestEventTriggerInterconnectCoAlarm; + chip::Optional mTestEventTriggerInterconnectCoAlarmClear; + chip::Optional mHiestPriAlarm; + chip::Optional mHiestPriAlarm2; + chip::Optional mHiestPriAlarm3; + chip::Optional mHiestPriAlarm4; + chip::Optional mHiestPriAlarm5; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm.HasValue() ? mHiestPriAlarm.Value() : 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm2.HasValue() ? mHiestPriAlarm2.Value() : 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm3.HasValue() ? mHiestPriAlarm3.Value() : 7U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm4.HasValue() ? mHiestPriAlarm4.Value() : 7U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm5.HasValue() ? mHiestPriAlarm5.Value() : 3U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH subscribes to BatteryAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::BatteryAlert::Id, + 3, 30, true, chip::NullOptional, chip::NullOptional, + /* autoResubscribe = */ chip::NullOptional); + } + case 3: { + LogStep(3, "TH subscribes to InterconnectSmokeAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id, 3, 30, true, chip::NullOptional, + chip::Optional(true), /* autoResubscribe = */ chip::NullOptional); + } + case 4: { + LogStep(4, "TH subscribes to InterconnectCOAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id, 3, 30, true, chip::NullOptional, + chip::Optional(true), /* autoResubscribe = */ chip::NullOptional); + } + case 5: { + LogStep(5, "TH subscribes to COState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 6: { + LogStep(6, "TH subscribes to SmokeState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Battery Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerWarningBatteryAlert.HasValue() ? mTestEventTriggerWarningBatteryAlert.Value() + : 0xffffffff00000095ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 10: { + LogStep(10, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarm.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarm.Value() + : 0xffffffff00000092ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarm.HasValue() ? mTestEventTriggerInterconnectCoAlarm.Value() + : 0xffffffff00000094ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningCoAlarm.HasValue() ? mTestEventTriggerWarningCoAlarm.Value() : 0xffffffff00000091ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 16: { + LogStep(16, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningSmokeAlarm.HasValue() ? mTestEventTriggerWarningSmokeAlarm.Value() : 0xffffffff00000090ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 18: { + LogStep(18, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerSmokeAlarmClear.HasValue() ? mTestEventTriggerSmokeAlarmClear.Value() : 0xffffffff000000a0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 21: { + LogStep(21, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO " + "Alarm Test Event clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCoAlarmClear.HasValue() ? mTestEventTriggerCoAlarmClear.Value() : 0xffffffff000000a1ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 24: { + LogStep(24, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarmClear.HasValue() + ? mTestEventTriggerInterconnectCoAlarmClear.Value() + : 0xffffffff000000a4ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 27: { + LogStep(27, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 28: { + LogStep(28, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarmClear.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarmClear.Value() + : 0xffffffff000000a2ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 29: { + LogStep(29, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 30: { + LogStep(30, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 31: { + LogStep(31, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Battery Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerBatteryAlertClear.HasValue() ? mTestEventTriggerBatteryAlertClear.Value() : 0xffffffff000000a5ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 32: { + LogStep(32, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 33: { + LogStep(33, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SWTCH_1_1Suite : public TestCommand +{ +public: + Test_TC_SWTCH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SWTCH_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 3: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2a: Read FeatureMap attribute and Check values of flags in this FeatureMap"); + VerifyOrDo(!ShouldSkip("!SWTCH.S.F00 && !SWTCH.S.F01 && !SWTCH.S.F02 && !SWTCH.S.F03 && !SWTCH.S.F04"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Given SWTCH.S.F00(LS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("SWTCH.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Given SWTCH.S.F01(MS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("SWTCH.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2d: Given SWTCH.S.F02(MSR) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("SWTCH.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2e: Given SWTCH.S.F03(MSL) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("SWTCH.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2f: Given SWTCH.S.F04(MSM) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("SWTCH.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("SWTCH.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4b: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && !SWTCH.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4b: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED && !SWTCH.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 5a: Read the global attribute: EventList "); + VerifyOrDo(!ShouldSkip("!SWTCH.S.F00 && !SWTCH.S.F01 && !SWTCH.S.F02 && !SWTCH.S.F03 && !SWTCH.S.F04 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 5b: Read EventList if SWTCH.S.F00(LS)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SWTCH.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 5c: Read EventList if SWTCH.S.F01(MS) & !SWTCH.S.F02(MSR)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && SWTCH.S.F01 && !SWTCH.S.F02"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 5d: Read EventList if SWTCH.S.F01(MS) & SWTCH.S.F02(MSR) & !SWTCH.S.F03(MSL) & !SWTCH.S.F04(MSM)"); + VerifyOrDo(!ShouldSkip(" PICS_EVENT_LIST_ENABLED && SWTCH.S.F01 && SWTCH.S.F02 && !SWTCH.S.F03 && !SWTCH.S.F04 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5e: Read EventList if SWTCH.S.F01(MS) & SWTCH.S.F02(MSR) & SWTCH.S.F03(MSL) & !SWTCH.S.F04(MSM)"); + VerifyOrDo(!ShouldSkip(" PICS_EVENT_LIST_ENABLED && SWTCH.S.F01 && SWTCH.S.F02 && SWTCH.S.F03 && !SWTCH.S.F04 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 5f: Read EventList if SWTCH.S.F01(MS) & SWTCH.S.F02(MSR) & !SWTCH.S.F03(MSL) & SWTCH.S.F04(MSM) "); + VerifyOrDo(!ShouldSkip(" PICS_EVENT_LIST_ENABLED && SWTCH.S.F01 && SWTCH.S.F02 && !SWTCH.S.F03 && SWTCH.S.F04 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 5g: Read EventList if SWTCH.S.F01(MS) & SWTCH.S.F02(MSR) & SWTCH.S.F03(MSL) & SWTCH.S.F04(MSM) "); + VerifyOrDo(!ShouldSkip(" PICS_EVENT_LIST_ENABLED && SWTCH.S.F01 && SWTCH.S.F02 && SWTCH.S.F03 && SWTCH.S.F04 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 6: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Step 7: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SWTCH_2_1Suite : public TestCommand +{ +public: + Test_TC_SWTCH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_2_1", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SWTCH_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t NumberOfPositionsValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 2U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + NumberOfPositionsValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, NumberOfPositionsValue - 1)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 2U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: Read NumberOfPositions attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::NumberOfPositions::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2b: Read CurrentPosition attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::CurrentPosition::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2c: Read MultiPressMax attribute"); + VerifyOrDo(!ShouldSkip("SWTCH.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Switch::Id, Switch::Attributes::MultiPressMax::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RVCOPSTATE_1_1Suite : public TestCommand +{ +public: + Test_TC_RVCOPSTATE_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RVCOPSTATE_1_1", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RVCOPSTATE_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads the FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("RVCOPSTATE.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5a: TH reads from the DUT the EventList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::EventList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5b: TH reads from the DUT the optional event(OperationCompletion) in EventList."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && RVCOPSTATE.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::EventList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 6a: Read the optional command(Pause) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("RVCOPSTATE.S.C00.Rsp || RVCOPSTATE.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 6b: Read the optional command(Stop) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("RVCOPSTATE.S.C01.Rsp || RVCOPSTATE.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6c: Read the optional command(Start) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("RVCOPSTATE.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 6d: Read the optional command(Resume) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("RVCOPSTATE.S.C03.Rsp || RVCOPSTATE.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 7: Read the global attribute: GeneratedCommandList"); + VerifyOrDo( + !ShouldSkip(" !RVCOPSTATE.S.C00.Rsp && !RVCOPSTATE.S.C01.Rsp && !RVCOPSTATE.S.C02.Rsp && !RVCOPSTATE.S.C03.Rsp "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 7: Read the global attribute: GeneratedCommandList"); + VerifyOrDo( + !ShouldSkip(" RVCOPSTATE.S.C00.Rsp || RVCOPSTATE.S.C01.Rsp || RVCOPSTATE.S.C02.Rsp || RVCOPSTATE.S.C03.Rsp "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCCM_1_1Suite : public TestCommand +{ +public: + Test_TC_TCCM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCCM_1_1", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCCM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the FeatureMap attribute."); + VerifyOrDo(!ShouldSkip("!TCCM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep( + 3, "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if TCCM.S.F00(DEPONOFF)"); + VerifyOrDo(!ShouldSkip("TCCM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads from the DUT the AttributeList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads from the DUT the AttributeList attribute."); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 4b: TH reads from the DUT the AttributeList attribute. 0x0002: SHALL be included if and only if " + "TCCM.S.A0002(StartUpMode)"); + VerifyOrDo(!ShouldSkip("TCCM.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003 SHALL be included if and only if " + "TCCM.S.F00(DEPONOFF)"); + VerifyOrDo(!ShouldSkip("TCCM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 4d: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1))"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 5a: TH reads from the DUT the EventList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 5b: TH reads EventList attribute from DUT 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 6a: TH reads from the DUT the AcceptedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1. The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 7a: TH reads from the DUT the GeneratedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RefrigeratorAndTemperatureControlledCabinetMode::Id, + RefrigeratorAndTemperatureControlledCabinetMode::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_1_1Suite : public TestCommand +{ +public: + Test_TC_TCTL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCTL_1_1", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCTL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the ClusterRevision attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads from the DUT the FeatureMap attribute"); + VerifyOrDo(!ShouldSkip("!TCTL.S.F00 && !TCTL.S.F01 && !TCTL.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, + "Step 3b: TH reads from the DUT the FeatureMap attribute. bit 0: SHALL be 1 if and only if TCTL.S.F00(TN) & " + "!TCTL.S.F01(TL)"); + VerifyOrDo(!ShouldSkip("TCTL.S.F00 && !TCTL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "Step 3c: TH reads from the DUT the FeatureMap attribute. bit 1: SHALL be 1 if and only if TCTL.S.F01(TL) & " + "!TCTL.S.F00(TN)"); + VerifyOrDo(!ShouldSkip("TCTL.S.F01 && !TCTL.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 3d: TH reads from the DUT the FeatureMap attribute. bit 2: SHALL be 1 if and only if TCTL.S.F02(A_STEP) " + "& TCTL.S.F00(TN)"); + VerifyOrDo(!ShouldSkip("TCTL.S.F02 && !TCTL.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4a: TH reads from the DUT the AttributeList attribute."); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4a: TH reads from the DUT the AttributeList attribute."); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 4b: TH reads from the DUT the AttributeList attribute. 0x0000, 0x0001, 0x0002: SHALL be included if and " + "only if TCTL.S.F00(TN)"); + VerifyOrDo(!ShouldSkip("TCTL.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003: SHALL be included if and only if " + "TCTL.S.F02(A_STEP)"); + VerifyOrDo(!ShouldSkip("TCTL.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 4d: TH reads from the DUT the AttributeList attribute. 0x0004 & 0x0005: SHALL be included if and only if " + "TCTL.S.F01(TL)"); + VerifyOrDo(!ShouldSkip("TCTL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 4e: TH reads AttributeList attribute from DUT 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in " + "the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 5a: TH reads from the DUT the AcceptedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 5b: TH reads AcceptedCommandList attribute from DUT 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 6a: TH reads from the DUT the GeneratedCommandList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 6b: TH reads GeneratedCommandList attribute from DUT.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 7a: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::EventList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Step 7b: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TMP_1_1Suite : public TestCommand +{ +public: + Test_TC_TMP_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TMP_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TMP_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4b: Read the optional attribute(Tolerance) in AttributeList"); + VerifyOrDo(!ShouldSkip("TMP.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: Read AcceptedCommandList attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 6: Read GeneratedCommandList attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 7: Read EventList attribute from the DUT.For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TMP_2_1Suite : public TestCommand +{ +public: + Test_TC_TMP_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TMP_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TMP_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable CurrentMinMeasured; + chip::app::DataModel::Nullable CurrentMaxMeasured; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); + CurrentMinMeasured = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + CurrentMaxMeasured = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, CurrentMaxMeasured)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2048U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute: MinMeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the mandatory attribute: MaxMeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the mandatory attribute: MeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 6: Read the optional attribute: Tolerance"); + VerifyOrDo(!ShouldSkip("TMP.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::Tolerance::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TSTAT_1_1Suite : public TestCommand +{ +public: + Test_TC_TSTAT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_1_1", 59, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TSTAT_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 64UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 25UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 32UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 33UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 34UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 52UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 53UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 54UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 55UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 56UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 57UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 29UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 35UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 36UL)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 37UL)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 48UL)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 49UL)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 50UL)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 58UL)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65UL)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 66UL)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 67UL)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 68UL)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 69UL)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 70UL)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 71UL)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 21UL)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 22UL)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 24UL)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 30UL)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("!TSTAT.S.F00 && !TSTAT.S.F01 && !TSTAT.S.F02 && !TSTAT.S.F03 && !TSTAT.S.F04 && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given TSTAT.S.F00(HEAT ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given TSTAT.S.F01(COOL) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given TSTAT.S.F02(OCC) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given TSTAT.S.F03(SCH) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given TSTAT.S.F04(SB) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given TSTAT.S.F05(AUTO) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given TSTAT.S.F06(LTNE) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F06"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4b: Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4c: Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4d: Read the Feature dependent(TSTAT.S.F02(OCC)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4e: Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4f: Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4g: Read the Feature dependent(TSTAT.S.F05(AUTO)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4h: Read the Feature dependent(TSTAT.S.F03(SCH)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4i: Read the Feature dependent(TSTAT.S.F04(SB)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Step 4j: Read the Feature dependent(TSTAT.S.F04(SB) & TSTAT.S.F02(OCC)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F04 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Step 4k: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Step 4l: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Step 4m: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Step 4n: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4o: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4p: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4q: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4r: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "Step 4s: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Step 4t: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, "Step 4u: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Step 4x: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, "Step 5y: Read the optional attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "Step 4z: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0040"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Step 4A: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0041"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "Step 4B: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0042"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 37: { + LogStep(37, "Step 4C: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0043"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Step 5D: Read the optional attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0044"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 39: { + LogStep(39, "Step 4E: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0045"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 40: { + LogStep(40, "Step 4F: Read the optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0046"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "Step 5G: Read the optional attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0047"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "Step 4H: Read the Feature dependent(TSTAT.S.F00(HEAT)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 43: { + LogStep(43, "Step 4I: Read the Feature dependent(TSTAT.S.F00(HEAT)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Step 4J: Read the Feature dependent(TSTAT.S.F00(HEAT)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 45: { + LogStep(45, "Step 4K: Read the Feature dependent(TSTAT.S.F00(HEAT)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Step 4L: Read the Feature dependent(TSTAT.S.F00(HEAT)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "Step 4M: Read the Feature dependent(TSTAT.S.F01(COOL)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 48: { + LogStep(48, "Step 4N: Read the Feature dependent(TSTAT.S.F01(COOL)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Step 4O: Read the Feature dependent(TSTAT.S.F01(COOL)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 50: { + LogStep(50, "Step 4P: Read the Feature dependent(TSTAT.S.F01(COOL)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 51: { + LogStep(51, "Step 4Q: Read the Feature dependent(TSTAT.S.F01(COOL)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Step 4R: Read the Feature dependent(TSTAT.S.F05(AUTO)) optional attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05 && TSTAT.S.A001e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 53: { + LogStep(53, "Step 5a: Read Feature dependent(TSTAT.S.F03(SCH)) commands in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 54: { + LogStep(54, "Step 5b: Read the optional attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 55: { + LogStep(55, "Step 6a: Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip(" !TSTAT.S.C04.Rsp && !TSTAT.S.C02.Rsp "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 56: { + LogStep(56, "Step 6b: Read Feature dependent(TSTAT.S.F03(SCH)) commands in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 57: { + LogStep(57, "Step 6c: Read optional command (GetRelayStatusLogResponse) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 58: { + LogStep(58, + "Step 7: Read EventList attribute from the DUT.For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TSTAT_2_1Suite : public TestCommand +{ +public: + Test_TC_TSTAT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_2_1", 70, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TSTAT_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + int16_t AbsMinCoolSetpointLimitStep5; + int8_t MinSetpointDeadBandValue; + int16_t AbsMaxCoolSetpointLimitStep6; + int16_t MinCoolSetpointLimitValue; + int16_t MaxCoolSetpointLimitValue; + int16_t MaxHeatSetpointLimitValue; + int16_t OccupiedCoolingSetpointValue; + int16_t AbsMinHeatValue; + int16_t AbsMaxHeatValue; + int16_t UnoccupiedCoolingSetpointValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + AbsMinCoolSetpointLimitStep5 = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + MinSetpointDeadBandValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + AbsMaxCoolSetpointLimitStep6 = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + MinCoolSetpointLimitValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + MaxCoolSetpointLimitValue = value; + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + MaxHeatSetpointLimitValue = value; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + OccupiedCoolingSetpointValue = value; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + AbsMinHeatValue = value; + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + AbsMaxHeatValue = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + UnoccupiedCoolingSetpointValue = value; + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMaxValue("value", value, AbsMinCoolSetpointLimitStep5 - MinSetpointDeadBandValue)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1575)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 63U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8s", "int8s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -25)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 25)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinCoolSetpointLimitValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxCoolSetpointLimitValue)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, AbsMinCoolSetpointLimitStep5)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, OccupiedCoolingSetpointValue - MinSetpointDeadBandValue)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, AbsMinHeatValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, AbsMaxHeatValue)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, UnoccupiedCoolingSetpointValue - MinSetpointDeadBandValue)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MinCoolSetpointLimitValue - MinSetpointDeadBandValue)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, AbsMinHeatValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxHeatSetpointLimitValue)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxCoolSetpointLimitValue - MinSetpointDeadBandValue)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, AbsMinCoolSetpointLimitStep5)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxCoolSetpointLimitValue)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinCoolSetpointLimitValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, AbsMaxCoolSetpointLimitStep6)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8s", "int8s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 25)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Thermostat::ThermostatControlSequence value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1440U)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap16", "bitmap16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "epoch_s", "epoch_s")); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("ACCapacityformat", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Saving value for comparision in step 5 read AbsMinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMinCoolSetpointLimit::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Saving value for comparision in step 5 read attribute MinSetpointDeadBand attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Saving value for comparision in step 6 read AbsMaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Saving value for comparision in step 17 read MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Saving value for comparision in step 17 read MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Saving value for comparision in step 17 read MaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Saving value for comparision in step 13 read attribute OccupiedCoolingSetpoint"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Saving value for comparision in step 15 read attribute AbsMinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMinHeatSetpointLimit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Saving value for comparision in step 15 read attribute AbsMaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Saving value for comparision in step 16 read UnoccupiedCoolingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2: Reads mandatory attributes from DUT: LocalTemperature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::LocalTemperature::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3: Read OutdoorTemperature attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OutdoorTemperature::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4: Read Occupancy attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::Occupancy::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 5a: Read attribute AbsMinHeatSetpointLimit if TSTAT.S.F05 feature is supported"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0003 && TSTAT.S.A0005 && TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMinHeatSetpointLimit::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5b: Read attribute AbsMinHeatSetpointLimit if TSTAT.S.F05 feature is supported"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0003 && !TSTAT.S.A0005 && TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMinHeatSetpointLimit::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 6a: Read attribute AbsMinHeatSetpointLimit from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0003 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMinHeatSetpointLimit::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 6b: Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 7: Read attribute AbsMinCoolSetpointLimit from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMinCoolSetpointLimit::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 8: Read attribute AbsMaxCoolSetpointLimit from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 9: Read PICoolingDemand attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::PICoolingDemand::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Step 10: Read PIHeatingDemand attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::PIHeatingDemand::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Step 11: Read HVACSystemTypeConfiguration attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::HVACSystemTypeConfiguration::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 12: Read LocalTemperatureCalibration attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::LocalTemperatureCalibration::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 13a: Read attribute OccupiedCoolingSetpoint from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017 && TSTAT.S.A0018"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 13b: Read attribute OccupiedCoolingSetpoint from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && !TSTAT.S.A0017 && !TSTAT.S.A0018"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Step 14a: Read attribute OccupiedHeatingSetpoint if TSTAT.S.F05 feature is supported"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 14b: Read attribute OccupiedHeatingSetpoint from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 15a: Read UnoccupiedCoolingSetpoint attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05 && TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 15b: Read UnoccupiedCoolingSetpoint attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Step 16a: Read UnoccupiedHeatingSetpoint attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02 && TSTAT.S.F05 && TSTAT.S.A0013"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "Step 16b: Read UnoccupiedHeatingSetpoint attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "Step 17a: Reads attribute from DUT: MinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0015 && TSTAT.S.F05 && TSTAT.S.A0017 && TSTAT.S.A0003"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, + "Step 17b: Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0015 && TSTAT.S.A0016 && TSTAT.S.A0003 && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 34: { + LogStep(34, + "Step 17c: Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0003 && !TSTAT.S.A0015 && !TSTAT.S.A0016 && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 35: { + LogStep(35, "Step 18a: Read attribute MaxHeatSetpointLimit from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0016 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 36: { + LogStep(36, "Step 18b: Reads attribute from DUT: MaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0016 && TSTAT.S.F05 && TSTAT.S.A0018"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 37: { + LogStep(37, "Step 19a: Read attribute MinCoolSetpointLimit from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0017 && TSTAT.S.A0018 && TSTAT.S.A0005"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, + true, chip::NullOptional); + } + case 38: { + LogStep(38, "Step 19b: Read attribute MinCoolSetpointLimit from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0017 && !TSTAT.S.A0018 && !TSTAT.S.A0005"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, + true, chip::NullOptional); + } + case 39: { + LogStep(39, "Step 20: Read attribute MaxCoolSetpointLimit from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0018 && TSTAT.S.A0006 && TSTAT.S.A0017"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + true, chip::NullOptional); + } + case 40: { + LogStep(40, "Step 21: Read attribute MinSetpointDeadBand from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, + true, chip::NullOptional); + } + case 41: { + LogStep(41, "Step 22: Read RemoteSensing attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::RemoteSensing::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "Step 23: Read attribute ControlSequenceOfOperation from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); + } + case 43: { + LogStep(43, "Step 24: Read attribute SystemMode from DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SystemMode::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Step 26: Read ThermostatRunningMode attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ThermostatRunningMode::Id, + true, chip::NullOptional); + } + case 45: { + LogStep(45, "Step 27: Reads constraints of optional attributes from DUT: StartOfWeek"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::StartOfWeek::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Step 28: Reads optional attributes from DUT: NumberOfWeeklyTransitions"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::NumberOfWeeklyTransitions::Id, true, chip::NullOptional); + } + case 47: { + LogStep(47, "Step 29: Reads optional attributes from DUT: NumberOfDailyTransitions"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::NumberOfDailyTransitions::Id, true, chip::NullOptional); + } + case 48: { + LogStep(48, "Step 30: Read TemperatureSetpointHold attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::TemperatureSetpointHold::Id, true, chip::NullOptional); + } + case 49: { + LogStep(49, "Step 31: Read TemperatureSetpointHoldDuration attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::TemperatureSetpointHoldDuration::Id, true, chip::NullOptional); + } + case 50: { + LogStep(50, "Step 32: Read ThermostatProgrammingOperationMode attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::ThermostatProgrammingOperationMode::Id, true, chip::NullOptional); + } + case 51: { + LogStep(51, "Step 33: Read ThermostatRunningState attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ThermostatRunningState::Id, + true, chip::NullOptional); + } + case 52: { + LogStep(52, "Step 34: Read SetpointChangeSource attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SetpointChangeSource::Id, + true, chip::NullOptional); + } + case 53: { + LogStep(53, "Step 35: Read SetpointChangeAmount attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SetpointChangeAmount::Id, + true, chip::NullOptional); + } + case 54: { + LogStep(54, "Step 36: Read SetpointChangeSourceTimestamp attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::SetpointChangeSourceTimestamp::Id, true, chip::NullOptional); + } + case 55: { + LogStep(55, "Step 37: Read OccupiedSetback attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetback::Id, true, + chip::NullOptional); + } + case 56: { + LogStep(56, "Step 38: Read OccupiedSetbackMin attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetbackMin::Id, + true, chip::NullOptional); + } + case 57: { + LogStep(57, "Step 39: Read OccupiedSetbackMax attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetbackMax::Id, + true, chip::NullOptional); + } + case 58: { + LogStep(58, "Step 40: Read UnoccupiedSetback attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetback::Id, + true, chip::NullOptional); + } + case 59: { + LogStep(59, "Step 41: Read UnoccupiedSetbackMin attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetbackMin::Id, + true, chip::NullOptional); + } + case 60: { + LogStep(60, "Step 42: Read UnoccupiedSetbackMax attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetbackMax::Id, + true, chip::NullOptional); + } + case 61: { + LogStep(61, "Step 43: Read EmergencyHeatDelta attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::EmergencyHeatDelta::Id, + true, chip::NullOptional); + } + case 62: { + LogStep(62, "Step 44: Read ACType attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0040"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACType::Id, true, + chip::NullOptional); + } + case 63: { + LogStep(63, "Step 45: Read ACCapacity attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0041"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCapacity::Id, true, + chip::NullOptional); + } + case 64: { + LogStep(64, "Step 46: Read ACRefrigerantType attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0042"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACRefrigerantType::Id, + true, chip::NullOptional); + } + case 65: { + LogStep(65, "Step 47: Read ACCompressorType attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0043"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCompressorType::Id, true, + chip::NullOptional); + } + case 66: { + LogStep(66, "Step 48: Read ACErrorCode attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0044"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACErrorCode::Id, true, + chip::NullOptional); + } + case 67: { + LogStep(67, "Step 49: Read ACLouverPosition attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0045"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACLouverPosition::Id, true, + chip::NullOptional); + } + case 68: { + LogStep(68, "Step 50: Read ACCoilTemperature attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0046"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCoilTemperature::Id, + true, chip::NullOptional); + } + case 69: { + LogStep(69, "Step 51: Read ACCapacityFormat attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0047"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCapacityformat::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TSUIC_1_1Suite : public TestCommand +{ +public: + Test_TC_TSUIC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_1_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TSUIC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH read ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: Read the global attribute: AttributeList. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 5a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 5b: Read the global attribute: AcceptedCommandList. 1. The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 6a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 6b: Read the global attribute: GeneratedCommandList. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, + "Step 7: Read EventList attribute from the DUT.For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TSUIC_2_1Suite : public TestCommand +{ +public: + Test_TC_TSUIC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_2_1", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TSUIC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute: TemperatureDisplayMode"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the mandatory attribute: KeypadLockout"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Read the optional attribute: ScheduleProgrammingVisibility"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TSUIC_2_2Suite : public TestCommand +{ +public: + Test_TC_TSUIC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_2_2", 37, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TSUIC_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureDisplayMode", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureDisplayMode", value, 1U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureDisplayMode", value, 1U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("keypadLockout", value, 0U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("keypadLockout", value, 1U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("keypadLockout", value, 2U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("keypadLockout", value, 3U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("keypadLockout", value, 4U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("keypadLockout", value, 5U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("keypadLockout", value, 5U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", value, 0U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", value, 1U)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", value, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2a: Writes a value of 0 to TemperatureDisplayMode attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Verify device temperature displayed in °C"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2b: TH reads the TemperatureDisplayMode attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Writes a value of 1 to TemperatureDisplayMode attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Verify device temperature displayed in °F"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 2d: TH reads the TemperatureDisplayMode attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2e: Writes a value of greater than 1 to TemperatureDisplayMode attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 2U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2f: TH reads the TemperatureDisplayMode attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3a: Writes a value of 0 to KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 10: { + LogStep(10, "Verify all device functionality available to the user"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 3b: TH reads the KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3c: Writes a value of 1 to KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 13: { + LogStep(13, "Verify device operates at Level 1 reduced functionality"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 3d: TH reads the KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3e: Writes a value of 2 to KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 2U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 16: { + LogStep(16, "Verify device operates at Level 2 reduced functionality"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 3f: TH reads the KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 3g: Writes a value of 3 to KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 3U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 19: { + LogStep(19, "Verify device operates at Level 3 reduced functionality"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 3h: TH reads the KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 3i: Writes a value of 4 to KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 4U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 22: { + LogStep(22, "Verify device operates at Level 4 reduced functionality"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 3j: TH reads the KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 3k: Writes a value of 5 to KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 5U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 25: { + LogStep(25, "Verify device operates at least functionality level"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 3l: TH reads the KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 3m: Writes a value of greater than 5 to KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 6U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 3n: TH reads the KeypadLockout attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 4a: Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 30: { + LogStep(30, "Verify local schedule programming functionality is enabled at the thermostat"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 4b: TH reads the ScheduleProgrammingVisibility attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Step 4c: Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 33: { + LogStep(33, "Verify local schedule programming functionality is disabled at the thermostat"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 34: { + LogStep(34, "Step 4d: TH reads the ScheduleProgrammingVisibility attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Step 4e: Writes a value of greater than 1 to ScheduleProgrammingVisibility attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 2U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 36: { + LogStep(36, "Step 4f: TH reads the ScheduleProgrammingVisibility attribute of DUT"); + VerifyOrDo(!ShouldSkip("TSUIC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, + ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGTHREAD_1_1Suite : public TestCommand +{ +public: + Test_TC_DGTHREAD_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_1_1", 24, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGTHREAD_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 59UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 60UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 61UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 62UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 59UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 60UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 61UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 62UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 21UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 22UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 24UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 25UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 29UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 30UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 31UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 32UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 33UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 34UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 35UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 36UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 37UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 38UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 39UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 40UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 42UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 43UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 44UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 45UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 46UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 47UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 48UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 49UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 50UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 51UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 52UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 53UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 54UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 55UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 56UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 57UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 58UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip(" !DGTHREAD.S.F00 && !DGTHREAD.S.F01 && !DGTHREAD.S.F02 && !DGTHREAD.S.F03 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given DGTHREAD.S.F00(PKTCNT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given DGTHREAD.S.F01(ERRCNT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given DGTHREAD.S.F02(MLECNT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given DGTHREAD.S.F03(MACCNT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4a: TH reads mandatory attributes in AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4a: TH reads mandatory attributes in AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4b: TH reads Feature dependent attribute(DGTHREAD.S.F01(ERRCNT)) in attributeList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0006 && DGTHREAD.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4c: TH reads Feature dependent attribute (DGTHREAD.S.F02(MLECNT)) in attributeList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4d: TH reads Feature dependent attribute (DGTHREAD.S.F03(MACCNT)) in attributeList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4e: Read the optional attribute (ActiveTimestamp) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4f: Read the optional attribute (PendingTimestamp) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4g: Read the optional attribute (Delay) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5a: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGTHREAD.S.E00 && !DGTHREAD.S.E01 && PICS_EVENT_LIST_ENABLED"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 5b: TH reads DGTHREAD.S.E00(ConnectionStatus) event in EventList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.E00 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 5c: TH reads DGTHREAD.S.E01(NetworkFaultChange) event in EventList"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.E01 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Step 5d: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 6a: TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGTHREAD.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 6b: TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 6c: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 22: { + LogStep(22, "Step 7a: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGTHREAD_2_1Suite : public TestCommand +{ +public: + Test_TC_DGTHREAD_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_2_1", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGTHREAD_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "octet_string", "octet_string")); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads Channel attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::Channel::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads RoutingRole attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RoutingRole::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, + "Step 4a: TH reads Network Name attribute value from DUT and Verify that Network name is of the type string"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::NetworkName::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "Step 4b: Read NetworkName attribute from DUT and verify response value, If value is NULL then verify that " + "RoutingRole is set to 1"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 5a: TH reads PanId attribute value from DUT and Verify that PanId is of the type uint16"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::PanId::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, + "Step 5b: Read PanId attribute from DUT and verify response value, If value is NULL then verify that " + "RoutingRole is set to 1"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 6a: TH reads ExtendedPanId attribute value from DUT and Verify that ExtendedPanId is of the type uint64"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 6b: Read ExtendedPanId attribute from DUT and verify response value, If value is NULL then verify that " + "RoutingRole is set to 1"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 7: Read MeshLocalPrefix attribute from DUT and verify response value, If value is NULL then verify that " + "RoutingRole is set to 1"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 8a: TH reads OverrunCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0006 && DGTHREAD.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::OverrunCount::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 8b: Read OverrunCount attribute from DUT and verify response value, If the Overruncount is greater than " + "zero or not"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, + "Step 9: Read NeighborTableList attribute from DUT and Verify that the NeighborTable List size is Zero or " + "greater and verify each node types"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, + "Step 10: Read RouteTable attribute from DUT and Verify that the RouteTableList List size is Zero or greater " + "and verify each node types"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 11: TH reads PartitionId attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::PartitionId::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 12: TH reads Weighting attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::Weighting::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 13: TH reads DataVersion attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::DataVersion::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 14: TH reads StableDataVersion attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 15: TH reads LeaderRouterId attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 16: TH reads DetachedRoleCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A000e && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 17: TH reads ChildRoleCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A000f && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 18: TH reads RouterRoleCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0010 && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 19: TH reads LeaderRoleCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0011 && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 20: TH reads AttachAttemptCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0012 && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 21: TH reads PartitionIdChangeCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0013 && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 22: TH reads BetterPartitionAttachAttemptCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0014 && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Step 23: TH reads ParentChangeCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0015 && DGTHREAD.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 24: TH reads ActiveTimestamp attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 25: TH reads PendingTimestamp attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 26: TH reads Delay attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::Delay::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Step 27: Read SecurityPolicy struct attribute from DUT and Verify the each field"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A003b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 28: TH reads ChannelPage0Mask attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ChannelPage0Mask::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "Step 29: Read OperationalDatasetComponents struct attribute from DUT and Verify the each field"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A003d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 33: { + LogStep(33, "Step 30: TH reads ActiveNetworkFaults attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGTHREAD_2_2Suite : public TestCommand +{ +public: + Test_TC_DGTHREAD_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_2_2", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGTHREAD_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads TxTotalCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads TxUnicastCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads TxBroadcastCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads TxAckRequestedCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads TxAckedCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads TxNoAckRequestedCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads TxDataCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A001c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxDataCount::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads TxDataPollCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A001d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads TxBeaconCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A001e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads TxBeaconRequestCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A001f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 12: TH reads TxOtherCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: TH reads TxRetryCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 14: TH reads TxDirectMaxRetryExpiryCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 15: TH reads TxIndirectMaxRetryExpiryCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 16: TH reads TxErrCcaCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 17: TH reads TxErrAbortCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 18: TH reads TxErrBusyChannelCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0026"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGTHREAD_2_3Suite : public TestCommand +{ +public: + Test_TC_DGTHREAD_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_2_3", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGTHREAD_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads RxTotalCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0027"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads RxUnicastCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0028"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads RxBroadcastCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads RxDataCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A002a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDataCount::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads RxDataPollCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A002b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads RxBeaconCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A002c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: TH reads RxBeaconRequestCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A002d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: TH reads RxOtherCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A002e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: TH reads RxAddressFilteredCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A002f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: TH reads RxDestAddrFilteredCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 12: TH reads RxDuplicatedCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: TH reads RxErrNoFrameCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 14: TH reads RxErrUnknownNeighborCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0033"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 15: TH reads RxErrInvalidSrcAddrCount attribute value from DUT and verify data type"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0034"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 16: TH reads RxErrSecCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0035"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 17: TH reads RxErrFcsCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0036"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 18: TH reads RxErrOtherCount attribute value from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0037"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGTHREAD_2_4Suite : public TestCommand +{ +public: + Test_TC_DGTHREAD_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_2_4", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGTHREAD_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("overrunCount", value, 0ULL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Sends ResetCounts command"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Commands::ResetCounts::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 3: Read the Overruncount attribute"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::OverrunCount::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TIMESYNC_1_1Suite : public TestCommand +{ +public: + Test_TC_TIMESYNC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TIMESYNC_1_1", 40, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TIMESYNC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 2U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 11UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 12UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 9UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TS2: read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TS3: Given TIMESYNC.S.F00(TZ) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TS3: Given !TIMESYNC.S.F00(TZ) ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TS3: Given TIMESYNC.S.F01(NTPC) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TS3: Given !TIMESYNC.S.F01(NTPC) ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TS3: Given TIMESYNC.S.F02(NTPS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TS3: Given !TIMESYNC.S.F02(NTPS) ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TS3: Given TIMESYNC.S.F03(TSC) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TS3: Given !TIMESYNC.S.F03(TSC) ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TS4: Check for mandatory attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TS4: Check for mandatory attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "TS4: Check for optional attribute TimeSource in AttributeList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "TS4: Check for optional attribute TimeSource not in AttributeList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "TS4: Check for TZ feature-based attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "TS4: Check for TZ feature-based attributes not in AttributeList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "TS4: Check for NTPC feature-based attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "TS4: Check for NTPC feature-based attributes not in AttributeList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "TS4: Check for NTPS feature-based attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "TS4: Check for NTPS feature-based attributes not in AttributeList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "TS4: Check for TSC feature-based attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "TS4: Check for TSC feature-based attributes not in AttributeList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "TS4: Check for mandatory attributes in AttributeList. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "TS5: Check for mandatory events in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::EventList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "TS5: Check for TZ feature-based events in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::EventList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "TS5: Check for TZ feature-based events not in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && !TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "TS5: Check for TSC feature-based events in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::EventList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "TS5: Check for TSC feature-based events not in EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED && !TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::EventList::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, + "TS5: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 29: { + LogStep(29, "TS6: Check for mandatory commands in AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "TS6: Check for TZ feature-based commands in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "TS6: Check for TZ feature-based commands in not AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "TS6: Check for NTPC feature-based commands in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, "TS6: Check for NTPC feature-based commands in not AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 34: { + LogStep(34, "TS6: Check for TSC feature-based commands in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 35: { + LogStep(35, "TS6: Check for TSC feature-based commands in not AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 36: { + LogStep(36, + "TS6: Check for mandatory commands in AcceptedCommandList. 1. The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 37: { + LogStep(37, "TS7: Check for TZ feature-based commands in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 38: { + LogStep(38, "TS7: Check for TZ feature-based commands in not GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("!TIMESYNC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 39: { + LogStep(39, + "TS7: Check for mandatory commands in GeneratedCommandList. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TIMESYNC_2_3Suite : public TestCommand +{ +public: + Test_TC_TIMESYNC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TIMESYNC_2_3", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TIMESYNC_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::NodeId th_node_id; + uint8_t th_fabric_idx; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + th_node_id = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + th_fabric_idx = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable< + chip::app::Clusters::TimeSynchronization::Structs::TrustedTimeSourceStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("trustedTimeSource", value)); + VerifyOrReturn(CheckValue("trustedTimeSource.Value().fabricIndex", value.Value().fabricIndex, th_fabric_idx)); + VerifyOrReturn(CheckValue("trustedTimeSource.Value().nodeID", value.Value().nodeID, th_node_id)); + VerifyOrReturn(CheckValue("trustedTimeSource.Value().endpoint", value.Value().endpoint, 0U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable< + chip::app::Clusters::TimeSynchronization::Structs::TrustedTimeSourceStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("trustedTimeSource", value)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read commissioner nodeID and saves as th_node_id"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, + "Step 1: TH sends the SetTrustedTimeSource command to the DUT with the TrustedTimeSource fields set as " + "follows: NodeID: th_node_id, Endpoint: 0"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Type value; + value.trustedTimeSource.SetNonNull(); + + value.trustedTimeSource.Value().nodeID = th_node_id; + value.trustedTimeSource.Value().endpoint = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTrustedTimeSource::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2: TH reads from the DUT the CurrentFabricIndex attribute from the Node Operational Credentials Cluster " + "and saves as th_fabric_idx"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3: TH reads from the DUT the TrustedTimeSource attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TrustedTimeSource::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4: TH sends the SetTrustedTimeSource command to the DUT with the TrustedTimeSource set to null."); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Type value; + value.trustedTimeSource.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTrustedTimeSource::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 5: TH reads from the DUT the TrustedTimeSource attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TrustedTimeSource::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ULABEL_1_1Suite : public TestCommand +{ +public: + Test_TC_ULABEL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ULABEL_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ULABEL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, + "Step 4b: Read the global attribute: AttributeList. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Step 5: Read the global attribute: EventList. 1.The list MAY contain values in the Manufacturer Extensible " + "Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1), " + "these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid range: " + "(0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "Step 6: Read the global attribute: AcceptedCommandList. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, + "Step 7: Read the global attribute: GeneratedCommandList. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ULABEL_2_1Suite : public TestCommand +{ +public: + Test_TC_ULABEL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ULABEL_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ULABEL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads LabelList attribute of the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ULABEL_2_2Suite : public TestCommand +{ +public: + Test_TC_ULABEL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ULABEL_2_2", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ULABEL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 0)); + VerifyOrReturn( + CheckValueAsString("labelList[0].label", iter_0.GetValue().label, chip::CharSpan("roomName", 8))); + VerifyOrReturn( + CheckValueAsString("labelList[0].value", iter_0.GetValue().value, chip::CharSpan("master bedroom 1", 16))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 1)); + VerifyOrReturn( + CheckValueAsString("labelList[1].label", iter_0.GetValue().label, chip::CharSpan("Orientation", 11))); + VerifyOrReturn(CheckValueAsString("labelList[1].value", iter_0.GetValue().value, chip::CharSpan("east", 4))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 2)); + VerifyOrReturn(CheckValueAsString("labelList[2].label", iter_0.GetValue().label, chip::CharSpan("floor", 5))); + VerifyOrReturn(CheckValueAsString("labelList[2].value", iter_0.GetValue().value, chip::CharSpan("2", 1))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 3)); + VerifyOrReturn( + CheckValueAsString("labelList[3].label", iter_0.GetValue().label, chip::CharSpan("roomType", 8))); + VerifyOrReturn(CheckValueAsString("labelList[3].value", iter_0.GetValue().value, chip::CharSpan("bedroom", 7))); + VerifyOrReturn(CheckNoMoreListItems("labelList", iter_0, 4)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 4)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH writes LabelList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("roomNamegarbage: not in length on purpose", 8); + listHolder_0->mList[0].value = chip::Span("master bedroom 1garbage: not in length on purpose", 16); + + listHolder_0->mList[1].label = chip::Span("Orientationgarbage: not in length on purpose", 11); + listHolder_0->mList[1].value = chip::Span("eastgarbage: not in length on purpose", 4); + + listHolder_0->mList[2].label = chip::Span("floorgarbage: not in length on purpose", 5); + listHolder_0->mList[2].value = chip::Span("2garbage: not in length on purpose", 1); + + listHolder_0->mList[3].label = chip::Span("roomTypegarbage: not in length on purpose", 8); + listHolder_0->mList[3].value = chip::Span("bedroomgarbage: not in length on purpose", 7); + + value = + chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH reads LabelList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ULABEL_2_3Suite : public TestCommand +{ +public: + Test_TC_ULABEL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ULABEL_2_3", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ULABEL_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH writes LabelList attribute of the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("roomgarbage: not in length on purpose", 4); + listHolder_0->mList[0].value = + chip::Span("17_bytesIsTooLongforuserlabelnotexpectedgarbage: not in length on purpose", 40); + + value = + chip::app::DataModel::List(listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH writes LabelList attribute of the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = + chip::Span("17_bytesIsTooLongforuserlabelnotexpectedgarbage: not in length on purpose", 40); + listHolder_0->mList[0].value = chip::Span("foobargarbage: not in length on purpose", 6); + + value = + chip::app::DataModel::List(listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ULABEL_2_4Suite : public TestCommand +{ +public: + Test_TC_ULABEL_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ULABEL_2_4", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ULABEL_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("labelList[0].label", iter_0.GetValue().label, chip::CharSpan("room", 4))); + VerifyOrReturn( + CheckValueAsString("labelList[0].value", iter_0.GetValue().value, chip::CharSpan("bedroom 1", 9))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 1)); + VerifyOrReturn( + CheckValueAsString("labelList[1].label", iter_0.GetValue().label, chip::CharSpan("Orientation", 11))); + VerifyOrReturn(CheckValueAsString("labelList[1].value", iter_0.GetValue().value, chip::CharSpan("east", 4))); + VerifyOrReturn(CheckNoMoreListItems("labelList", iter_0, 2)); + } + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("labelList[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueAsString("labelList[0].value", iter_0.GetValue().value, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("labelList", iter_0, 1)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH writes LabelList attribute of the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("roomgarbage: not in length on purpose", 4); + listHolder_0->mList[0].value = chip::Span("bedroom 1garbage: not in length on purpose", 9); + + listHolder_0->mList[1].label = chip::Span("Orientationgarbage: not in length on purpose", 11); + listHolder_0->mList[1].value = chip::Span("eastgarbage: not in length on purpose", 4); + + value = + chip::app::DataModel::List(listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: TH reads LabelList attribute of the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: TH writes LabelList attribute of the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("garbage: not in length on purpose", 0); + listHolder_0->mList[0].value = chip::Span("garbage: not in length on purpose", 0); + + value = + chip::app::DataModel::List(listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH reads LabelList attribute of the DUT"); + VerifyOrDo(!ShouldSkip("ULABEL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGWIFI_1_1Suite : public TestCommand +{ +public: + Test_TC_DGWIFI_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGWIFI_1_1", 17, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGWIFI_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip("( !DGWIFI.S.F00 && !DGWIFI.S.F01 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given DGWIFI.S.F00(PacketCounts) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given DGWIFI.S.F01(ErrorCounts) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4b: TH reads Feature dependent(DGWIFI.S.F00) attributes in attributeList from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4c: TH reads Feature dependent(DGWIFI.S.F01) attributes in attributeList from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4d: TH reads optional attribute (CurrentMaxRate) in AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 5a: TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGWIFI.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 5b: TH reads Feature dependent(DGWIFI.S.F01) command in AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 6: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 7a: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGWIFI.S.E00 && !DGWIFI.S.E01 && !DGWIFI.S.E02 && PICS_EVENT_LIST_ENABLED"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 7b: TH reads optional attribute (Disconnection) in EventList from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.E00 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 7c: TH reads optional attribute (AssociationFailure) in EventList from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.E01 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 7d: TH reads optional attribute (ConnectionStatus) in EventList from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.E02 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGWIFI_2_1Suite : public TestCommand +{ +public: + Test_TC_DGWIFI_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGWIFI_2_1", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGWIFI_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "octet_string", "octet_string")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8s", "int8s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -120)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 0)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int64u", "int64u")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads BSSID attribute from DUT"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::Bssid::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Reads SecurityType attribute constraints"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::SecurityType::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Reads WiFiVersion attribute constraints"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Reads ChannelNumber attribute constraints"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: Reads RSSI attribute constraints"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::Rssi::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: Reads BeaconLostCount attribute constraints"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 8: Reads BeaconRxCount attribute constraints"); + VerifyOrDo(!ShouldSkip("DGWIFI.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 9: Reads PacketMulticastRxCount attribute constraints"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 10: Reads PacketMulticastTxCount attribute constraints"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 11: Reads PacketUnicastRxCount attribute constraints"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 12: Reads PacketUnicastTxCount attribute constraints"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 13: Reads CurrentMaxRate attribute constraints"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 14: Reads OverrunCount attribute constraints"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::OverrunCount::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGWIFI_2_3Suite : public TestCommand +{ +public: + Test_TC_DGWIFI_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGWIFI_2_3", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGWIFI_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967295UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: TWait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH sends ResetCounts command to DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Commands::ResetCounts::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 2a: Reads BeaconLostCount attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.C00.Rsp && DGWIFI.S.A0005"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: Reads BeaconRxCount attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.C00.Rsp && DGWIFI.S.A0006"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2c: Reads PacketMulticastRxCount attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.C00.Rsp && DGWIFI.S.A0007"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2d: Reads PacketMulticastTxCount attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.C00.Rsp && DGWIFI.S.A0008"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2e: Reads PacketUnicastRxCount attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.C00.Rsp && DGWIFI.S.A0009"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2f: Reads PacketUnicastTxCount attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DGWIFI.S.C00.Rsp && DGWIFI.S.A000a"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_1_1Suite : public TestCommand +{ +public: + Test_TC_WNCV_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_1_1", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 200U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the (0xFFFD) ClusterRevision attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads from the DUT the (0xFFFC) FeatureMap attribute"); + VerifyOrDo(!ShouldSkip("!WNCV.S.F00 && !WNCV.S.F01 && !WNCV.S.F02 && !WNCV.S.F03 && !WNCV.S.F04 "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given WNCV.S.F00(LF) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given WNCV.S.F01(TL) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given WNCV.S.F02(PA_LF) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("WNCV.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given WNCV.S.F03(ABS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("WNCV.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given WNCV.S.F04(PA_TL) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("WNCV.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4a: TH reads from the DUT the (0xFFFB) AttributeList attribute"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4a: TH reads from the DUT the (0xFFFB) AttributeList attribute"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4b: TH reads optional attribute(SafetyStatus) in AttributeList"); + VerifyOrDo(!ShouldSkip("WNCV.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4c: Read the Feature dependent(WNCV.S.F00 & WNCV.S.F02 & WNCV.S.F03) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4d: Read the Feature dependent(WNCV.S.F00 & WNCV.S.F02 ) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 4e: Read the Feature dependent(WNCV.S.F01 & WNCV.S.F04 & WNCV.S.F03) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4f: Read the Feature dependent(WNCV.S.F01 & WNCV.S.F04 ) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5: Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 6a: TH reads from the DUT the (0xFFF9) AcceptedCommandList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 6b: TH reads Feature dependent(WNCV.S.F00 & WNCV.S.F02) command in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 6c: TH reads Feature dependent(WNCV.S.F01 & WNCV.S.F03) command in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 6d: TH reads Feature dependent(WNCV.S.F01 & WNCV.S.F04) command in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 7: TH reads from the DUT the (0xFFF8) GeneratedCommandList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_2_1Suite : public TestCommand +{ +public: + Test_TC_WNCV_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_2_1", 26, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t InstalledOpenLimitLift; + uint16_t InstalledClosedLimitLift; + uint16_t InstalledOpenLimitTilt; + uint16_t InstalledClosedLimitTilt; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::WindowCovering::Type value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::WindowCovering::EndProductType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 23U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 15U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + InstalledOpenLimitLift = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + InstalledClosedLimitLift = value; + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + InstalledOpenLimitTilt = value; + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + InstalledClosedLimitTilt = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap16", "bitmap16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2047U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, InstalledOpenLimitLift)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, InstalledClosedLimitLift)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, InstalledOpenLimitTilt)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, InstalledClosedLimitTilt)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: read the RO mandatory attribute default: Type"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Type::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: read the RO mandatory attribute default: ConfigStatus"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 1c: read the RO mandatory attribute default: OperationalStatus"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1d: read the RO mandatory attribute default: EndProductType"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::EndProductType::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1e: read the RW mandatory attribute default: Mode"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 1f: write a value into the RW mandatory attribute:: Mode"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2a: read the RO optional attribute default: TargetPositionLiftPercent100ths"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2b: read the RO optional attribute default: TargetPositionTiltPercent100ths"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 2c: read the RO optional attribute default: CurrentPositionLiftPercent100ths"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 2d: read the RO optional attribute default: CurrentPositionTiltPercent100ths"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2e: read the RO optional attribute default: InstalledOpenLimitLift"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::InstalledOpenLimitLift::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 2f: read the RO optional attribute default: InstalledClosedLimitLift"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::InstalledClosedLimitLift::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 2g: read the RO optional attribute default: InstalledOpenLimitTilt"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::InstalledOpenLimitTilt::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 2h: read the RO optional attribute default: InstalledClosedLimitTilt"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::InstalledClosedLimitTilt::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3a: read the RO mandatory attribute default: SafetyStatus"); + VerifyOrDo(!ShouldSkip("WNCV.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::SafetyStatus::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3b: read the RO optional attribute default: PhysicalClosedLimitLift"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::PhysicalClosedLimitLift::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 3c: read the RO optional attribute default: PhysicalClosedLimitTilt"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::PhysicalClosedLimitTilt::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 3d: read the RO optional attribute default: CurrentPositionLift"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0003 && !WNCV.S.A0010 && !WNCV.S.A0011"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLift::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 3d: read the RO optional attribute default: CurrentPositionLift"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0003 && WNCV.S.A0010 && WNCV.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLift::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 3e: read the RO optional attribute default: CurrentPositionTilt"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0004 && !WNCV.S.A0012 && !WNCV.S.A0013"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTilt::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 3e: read the RO optional attribute default: CurrentPositionTilt"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0004 && WNCV.S.A0012 && WNCV.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTilt::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 3f: read the RO optional attribute default: NumberOfActuationsLift"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::NumberOfActuationsLift::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 3g: read the RO optional attribute default: NumberOfActuationsTilt"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::NumberOfActuationsTilt::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 3h: read the RO optional attribute default: CurrentPositionLiftPercentage"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Step 3i:read the RO optional attribute default: CurrentPositionTiltPercentage"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_2_2Suite : public TestCommand +{ +public: + Test_TC_WNCV_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_2_2", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "Step 1a: Reads ConfigStatus attribute from DUT, if (WNCV.S.F00(LF) & WNCV.S.F02(PA_LF)) value of bit 3 must " + "be 1b else 0b"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0007 && WNCV.S.F00 && WNCV.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, + "Step 1b: Reads ConfigStatus attribute from DUT, if (WNCV.S.F00(LF) & WNCV.S.F02(PA_LF)) value of bit 3 must " + "be 1b else 0b"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0007 && !WNCV.S.F00 && !WNCV.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, + "Step 1c: Reads ConfigStatus attribute from DUT, if (WNCV.S.F01(TL) & WNCV.S.F04(PA_TL)) value of bit 4 must " + "be 1b else 0b,"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0007 && WNCV.S.F01 && WNCV.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, + "Step 1d: Reads ConfigStatus attribute from DUT, if (WNCV.S.F01(TL) & WNCV.S.F04(PA_TL)) value of bit 4 must " + "be 1b else 0b,"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0007 && !WNCV.S.F01 && !WNCV.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1e: Reads ConfigStatus attribute from DUT, value of bit 0 must be 1b (operational)"); + VerifyOrDo(!ShouldSkip("WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_2_3Suite : public TestCommand +{ +public: + Test_TC_WNCV_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_2_3", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::BitMask configStatusValA; + chip::BitMask configStatusValB; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + configStatusValA = value; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_BUSY)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + configStatusValB = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH set the Mode Attribute bit0 of the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Reversal && WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(1U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH reads ConfigStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Reversal && WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 1c: TH clear the Mode Attribute bit0 of the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Reversal && WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1d: TH reads ConfigStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Reversal && WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 2a: TH set the Mode Attribute bit1 of the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Calibration && WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(2U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 2b: TH reads ConfigStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Calibration && WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2c: If (ConfigStatus bit0 == 0) TH send DownOrClose command to the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Calibration && WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 2d: TH clear the Mode Attribute bit1 of the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Calibration && WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 2e: TH reads ConfigStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Calibration && WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 2f: TH reads the Mode Attribute from the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Calibration && WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2g: TH send DownOrClose command to the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Calibration && WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 3a: TH set the Mode Attribute bit2 of the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Maintenance && WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(4U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3b: TH send DownOrClose command to the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Maintenance && WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Step 3c: TH reads ConfigStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Maintenance && WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3d: TH clear the Mode Attribute bit2 of the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Maintenance && WNCV.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3e: TH send DownOrClose command to the DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Maintenance && WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Step 3f: TH reads ConfigStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.M.Maintenance && WNCV.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::ConfigStatus::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_2_5Suite : public TestCommand +{ +public: + Test_TC_WNCV_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_2_5", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::WindowCovering::EndProductType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 23U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads EndProductType attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::EndProductType::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_1Suite : public TestCommand +{ +public: + Test_TC_WNCV_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_3_1", 30, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionLiftPercent100ths.Value()", value.Value(), 0U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionTiltPercent100ths.Value()", value.Value(), 0U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 99U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 99U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: TH Waits for 10 seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2: Subscribe to DUT reports on OperationalStatus attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, 4, 5, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2a: TH sends UpOrOpen command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::UpOrOpen::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 2b: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2d: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 2e: TH leave the device moving for 2 seconds"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 3a: TH reads OperationalStatus attribute's bit 0..1"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && WNCV.S.F00 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && !WNCV.S.F00 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && WNCV.S.F01 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && !WNCV.S.F01 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 3a: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 3a2: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 3000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 4a: TH sends a StopMotion command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::StopMotion::Id, value, + chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Step 4b: TH waits for 3 seconds the end of inertial movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 3000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 5a: TH waits for x seconds attributes update on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_2Suite : public TestCommand +{ +public: + Test_TC_WNCV_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_3_2", 30, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 99U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 99U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionLiftPercent100ths.Value()", value.Value(), 10000U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionTiltPercent100ths.Value()", value.Value(), 10000U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16U)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "Percent100ths", "Percent100ths")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::UpOrOpen::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: TH Waits for 10 seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 2: Subscribe to DUT reports on OperationalStatus attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, 4, 5, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2a: TH sends DownOrClose command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 2b: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2d: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 2e: TH leave the device moving for 2 seconds"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 3a: TH reads OperationalStatus attribute's bit 0..1"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && WNCV.S.F00 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && !WNCV.S.F00 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && WNCV.S.F01 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a && !WNCV.S.F01 && PICS_SDK_CI_ONLY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 3a: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 3a2: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 3000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Step 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 4a: TH sends a StopMotion command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::StopMotion::Id, value, + chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Step 4b: TH waits for 3 seconds the end of inertial movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 3000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 5a: TH waits for x seconds attributes update on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Step 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_3Suite : public TestCommand +{ +public: + Test_TC_WNCV_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_3_3", 17, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable attrCurrentPositionLift; + chip::app::DataModel::Nullable attrCurrentPositionTilt; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + attrCurrentPositionLift = value; + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (attrCurrentPositionLift.IsNull()) + { + VerifyOrReturn(CheckValueNull("targetPositionLiftPercent100ths", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("targetPositionLiftPercent100ths", value)); + VerifyOrReturn( + CheckValue("targetPositionLiftPercent100ths.Value()", value.Value(), attrCurrentPositionLift.Value())); + } + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + attrCurrentPositionTilt = value; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (attrCurrentPositionTilt.IsNull()) + { + VerifyOrReturn(CheckValueNull("targetPositionTiltPercent100ths", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("targetPositionTiltPercent100ths", value)); + VerifyOrReturn( + CheckValue("targetPositionTiltPercent100ths.Value()", value.Value(), attrCurrentPositionTilt.Value())); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: TH Waits for 6-8 seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 1c: TH sends UpOrOpen command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::UpOrOpen::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 1d: TH Waits for 2 seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 1e: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 1d: TH Waits for 2 seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2: Subscribe to DUT reports on OperationalStatus attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, 4, 5, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2a: TH sends a StopMotion command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::StopMotion::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 2b: TH waits for 3 seconds the end of inertial movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 3000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 2c: TH reads OperationalStatus attribute from DUT after a StopMotion"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 2d: TH waits for 100ms - 3s attributes update on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 2e: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be equal with " + "CurrentPositionLiftPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b && WNCV.S.A000e"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be equal with " + "CurrentPositionTiltPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000c && WNCV.S.A000f && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_4Suite : public TestCommand +{ +public: + Test_TC_WNCV_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_3_4", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_3_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFastMotionDuration; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercent100ths.Value()", value.Value(), 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercentage.Value()", value.Value(), 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercent100ths.Value()", value.Value(), 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercentage.Value()", value.Value(), 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: TH Waits for fastMotionDuration seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2a: TH sends UpOrOpen command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::UpOrOpen::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 2b: TH Waits for fullMotionDuration seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2c: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_5Suite : public TestCommand +{ +public: + Test_TC_WNCV_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_3_5", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_3_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFastMotionDuration; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercent100ths.Value()", value.Value(), 10000U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercentage.Value()", value.Value(), 100U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercent100ths.Value()", value.Value(), 10000U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercentage.Value()", value.Value(), 100U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::UpOrOpen::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: TH Waits for fastMotionDuration seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2a: TH sends DownOrClose command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 2b: TH Waits for fullMotionDuration seconds movement(s) on the device"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 2c: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_1Suite : public TestCommand +{ +public: + Test_TC_WNCV_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_4_1", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionLiftPercent100ths.Value()", value.Value(), 2500U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercent100ths.Value()", value.Value(), 2500U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercentage.Value()", value.Value(), 25U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionLiftPercent100ths.Value()", value.Value(), 7520U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercent100ths.Value()", value.Value(), 7520U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercentage.Value()", value.Value(), 75U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: TH waits for x seconds movement(s) on the DUT"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2a: TH sends GoToLiftPercentage command with 25 percent to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; + value.liftPercent100thsValue = 2500U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, + value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 2b: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3a: TH set a timeout of X minutes for failure"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 3b: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4a: TH sends GoToLiftPercentage command with 75.20 percent to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; + value.liftPercent100thsValue = 7520U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, + value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 4b: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 4c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 5a: TH waits for x seconds movement(s) on the DUT"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 5b: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 5c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 5d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_2Suite : public TestCommand +{ +public: + Test_TC_WNCV_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_4_2", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_4_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionTiltPercent100ths.Value()", value.Value(), 3000U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercent100ths.Value()", value.Value(), 3000U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercentage.Value()", value.Value(), 30U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("targetPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("targetPositionTiltPercent100ths.Value()", value.Value(), 6005U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalStatus", value, 0U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercent100ths.Value()", value.Value(), 6005U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercentage.Value()", value.Value(), 60U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"); + VerifyOrDo(!ShouldSkip("WNCV.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::DownOrClose::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1b: TH waits for x seconds movement(s) on the DUT"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 1c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2a: TH sends GoToTiltPercentage command with 30 percent to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type value; + value.tiltPercent100thsValue = 3000U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToTiltPercentage::Id, + value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 2b: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 2c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3a: TH set a timeout of X minutes for failure"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 3b: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4a: TH sends GoToTiltPercentage command with 60.05 percent to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type value; + value.tiltPercent100thsValue = 6005U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToTiltPercentage::Id, + value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 4b: DUT updates its attributes"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 4c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 5a: TH waits for x seconds movement(s) on the DUT"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 5b: TH reads OperationalStatus attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::OperationalStatus::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 5c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 5d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_3Suite : public TestCommand +{ +public: + Test_TC_WNCV_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_4_3", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_4_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable attrCurrentPositionLiftPercent100ths; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + attrCurrentPositionLiftPercent100ths = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercentage.Value()", value.Value(), + static_cast(attrCurrentPositionLiftPercent100ths.Value() / 100))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, + "Step 1b 1c: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT + assert " + "CurrentPositionLiftPercent100ths/100 equals CurrentPositionLiftPercentage"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008 && WNCV.S.A000e"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: TH sends GoToLiftPercentage command with BadParam to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 || WNCV.S.F00 && WNCV.S.C05.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; + value.liftPercent100thsValue = 12288U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3a: TH sends GoToLiftPercentage command with 10001 to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 || WNCV.S.F00 && WNCV.S.C05.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; + value.liftPercent100thsValue = 10001U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, + value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 || WNCV.S.F00 && WNCV.S.C05.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; + value.liftPercent100thsValue = 65535U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, + value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_4Suite : public TestCommand +{ +public: + Test_TC_WNCV_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_4_4", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_4_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable attrCurrentPositionTiltPercent100ths; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + attrCurrentPositionTiltPercent100ths = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercentage", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercentage.Value()", value.Value(), + static_cast(attrCurrentPositionTiltPercent100ths.Value() / 100))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, + "Step 1b 1c: If (PA_LF & LF) TH reads CurrentPositionTiltPercentage from DUT + assert " + "CurrentPositionTiltPercent100ths/100 equals CurrentPositionTiltPercentage"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f && WNCV.S.A0009"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2b: TH sends GoToTiltPercentage command with BadParam to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 || WNCV.S.F01 && WNCV.S.C08.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type value; + value.tiltPercent100thsValue = 12288U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToTiltPercentage::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3a: TH sends GoToTiltPercentage command with 10001 to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 || WNCV.S.F01 && WNCV.S.C08.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type value; + value.tiltPercent100thsValue = 10001U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToTiltPercentage::Id, + value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 || WNCV.S.F01 && WNCV.S.C08.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type value; + value.tiltPercent100thsValue = 65535U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToTiltPercentage::Id, + value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_5Suite : public TestCommand +{ +public: + Test_TC_WNCV_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_4_5", 17, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WNCV_4_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable attrCurrentPositionLiftPercent100ths; + chip::app::DataModel::Nullable attrCurrentPositionTiltPercent100ths; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 0U)); + attrCurrentPositionLiftPercent100ths = value; + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 0U)); + attrCurrentPositionTiltPercent100ths = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (attrCurrentPositionLiftPercent100ths.IsNull()) + { + VerifyOrReturn(CheckValueNull("currentPositionLiftPercent100ths", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("currentPositionLiftPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionLiftPercent100ths.Value()", value.Value(), + attrCurrentPositionLiftPercent100ths.Value())); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (attrCurrentPositionTiltPercent100ths.IsNull()) + { + VerifyOrReturn(CheckValueNull("currentPositionTiltPercent100ths", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("currentPositionTiltPercent100ths", value)); + VerifyOrReturn(CheckValue("currentPositionTiltPercent100ths.Value()", value.Value(), + attrCurrentPositionTiltPercent100ths.Value())); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0a: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0b: TH sends UpOrOpen command to preposition the DUT"); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::UpOrOpen::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Step 1a: If (PA_LF & LF) TH sends GoToLiftPercentage command with 90%% to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.C05.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; + value.liftPercent100thsValue = 9000U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, + value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1b: TH Waits for 100ms-1s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 1c: TH sends StopMotion command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::StopMotion::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 1d: TH Waits for 100ms-1s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 500UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 2a: If (PA_TL & TL) TH sends GoToTiltPercentage command with 90%% to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.C08.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type value; + value.tiltPercent100thsValue = 9000U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToTiltPercentage::Id, + value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 2b: TH Waits for 100ms-1s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 2c: TH sends StopMotion command to DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::StopMotion::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 2d: TH Waits for 100ms-1s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 500UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 3a: TH reads CurrentPositionLiftPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3b: TH reads CurrentPositionTiltPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3c: reboot/restart the DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 3d: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 3e: TH reads CurrentPositionLiftPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 3f: TH reads CurrentPositionTiltPercent100ths from DUT"); + VerifyOrDo(!ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, + WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_TargetNavigatorClusterSuite : public TestCommand +{ +public: + TV_TargetNavigatorClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_TargetNavigatorCluster", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_TargetNavigatorClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("targetList", iter_0, 0)); + VerifyOrReturn(CheckValue("targetList[0].identifier", iter_0.GetValue().identifier, 1U)); + VerifyOrReturn( + CheckValueAsString("targetList[0].name", iter_0.GetValue().name, chip::CharSpan("exampleName", 11))); + VerifyOrReturn(CheckNextListItemDecodes("targetList", iter_0, 1)); + VerifyOrReturn(CheckValue("targetList[1].identifier", iter_0.GetValue().identifier, 2U)); + VerifyOrReturn( + CheckValueAsString("targetList[1].name", iter_0.GetValue().name, chip::CharSpan("exampleName", 11))); + VerifyOrReturn(CheckNoMoreListItems("targetList", iter_0, 2)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentTarget", value, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute Target Navigator list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, TargetNavigator::Attributes::TargetList::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute current navigator target"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::CurrentTarget::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Navigate Target Request Command"); + ListFreer listFreer; + chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type value; + value.target = 1U; + value.data.Emplace(); + value.data.Value() = chip::Span("1garbage: not in length on purpose", 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, TargetNavigator::Commands::NavigateTarget::Id, + value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_AudioOutputClusterSuite : public TestCommand +{ +public: + TV_AudioOutputClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_AudioOutputCluster", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_AudioOutputClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("outputList", iter_0, 0)); + VerifyOrReturn(CheckValue("outputList[0].index", iter_0.GetValue().index, 1U)); + VerifyOrReturn(CheckValue("outputList[0].outputType", iter_0.GetValue().outputType, 0U)); + VerifyOrReturn(CheckValueAsString("outputList[0].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckNextListItemDecodes("outputList", iter_0, 1)); + VerifyOrReturn(CheckValue("outputList[1].index", iter_0.GetValue().index, 2U)); + VerifyOrReturn(CheckValue("outputList[1].outputType", iter_0.GetValue().outputType, 0U)); + VerifyOrReturn(CheckValueAsString("outputList[1].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckNextListItemDecodes("outputList", iter_0, 2)); + VerifyOrReturn(CheckValue("outputList[2].index", iter_0.GetValue().index, 3U)); + VerifyOrReturn(CheckValue("outputList[2].outputType", iter_0.GetValue().outputType, 0U)); + VerifyOrReturn(CheckValueAsString("outputList[2].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckNoMoreListItems("outputList", iter_0, 3)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentOutput", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("outputList", iter_0, 0)); + VerifyOrReturn(CheckValue("outputList[0].index", iter_0.GetValue().index, 1U)); + VerifyOrReturn(CheckValue("outputList[0].outputType", iter_0.GetValue().outputType, 0U)); + VerifyOrReturn( + CheckValueAsString("outputList[0].name", iter_0.GetValue().name, chip::CharSpan("HDMI Test", 9))); + VerifyOrReturn(CheckNextListItemDecodes("outputList", iter_0, 1)); + VerifyOrReturn(CheckValue("outputList[1].index", iter_0.GetValue().index, 2U)); + VerifyOrReturn(CheckValue("outputList[1].outputType", iter_0.GetValue().outputType, 0U)); + VerifyOrReturn(CheckValueAsString("outputList[1].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckNextListItemDecodes("outputList", iter_0, 2)); + VerifyOrReturn(CheckValue("outputList[2].index", iter_0.GetValue().index, 3U)); + VerifyOrReturn(CheckValue("outputList[2].outputType", iter_0.GetValue().outputType, 0U)); + VerifyOrReturn(CheckValueAsString("outputList[2].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckNoMoreListItems("outputList", iter_0, 3)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute Audio Output list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::OutputList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute current audio output"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::CurrentOutput::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Select Output Command"); + ListFreer listFreer; + chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type value; + value.index = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Commands::SelectOutput::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Rename Output Command"); + ListFreer listFreer; + chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type value; + value.index = 1U; + value.name = chip::Span("HDMI Testgarbage: not in length on purpose", 9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Commands::RenameOutput::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Read attribute Audio Output list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::OutputList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_ApplicationLauncherClusterSuite : public TestCommand +{ +public: + TV_ApplicationLauncherClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_ApplicationLauncherCluster", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_ApplicationLauncherClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("catalogList", iter_0, 0)); + VerifyOrReturn(CheckValue("catalogList[0]", iter_0.GetValue(), 123U)); + VerifyOrReturn(CheckNextListItemDecodes("catalogList", iter_0, 1)); + VerifyOrReturn(CheckValue("catalogList[1]", iter_0.GetValue(), 456U)); + VerifyOrReturn(CheckNoMoreListItems("catalogList", iter_0, 2)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable< + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("currentApp", value)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute Application Launcher list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::CatalogList::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute application launcher app"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::CurrentApp::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Launch App Command"); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); + + value.application.Value().catalogVendorID = 123U; + value.application.Value().applicationID = chip::Span("applicationIdgarbage: not in length on purpose", 13); + + value.data.Emplace(); + value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("datagarbage: not in length on purpose"), 4); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Commands::LaunchApp::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Stop App Command"); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type value; + value.application.Emplace(); + + value.application.Value().catalogVendorID = 123U; + value.application.Value().applicationID = chip::Span("applicationIdgarbage: not in length on purpose", 13); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::StopApp::Id, + value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Hide App Command"); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type value; + value.application.Emplace(); + + value.application.Value().catalogVendorID = 123U; + value.application.Value().applicationID = chip::Span("applicationIdgarbage: not in length on purpose", 13); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::HideApp::Id, + value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_KeypadInputClusterSuite : public TestCommand +{ +public: + TV_KeypadInputClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_KeypadInputCluster", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_KeypadInputClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Send Key Command"); + ListFreer listFreer; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(3); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_AccountLoginClusterSuite : public TestCommand +{ +public: + TV_AccountLoginClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_AccountLoginCluster", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_AccountLoginClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("setupPIN", value.setupPIN, chip::CharSpan("tempPin123", 10))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Get Setup PIN Command"); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type value; + value.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::GetSetupPIN::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Login Command"); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Login::Type value; + value.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); + value.setupPIN = chip::Span("tempPin123garbage: not in length on purpose", 10); + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Login::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Logout Command"); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Logout::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Logout::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_WakeOnLanClusterSuite : public TestCommand +{ +public: + TV_WakeOnLanClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_WakeOnLanCluster", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_WakeOnLanClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 3)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read mac address"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::MACAddress::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_ApplicationBasicClusterSuite : public TestCommand +{ +public: + TV_ApplicationBasicClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_ApplicationBasicCluster", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_ApplicationBasicClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("vendorName", value, chip::CharSpan("exampleVendorName1", 18))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorID", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("applicationName", value, chip::CharSpan("exampleName1", 12))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productID", value, 1U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("application.catalogVendorID", value.catalogVendorID, 123U)); + VerifyOrReturn( + CheckValueAsString("application.applicationID", value.applicationID, chip::CharSpan("applicationId", 13))); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("applicationVersion", value, chip::CharSpan("exampleVersion", 14))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("allowedVendorList", iter_0, 0)); + VerifyOrReturn(CheckValue("allowedVendorList[0]", iter_0.GetValue(), 1U)); + VerifyOrReturn(CheckNextListItemDecodes("allowedVendorList", iter_0, 1)); + VerifyOrReturn(CheckValue("allowedVendorList[1]", iter_0.GetValue(), 456U)); + VerifyOrReturn(CheckNoMoreListItems("allowedVendorList", iter_0, 2)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute vendor name"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::VendorName::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute vendor id"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::VendorID::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute application name"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::ApplicationName::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read attribute product id"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::ProductID::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read attribute application status"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, ApplicationBasic::Attributes::Status::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read attribute application status"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::Application::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read attribute application version"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::ApplicationVersion::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read attribute application allowed vendor list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), ApplicationBasic::Id, + ApplicationBasic::Attributes::AllowedVendorList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_MediaPlaybackClusterSuite : public TestCommand +{ +public: + TV_MediaPlaybackClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_MediaPlaybackCluster", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_MediaPlaybackClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentState", value, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("startTime", value)); + VerifyOrReturn(CheckValue("startTime.Value()", value.Value(), 0ULL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("duration", value)); + VerifyOrReturn(CheckValue("duration.Value()", value.Value(), 80000ULL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("sampledPosition", value)); + VerifyOrReturn(CheckValue("sampledPosition.Value().updatedAt", value.Value().updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("sampledPosition.Value().position", value.Value().position)); + VerifyOrReturn(CheckValue("sampledPosition.Value().position.Value()", value.Value().position.Value(), 0ULL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, 0.0f)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("seekRangeEnd", value)); + VerifyOrReturn(CheckValue("seekRangeEnd.Value()", value.Value(), 80000ULL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("seekRangeStart", value)); + VerifyOrReturn(CheckValue("seekRangeStart.Value()", value.Value(), 0ULL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("sampledPosition", value)); + VerifyOrReturn(CheckValue("sampledPosition.Value().updatedAt", value.Value().updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("sampledPosition.Value().position", value.Value().position)); + VerifyOrReturn(CheckValue("sampledPosition.Value().position.Value()", value.Value().position.Value(), 500ULL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("sampledPosition", value)); + VerifyOrReturn(CheckValue("sampledPosition.Value().updatedAt", value.Value().updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("sampledPosition.Value().position", value.Value().position)); + VerifyOrReturn(CheckValue("sampledPosition.Value().position.Value()", value.Value().position.Value(), 400ULL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("sampledPosition", value)); + VerifyOrReturn(CheckValue("sampledPosition.Value().updatedAt", value.Value().updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("sampledPosition.Value().position", value.Value().position)); + VerifyOrReturn(CheckValue("sampledPosition.Value().position.Value()", value.Value().position.Value(), 1000ULL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute playback state"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::CurrentState::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute start time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::StartTime::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute duration"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::Duration::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Read attribute position"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::SampledPosition::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read attribute playback speed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read attribute seek range end"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::SeekRangeEnd::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read attribute seek range start"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::SeekRangeStart::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Media Playback Play Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Play::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::Play::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Media Playback Pause Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::Pause::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Media Playback Stop Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Stop::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::Stop::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Media Playback Start Over Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::StartOver::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::StartOver::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Media Playback Previous Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Previous::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::Previous::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Media Playback Next Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Next::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::Next::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Media Playback Rewind Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::Rewind::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Media Playback Fast Forward Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::FastForward::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Media Playback Skip Forward Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type value; + value.deltaPositionMilliseconds = 500ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::SkipForward::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Read attribute position after skip forward"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::SampledPosition::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Media Playback Skip Backward Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type value; + value.deltaPositionMilliseconds = 100ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::SkipBackward::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Read attribute position after skip backward"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::SampledPosition::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Media Playback Seek Command"); + ListFreer listFreer; + chip::app::Clusters::MediaPlayback::Commands::Seek::Type value; + value.position = 1000ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Commands::Seek::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Read attribute position after seek"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), MediaPlayback::Id, MediaPlayback::Attributes::SampledPosition::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_ChannelClusterSuite : public TestCommand +{ +public: + TV_ChannelClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TV_ChannelCluster", 60, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_ChannelClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("channelList", iter_0, 0)); + VerifyOrReturn(CheckValue("channelList[0].majorNumber", iter_0.GetValue().majorNumber, 6U)); + VerifyOrReturn(CheckValue("channelList[0].minorNumber", iter_0.GetValue().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("channelList[0].name", iter_0.GetValue().name)); + VerifyOrReturn(CheckValueAsString("channelList[0].name.Value()", iter_0.GetValue().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("channelList[0].callSign", iter_0.GetValue().callSign)); + VerifyOrReturn(CheckValueAsString("channelList[0].callSign.Value()", iter_0.GetValue().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("channelList[0].affiliateCallSign", iter_0.GetValue().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("channelList[0].affiliateCallSign.Value()", + iter_0.GetValue().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + VerifyOrReturn(CheckNextListItemDecodes("channelList", iter_0, 1)); + VerifyOrReturn(CheckValue("channelList[1].majorNumber", iter_0.GetValue().majorNumber, 9U)); + VerifyOrReturn(CheckValue("channelList[1].minorNumber", iter_0.GetValue().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("channelList[1].name", iter_0.GetValue().name)); + VerifyOrReturn(CheckValueAsString("channelList[1].name.Value()", iter_0.GetValue().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("channelList[1].callSign", iter_0.GetValue().callSign)); + VerifyOrReturn(CheckValueAsString("channelList[1].callSign.Value()", iter_0.GetValue().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("channelList[1].affiliateCallSign", iter_0.GetValue().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("channelList[1].affiliateCallSign.Value()", + iter_0.GetValue().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + VerifyOrReturn(CheckNextListItemDecodes("channelList", iter_0, 2)); + VerifyOrReturn(CheckValue("channelList[2].majorNumber", iter_0.GetValue().majorNumber, 9U)); + VerifyOrReturn(CheckValue("channelList[2].minorNumber", iter_0.GetValue().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("channelList[2].name", iter_0.GetValue().name)); + VerifyOrReturn(CheckValueAsString("channelList[2].name.Value()", iter_0.GetValue().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("channelList[2].callSign", iter_0.GetValue().callSign)); + VerifyOrReturn(CheckValueAsString("channelList[2].callSign.Value()", iter_0.GetValue().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("channelList[2].affiliateCallSign", iter_0.GetValue().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("channelList[2].affiliateCallSign.Value()", + iter_0.GetValue().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + VerifyOrReturn(CheckNextListItemDecodes("channelList", iter_0, 3)); + VerifyOrReturn(CheckValue("channelList[3].majorNumber", iter_0.GetValue().majorNumber, 9U)); + VerifyOrReturn(CheckValue("channelList[3].minorNumber", iter_0.GetValue().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("channelList[3].name", iter_0.GetValue().name)); + VerifyOrReturn(CheckValueAsString("channelList[3].name.Value()", iter_0.GetValue().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("channelList[3].callSign", iter_0.GetValue().callSign)); + VerifyOrReturn(CheckValueAsString("channelList[3].callSign.Value()", iter_0.GetValue().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("channelList[3].affiliateCallSign", iter_0.GetValue().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("channelList[3].affiliateCallSign.Value()", + iter_0.GetValue().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + VerifyOrReturn(CheckNoMoreListItems("channelList", iter_0, 4)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lineup", value)); + VerifyOrReturn( + CheckValueAsString("lineup.Value().operatorName", value.Value().operatorName, chip::CharSpan("Comcast", 7))); + VerifyOrReturn(CheckValuePresent("lineup.Value().lineupName", value.Value().lineupName)); + VerifyOrReturn(CheckValueAsString("lineup.Value().lineupName.Value()", value.Value().lineupName.Value(), + chip::CharSpan("Comcast King County", 19))); + VerifyOrReturn(CheckValuePresent("lineup.Value().postalCode", value.Value().postalCode)); + VerifyOrReturn(CheckValueAsString("lineup.Value().postalCode.Value()", value.Value().postalCode.Value(), + chip::CharSpan("98052", 5))); + VerifyOrReturn(CheckValue("lineup.Value().lineupInfoType", value.Value().lineupInfoType, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("data response", 13))); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute Channel list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute channel lineup"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::Lineup::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Change Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannel::Type value; + value.match = chip::Span("PBSgarbage: not in length on purpose", 3); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannel::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Change Channel By Number Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 6U; + value.minorNumber = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Skip Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Skip Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 123; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Test 1.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Test 1.2 - Skip Up By 1"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Test 2.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Test 2.2 - Skip Up By 2"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Test 2.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Test 3.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Test 3.2 - Skip Up By 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 3; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Test 3.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Test 4.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Test 4.2 - Skip Up By 4"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 4; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Test 4.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Test 5.2 - Skip Up By 5"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 5; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Test 5.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Test 6.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Test 6.2 - Skip Up By 6"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 6; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Test 6.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Test 7.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Test 7.2 - Skip Up By 7"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 7; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Test 7.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Test 8.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 31: { + LogStep(31, "Test 8.2 - Skip Up By 8"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 8; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 32: { + LogStep(32, "Test 8.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, "Test 1.2 - Skip Down By 1"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Test 2.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 36: { + LogStep(36, "Test 2.2 - Skip Down By 2"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Test 2.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Test 3.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Test 3.2 - Skip Down By 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -3; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 40: { + LogStep(40, "Test 3.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "Test 4.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 42: { + LogStep(42, "Test 4.2 - Skip Down By 4"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -4; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Test 4.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Test 5.2 - Skip Down By 5"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -5; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 45: { + LogStep(45, "Test 5.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Test 6.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 47: { + LogStep(47, "Test 6.2 - Skip Down By 6"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -6; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 48: { + LogStep(48, "Test 6.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Test 7.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Test 7.2 - Skip Down By 7"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -7; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 51: { + LogStep(51, "Test 7.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Test 8.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 53: { + LogStep(53, "Test 8.2 - Skip Down By 8"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -8; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 54: { + LogStep(54, "Test 8.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 55: { + LogStep(55, "Test 1.2 - Skip Up By 32,767"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 32767; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 56: { + LogStep(56, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 57: { + LogStep(57, "Test 1.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 58: { + LogStep(58, "Test 1.2 - Skip Down By 32,768"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -32768; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 59: { + LogStep(59, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_LowPowerClusterSuite : public TestCommand +{ +public: + TV_LowPowerClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TV_LowPowerCluster", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_LowPowerClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Sleep Input Status Command"); + ListFreer listFreer; + chip::app::Clusters::LowPower::Commands::Sleep::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Commands::Sleep::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_ContentLauncherClusterSuite : public TestCommand +{ +public: + TV_ContentLauncherClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_ContentLauncherCluster", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_ContentLauncherClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptHeader", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("acceptHeader[0]", iter_0.GetValue(), chip::CharSpan("example", 7))); + VerifyOrReturn(CheckNextListItemDecodes("acceptHeader", iter_0, 1)); + VerifyOrReturn(CheckValueAsString("acceptHeader[1]", iter_0.GetValue(), chip::CharSpan("example", 7))); + VerifyOrReturn(CheckNoMoreListItems("acceptHeader", iter_0, 2)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("supportedStreamingProtocols", value, 0UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("exampleData", 11))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), chip::CharSpan("exampleData", 11))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute accept header list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Attributes::AcceptHeader::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute supported streaming protocols"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::SupportedStreamingProtocols::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Launch Content Command"); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(1); + listHolder_1->mList[0].value = chip::Span("exampleValuegarbage: not in length on purpose", 12); + listHolder_1->mList[0].externalIDList.Emplace(); + + { + auto * listHolder_4 = + new ListHolder(1); + listFreer.add(listHolder_4); + + listHolder_4->mList[0].name = chip::Span("namegarbage: not in length on purpose", 4); + listHolder_4->mList[0].value = chip::Span("valuegarbage: not in length on purpose", 5); + + listHolder_1->mList[0].externalIDList.Value() = + chip::app::DataModel::List( + listHolder_4->mList, 1); + } + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + value.data.Emplace(); + value.data.Value() = chip::Span("exampleDatagarbage: not in length on purpose", 11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Launch URL Command"); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = chip::Span("exampleUrlgarbage: not in length on purpose", 10); + value.displayString.Emplace(); + value.displayString.Value() = chip::Span("exampleDisplayStringgarbage: not in length on purpose", 20); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + chip::Span("exampleNamegarbage: not in length on purpose", 11); + value.brandingInformation.Value().background.Emplace(); + + value.brandingInformation.Value().background.Value().imageURL.Emplace(); + value.brandingInformation.Value().background.Value().imageURL.Value() = + chip::Span("exampleUrlgarbage: not in length on purpose", 10); + value.brandingInformation.Value().background.Value().color.Emplace(); + value.brandingInformation.Value().background.Value().color.Value() = + chip::Span("exampleColorgarbage: not in length on purpose", 12); + value.brandingInformation.Value().background.Value().size.Emplace(); + + value.brandingInformation.Value().background.Value().size.Value().width = 0; + value.brandingInformation.Value().background.Value().size.Value().height = 0; + value.brandingInformation.Value().background.Value().size.Value().metric = + static_cast(0); + + value.brandingInformation.Value().logo.Emplace(); + + value.brandingInformation.Value().logo.Value().imageURL.Emplace(); + value.brandingInformation.Value().logo.Value().imageURL.Value() = + chip::Span("exampleUrlgarbage: not in length on purpose", 10); + value.brandingInformation.Value().logo.Value().color.Emplace(); + value.brandingInformation.Value().logo.Value().color.Value() = + chip::Span("exampleColorgarbage: not in length on purpose", 12); + value.brandingInformation.Value().logo.Value().size.Emplace(); + + value.brandingInformation.Value().logo.Value().size.Value().width = 0; + value.brandingInformation.Value().logo.Value().size.Value().height = 0; + value.brandingInformation.Value().logo.Value().size.Value().metric = + static_cast(0); + + value.brandingInformation.Value().progressBar.Emplace(); + + value.brandingInformation.Value().progressBar.Value().imageURL.Emplace(); + value.brandingInformation.Value().progressBar.Value().imageURL.Value() = + chip::Span("exampleUrlgarbage: not in length on purpose", 10); + value.brandingInformation.Value().progressBar.Value().color.Emplace(); + value.brandingInformation.Value().progressBar.Value().color.Value() = + chip::Span("exampleColorgarbage: not in length on purpose", 12); + value.brandingInformation.Value().progressBar.Value().size.Emplace(); + + value.brandingInformation.Value().progressBar.Value().size.Value().width = 0; + value.brandingInformation.Value().progressBar.Value().size.Value().height = 0; + value.brandingInformation.Value().progressBar.Value().size.Value().metric = + static_cast(0); + + value.brandingInformation.Value().splash.Emplace(); + + value.brandingInformation.Value().splash.Value().imageURL.Emplace(); + value.brandingInformation.Value().splash.Value().imageURL.Value() = + chip::Span("exampleUrlgarbage: not in length on purpose", 10); + value.brandingInformation.Value().splash.Value().color.Emplace(); + value.brandingInformation.Value().splash.Value().color.Value() = + chip::Span("exampleColorgarbage: not in length on purpose", 12); + value.brandingInformation.Value().splash.Value().size.Emplace(); + + value.brandingInformation.Value().splash.Value().size.Value().width = 0; + value.brandingInformation.Value().splash.Value().size.Value().height = 0; + value.brandingInformation.Value().splash.Value().size.Value().metric = + static_cast(0); + + value.brandingInformation.Value().waterMark.Emplace(); + + value.brandingInformation.Value().waterMark.Value().imageURL.Emplace(); + value.brandingInformation.Value().waterMark.Value().imageURL.Value() = + chip::Span("exampleUrlgarbage: not in length on purpose", 10); + value.brandingInformation.Value().waterMark.Value().color.Emplace(); + value.brandingInformation.Value().waterMark.Value().color.Value() = + chip::Span("exampleColorgarbage: not in length on purpose", 12); + value.brandingInformation.Value().waterMark.Value().size.Emplace(); + + value.brandingInformation.Value().waterMark.Value().size.Value().width = 0; + value.brandingInformation.Value().waterMark.Value().size.Value().height = 0; + value.brandingInformation.Value().waterMark.Value().size.Value().metric = + static_cast(0); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TV_MediaInputClusterSuite : public TestCommand +{ +public: + TV_MediaInputClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TV_MediaInputCluster", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TV_MediaInputClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("inputList", iter_0, 0)); + VerifyOrReturn(CheckValue("inputList[0].index", iter_0.GetValue().index, 1U)); + VerifyOrReturn(CheckValue("inputList[0].inputType", iter_0.GetValue().inputType, 4U)); + VerifyOrReturn(CheckValueAsString("inputList[0].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckValueAsString("inputList[0].description", iter_0.GetValue().description, + chip::CharSpan("High-Definition Multimedia Interface", 36))); + VerifyOrReturn(CheckNextListItemDecodes("inputList", iter_0, 1)); + VerifyOrReturn(CheckValue("inputList[1].index", iter_0.GetValue().index, 2U)); + VerifyOrReturn(CheckValue("inputList[1].inputType", iter_0.GetValue().inputType, 4U)); + VerifyOrReturn(CheckValueAsString("inputList[1].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckValueAsString("inputList[1].description", iter_0.GetValue().description, + chip::CharSpan("High-Definition Multimedia Interface", 36))); + VerifyOrReturn(CheckNoMoreListItems("inputList", iter_0, 2)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentInput", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("inputList", iter_0, 0)); + VerifyOrReturn(CheckValue("inputList[0].index", iter_0.GetValue().index, 1U)); + VerifyOrReturn(CheckValue("inputList[0].inputType", iter_0.GetValue().inputType, 4U)); + VerifyOrReturn(CheckValueAsString("inputList[0].name", iter_0.GetValue().name, chip::CharSpan("HDMI Test", 9))); + VerifyOrReturn(CheckValueAsString("inputList[0].description", iter_0.GetValue().description, + chip::CharSpan("High-Definition Multimedia Interface", 36))); + VerifyOrReturn(CheckNextListItemDecodes("inputList", iter_0, 1)); + VerifyOrReturn(CheckValue("inputList[1].index", iter_0.GetValue().index, 2U)); + VerifyOrReturn(CheckValue("inputList[1].inputType", iter_0.GetValue().inputType, 4U)); + VerifyOrReturn(CheckValueAsString("inputList[1].name", iter_0.GetValue().name, chip::CharSpan("HDMI", 4))); + VerifyOrReturn(CheckValueAsString("inputList[1].description", iter_0.GetValue().description, + chip::CharSpan("High-Definition Multimedia Interface", 36))); + VerifyOrReturn(CheckNoMoreListItems("inputList", iter_0, 2)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute media input list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read current media input"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::CurrentInput::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Select Input Command"); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::SelectInput::Type value; + value.index = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::SelectInput::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Hide Input Status Command"); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::HideInputStatus::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Show Input Status Command"); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::ShowInputStatus::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Rename Input Command"); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::RenameInput::Type value; + value.index = 1U; + value.name = chip::Span("HDMI Testgarbage: not in length on purpose", 9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::RenameInput::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Read attribute media input list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestCASERecoverySuite : public TestCommand +{ +public: + TestCASERecoverySuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestCASERecovery", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestCASERecoverySuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("dataModelRevision", value, 17U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("dataModelRevision", value, 17U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read an attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::DataModelRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Reboot the server"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Re-get our session, but without expiring sesssions"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.expireExistingSession.Emplace(); + value.expireExistingSession.Value() = false; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Read an attribute again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::DataModelRevision::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Re-get our session, but without expiring sesssions"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.expireExistingSession.Emplace(); + value.expireExistingSession.Value() = false; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Read an attribute a third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::DataModelRevision::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestClusterSuite : public TestCommand +{ +public: + TestClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestCluster", 491, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestClusterSuite() + { + if (nullableOctetStrTestValueBuffer != nullptr) + { + chip::Platform::MemoryFree(nullableOctetStrTestValueBuffer); + nullableOctetStrTestValueBuffer = nullptr; + } + if (nullableCharStringSaveBuffer != nullptr) + { + chip::Platform::MemoryFree(nullableCharStringSaveBuffer); + nullableCharStringSaveBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable booValueNull; + chip::app::DataModel::Nullable> nullableValue254; + chip::app::DataModel::Nullable nullableEnumAttr3; + uint8_t * nullableOctetStrTestValueBuffer = nullptr; + chip::app::DataModel::Nullable nullableOctetStrTestValue; + char * nullableCharStringSaveBuffer = nullptr; + chip::app::DataModel::Nullable nullableCharStringSave; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("returnValue", value.returnValue, 7U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("returnValue", value.returnValue, 20U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, 0)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, 1)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, 0)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap8", value, 0U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap8", value, 255U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap8", value, 0U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap16", value, 0U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap16", value, 65535U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap16", value, 0U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 0UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 4294967295UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 0UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap64", value, 0ULL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap64", value, 18446744073709551615ULL)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap64", value, 0ULL)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8u", value, 0U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8u", value, 255U)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8u", value, 0U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16u", value, 0U)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16u", value, 65535U)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16u", value, 0U)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32u", value, 0UL)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32u", value, 4294967295UL)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32u", value, 0UL)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64u", value, 0ULL)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64u", value, 18446744073709551615ULL)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64u", value, 0ULL)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8s", value, 0)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8s", value, 127)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8s", value, -128)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8s", value, 0)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16s", value, 0)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16s", value, 32767)); + } + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16s", value, -32768)); + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16s", value, 0)); + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32s", value, 0L)); + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32s", value, 2147483647L)); + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32s", value, -2147483648L)); + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32s", value, 0L)); + } + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64s", value, 0LL)); + } + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64s", value, 9223372036854775807LL)); + } + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64s", value, -9223372036854775807LL)); + } + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64s", value, 0LL)); + } + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatSingle", value, 0.0f)); + } + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatSingle", value, 0.1f)); + } + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatSingle", value, 17000000000.0f)); + } + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatSingle", value, 1.7e-10f)); + } + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatSingle", value, 0.0f)); + } + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + double value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatDouble", value, 0)); + } + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + double value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatDouble", value, 0.1234567890123)); + } + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + double value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatDouble", value, 1.7e+200)); + } + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + double value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatDouble", value, 1.7e-200)); + } + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + double value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("floatDouble", value, 0)); + } + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum8", value, 0U)); + } + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum8", value, 255U)); + } + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum8", value, 0U)); + } + break; + case 102: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum16", value, 0U)); + } + break; + case 103: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 104: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum16", value, 65535U)); + } + break; + case 105: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 106: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum16", value, 0U)); + } + break; + case 107: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("octetString", value, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + } + break; + case 108: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 109: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValueAsString("octetString", value, chip::ByteSpan(chip::Uint8::from_const_char("Tes\000ti\000ng"), 9))); + } + break; + case 110: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 111: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("octetString", value, + chip::ByteSpan(chip::Uint8::from_const_char("\x00\x01\x02\x03\x04\x05"), 6))); + } + break; + case 112: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 113: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("octetString", value, + chip::ByteSpan(chip::Uint8::from_const_char("\x0d\x0a\xff\x22\xa0"), 5))); + } + break; + case 114: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 115: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValueAsString("octetString", value, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); + } + break; + case 116: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 117: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValueAsString("octetString", value, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); + } + break; + case 118: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 119: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("longOctetString", value, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + } + break; + case 120: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 121: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString( + "longOctetString", value, + chip::ByteSpan( + chip::Uint8::from_const_char( + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"), + 300))); + } + break; + case 122: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 123: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, chip::CharSpan("", 0))); + } + break; + case 124: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 125: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, chip::CharSpan("☉T☉", 7))); + } + break; + case 126: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 127: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, chip::CharSpan("☉T☉", 7))); + } + break; + case 128: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 129: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("longCharString", value, chip::CharSpan("", 0))); + } + break; + case 130: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 131: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString( + "longCharString", value, + chip::CharSpan( + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉", + 900))); + } + break; + case 132: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 133: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[0]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 1)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[1]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 2)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[2]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 3)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[3]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNoMoreListItems("listLongOctetString", iter_0, 4)); + } + } + break; + case 134: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 135: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[0]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 1)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[1]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 2)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[2]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 3)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[3]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter_0, 4)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[4]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456" + "789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234" + "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012" + "3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNoMoreListItems("listLongOctetString", iter_0, 5)); + } + } + break; + case 136: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 137: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochUs", value, 0ULL)); + } + break; + case 138: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 139: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochUs", value, 18446744073709551615ULL)); + } + break; + case 140: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 141: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochUs", value, 0ULL)); + } + break; + case 142: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochS", value, 0UL)); + } + break; + case 143: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 144: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochS", value, 4294967295UL)); + } + break; + case 145: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 146: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochS", value, 0UL)); + } + break; + case 147: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE)); + break; + case 148: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE)); + break; + case 149: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); + break; + case 150: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); + break; + case 151: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value, 0U)); + } + break; + case 152: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 153: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value, 17U)); + } + break; + case 154: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 155: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("arg1", value.arg1, 20003U)); + VerifyOrReturn(CheckValue("arg2", value.arg2, 1U)); + } + break; + case 156: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 157: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, true)); + } + break; + case 158: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, false)); + } + break; + case 159: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, true)); + } + break; + case 160: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, false)); + } + break; + case 161: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, true)); + } + break; + case 162: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, false)); + } + break; + case 163: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("arg1.a", value.arg1.a, 17U)); + VerifyOrReturn(CheckValue("arg1.b", value.arg1.b, false)); + VerifyOrReturn(CheckValue("arg1.c", value.arg1.c, 2U)); + VerifyOrReturn( + CheckValueAsString("arg1.d", value.arg1.d, chip::ByteSpan(chip::Uint8::from_const_char("octet_string"), 12))); + VerifyOrReturn(CheckValueAsString("arg1.e", value.arg1.e, chip::CharSpan("char_string", 11))); + VerifyOrReturn(CheckValue("arg1.f", value.arg1.f, 1U)); + VerifyOrReturn(CheckValue("arg1.g", value.arg1.g, 0.1f)); + VerifyOrReturn(CheckValue("arg1.h", value.arg1.h, 0.1)); + } + break; + case 164: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, true)); + } + break; + case 165: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, false)); + } + break; + case 166: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.arg1.begin(); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 0)); + VerifyOrReturn(CheckValue("arg1[0]", iter_0.GetValue(), 9U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 1)); + VerifyOrReturn(CheckValue("arg1[1]", iter_0.GetValue(), 8U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 2)); + VerifyOrReturn(CheckValue("arg1[2]", iter_0.GetValue(), 7U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 3)); + VerifyOrReturn(CheckValue("arg1[3]", iter_0.GetValue(), 6U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 4)); + VerifyOrReturn(CheckValue("arg1[4]", iter_0.GetValue(), 5U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 5)); + VerifyOrReturn(CheckValue("arg1[5]", iter_0.GetValue(), 4U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 6)); + VerifyOrReturn(CheckValue("arg1[6]", iter_0.GetValue(), 3U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 7)); + VerifyOrReturn(CheckValue("arg1[7]", iter_0.GetValue(), 2U)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter_0, 8)); + VerifyOrReturn(CheckValue("arg1[8]", iter_0.GetValue(), 1U)); + VerifyOrReturn(CheckNoMoreListItems("arg1", iter_0, 9)); + } + } + break; + case 167: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.arg1.begin(); + VerifyOrReturn(CheckNoMoreListItems("arg1", iter_0, 0)); + } + } + break; + case 168: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, true)); + } + break; + case 169: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, false)); + } + break; + case 170: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, true)); + } + break; + case 171: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, false)); + } + break; + case 172: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 173: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 0)); + VerifyOrReturn(CheckValue("listInt8u[0]", iter_0.GetValue(), 1U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 1)); + VerifyOrReturn(CheckValue("listInt8u[1]", iter_0.GetValue(), 2U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 2)); + VerifyOrReturn(CheckValue("listInt8u[2]", iter_0.GetValue(), 3U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 3)); + VerifyOrReturn(CheckValue("listInt8u[3]", iter_0.GetValue(), 4U)); + VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter_0, 4)); + } + } + break; + case 174: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 175: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("listOctetString[0]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter_0, 1)); + VerifyOrReturn(CheckValueAsString("listOctetString[1]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter_0, 2)); + VerifyOrReturn(CheckValueAsString("listOctetString[2]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter_0, 3)); + VerifyOrReturn(CheckValueAsString("listOctetString[3]", iter_0.GetValue(), + chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); + VerifyOrReturn(CheckNoMoreListItems("listOctetString", iter_0, 4)); + } + } + break; + case 176: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 177: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter_0, 0)); + VerifyOrReturn(CheckValue("listStructOctetString[0].member1", iter_0.GetValue().member1, 0ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[0].member2", iter_0.GetValue().member2, + chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter_0, 1)); + VerifyOrReturn(CheckValue("listStructOctetString[1].member1", iter_0.GetValue().member1, 1ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[1].member2", iter_0.GetValue().member2, + chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter_0, 2)); + VerifyOrReturn(CheckValue("listStructOctetString[2].member1", iter_0.GetValue().member1, 2ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[2].member2", iter_0.GetValue().member2, + chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter_0, 3)); + VerifyOrReturn(CheckValue("listStructOctetString[3].member1", iter_0.GetValue().member1, 3ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[3].member2", iter_0.GetValue().member2, + chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); + VerifyOrReturn(CheckNoMoreListItems("listStructOctetString", iter_0, 4)); + } + } + break; + case 178: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("wasPresent", value.wasPresent, true)); + VerifyOrReturn(CheckValuePresent("wasNull", value.wasNull)); + VerifyOrReturn(CheckValue("wasNull.Value()", value.wasNull.Value(), false)); + VerifyOrReturn(CheckValuePresent("value", value.value)); + VerifyOrReturn(CheckValue("value.Value()", value.value.Value(), 5U)); + VerifyOrReturn(CheckValuePresent("originalValue", value.originalValue)); + VerifyOrReturn(CheckValueNonNull("originalValue.Value()", value.originalValue.Value())); + VerifyOrReturn(CheckValue("originalValue.Value().Value()", value.originalValue.Value().Value(), 5U)); + } + break; + case 179: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("wasPresent", value.wasPresent, false)); + } + break; + case 180: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::UnitTesting::Structs::NullablesAndOptionalsStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listNullablesAndOptionalsStruct", iter_0, 0)); + VerifyOrReturn(CheckValueNull("listNullablesAndOptionalsStruct[0].nullableInt", iter_0.GetValue().nullableInt)); + VerifyOrReturn( + CheckValueNull("listNullablesAndOptionalsStruct[0].nullableString", iter_0.GetValue().nullableString)); + VerifyOrReturn( + CheckValueNull("listNullablesAndOptionalsStruct[0].nullableStruct", iter_0.GetValue().nullableStruct)); + VerifyOrReturn( + CheckValueNull("listNullablesAndOptionalsStruct[0].nullableList", iter_0.GetValue().nullableList)); + VerifyOrReturn(CheckNoMoreListItems("listNullablesAndOptionalsStruct", iter_0, 1)); + } + } + break; + case 181: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 182: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::UnitTesting::Structs::NullablesAndOptionalsStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listNullablesAndOptionalsStruct", iter_0, 0)); + VerifyOrReturn(CheckValueNull("listNullablesAndOptionalsStruct[0].nullableInt", iter_0.GetValue().nullableInt)); + VerifyOrReturn( + CheckValueNull("listNullablesAndOptionalsStruct[0].nullableString", iter_0.GetValue().nullableString)); + VerifyOrReturn( + CheckValueNull("listNullablesAndOptionalsStruct[0].nullableStruct", iter_0.GetValue().nullableStruct)); + VerifyOrReturn( + CheckValueNonNull("listNullablesAndOptionalsStruct[0].nullableList", iter_0.GetValue().nullableList)); + { + auto iter_3 = iter_0.GetValue().nullableList.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "listNullablesAndOptionalsStruct[0].nullableList.Value()", iter_3, 0)); + VerifyOrReturn( + CheckValue("listNullablesAndOptionalsStruct[0].nullableList.Value()[0]", iter_3.GetValue(), 1U)); + VerifyOrReturn(CheckNextListItemDecodes( + "listNullablesAndOptionalsStruct[0].nullableList.Value()", iter_3, 1)); + VerifyOrReturn( + CheckValue("listNullablesAndOptionalsStruct[0].nullableList.Value()[1]", iter_3.GetValue(), 2U)); + VerifyOrReturn(CheckNoMoreListItems( + "listNullablesAndOptionalsStruct[0].nullableList.Value()", iter_3, 2)); + } + VerifyOrReturn(CheckNoMoreListItems("listNullablesAndOptionalsStruct", iter_0, 1)); + } + } + break; + case 183: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 184: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableBoolean", value)); + booValueNull = value; + } + break; + case 185: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 186: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBoolean", value)); + VerifyOrReturn(CheckValue("nullableBoolean.Value()", value.Value(), true)); + } + break; + case 187: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, booValueNull)); + } + break; + case 188: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 189: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap8", value)); + VerifyOrReturn(CheckValue("nullableBitmap8.Value()", value.Value(), 254U)); + } + break; + case 190: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 191: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap8", value)); + VerifyOrReturn(CheckValue("nullableBitmap8.Value()", value.Value(), 254U)); + nullableValue254 = value; + } + break; + case 192: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 193: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableBitmap8", value)); + } + break; + case 194: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, nullableValue254)); + } + break; + case 195: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 196: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap16", value)); + VerifyOrReturn(CheckValue("nullableBitmap16.Value()", value.Value(), 65534U)); + } + break; + case 197: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 198: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap16", value)); + VerifyOrReturn(CheckValue("nullableBitmap16.Value()", value.Value(), 65534U)); + } + break; + case 199: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 200: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableBitmap16", value)); + } + break; + case 201: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 202: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap32", value)); + VerifyOrReturn(CheckValue("nullableBitmap32.Value()", value.Value(), 4294967294UL)); + } + break; + case 203: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 204: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap32", value)); + VerifyOrReturn(CheckValue("nullableBitmap32.Value()", value.Value(), 4294967294UL)); + } + break; + case 205: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 206: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableBitmap32", value)); + } + break; + case 207: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 208: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap64", value)); + VerifyOrReturn(CheckValue("nullableBitmap64.Value()", value.Value(), 18446744073709551614ULL)); + } + break; + case 209: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 210: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableBitmap64", value)); + VerifyOrReturn(CheckValue("nullableBitmap64.Value()", value.Value(), 18446744073709551614ULL)); + } + break; + case 211: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 212: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableBitmap64", value)); + } + break; + case 213: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 214: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 0U)); + } + break; + case 215: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 216: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 254U)); + } + break; + case 217: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 218: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 254U)); + } + break; + case 219: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("value", value)); + } + break; + case 220: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 221: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt8u", value)); + } + break; + case 222: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 223: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 254U)); + } + break; + case 224: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 225: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + } + break; + case 226: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 129U)); + } + break; + case 227: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 228: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt16u", value)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", value.Value(), 0U)); + } + break; + case 229: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 230: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt16u", value)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", value.Value(), 65534U)); + } + break; + case 231: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 232: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt16u", value)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", value.Value(), 65534U)); + } + break; + case 233: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 234: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt16u", value)); + } + break; + case 235: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + } + break; + case 236: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 65534U)); + } + break; + case 237: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 238: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + } + break; + case 239: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 32001U)); + } + break; + case 240: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 241: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt32u", value)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", value.Value(), 0UL)); + } + break; + case 242: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 243: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt32u", value)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", value.Value(), 4294967294UL)); + } + break; + case 244: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 245: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt32u", value)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", value.Value(), 4294967294UL)); + } + break; + case 246: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 247: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt32u", value)); + } + break; + case 248: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967294UL)); + } + break; + case 249: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 4294967294UL)); + } + break; + case 250: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 251: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967294UL)); + } + break; + case 252: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 2147483648UL)); + } + break; + case 253: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 254: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt64u", value)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", value.Value(), 0ULL)); + } + break; + case 255: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 256: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt64u", value)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", value.Value(), 18446744073709551614ULL)); + } + break; + case 257: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 258: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt64u", value)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", value.Value(), 18446744073709551614ULL)); + } + break; + case 259: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 260: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt64u", value)); + } + break; + case 261: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0ULL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 18446744073709551614ULL)); + } + break; + case 262: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 18446744073709551614ULL)); + } + break; + case 263: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 264: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0ULL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 18446744073709551614ULL)); + } + break; + case 265: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 18000000000000000001ULL)); + } + break; + case 266: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 267: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8s", value)); + VerifyOrReturn(CheckValue("nullableInt8s.Value()", value.Value(), -127)); + } + break; + case 268: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 269: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8s", value)); + VerifyOrReturn(CheckValue("nullableInt8s.Value()", value.Value(), -127)); + } + break; + case 270: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 271: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt8s", value)); + } + break; + case 272: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -127)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); + } + break; + case 273: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -127)); + } + break; + case 274: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 275: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -127)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); + } + break; + case 276: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -126)); + } + break; + case 277: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 278: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt16s", value)); + VerifyOrReturn(CheckValue("nullableInt16s.Value()", value.Value(), -32767)); + } + break; + case 279: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 280: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt16s", value)); + VerifyOrReturn(CheckValue("nullableInt16s.Value()", value.Value(), -32767)); + } + break; + case 281: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 282: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt16s", value)); + } + break; + case 283: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 284: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -32767)); + } + break; + case 285: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 286: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 287: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -32766)); + } + break; + case 288: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 289: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt32s", value)); + VerifyOrReturn(CheckValue("nullableInt32s.Value()", value.Value(), -2147483647L)); + } + break; + case 290: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 291: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt32s", value)); + VerifyOrReturn(CheckValue("nullableInt32s.Value()", value.Value(), -2147483647L)); + } + break; + case 292: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 293: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt32s", value)); + } + break; + case 294: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -2147483647L)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2147483647L)); + } + break; + case 295: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -2147483647L)); + } + break; + case 296: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 297: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -2147483647L)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2147483647L)); + } + break; + case 298: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -2147483646L)); + } + break; + case 299: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 300: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt64s", value)); + VerifyOrReturn(CheckValue("nullableInt64s.Value()", value.Value(), -9223372036854775807LL)); + } + break; + case 301: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 302: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt64s", value)); + VerifyOrReturn(CheckValue("nullableInt64s.Value()", value.Value(), -9223372036854775807LL)); + } + break; + case 303: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 304: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableInt64s", value)); + } + break; + case 305: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -9223372036854775807LL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9223372036854775807LL)); + } + break; + case 306: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -9223372036854775807LL)); + } + break; + case 307: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 308: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, -9223372036854775807LL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9223372036854775807LL)); + } + break; + case 309: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, -9223372036854775806LL)); + } + break; + case 310: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 311: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", value)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", value.Value(), 0.1f)); + } + break; + case 312: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 313: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", value)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", value.Value(), INFINITY)); + } + break; + case 314: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 315: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", value)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", value.Value(), -INFINITY)); + } + break; + case 316: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 317: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableFloatSingle", value)); + } + break; + case 318: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 319: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", value)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", value.Value(), 0.0f)); + } + break; + case 320: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 321: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", value)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", value.Value(), 0.1234567890123)); + } + break; + case 322: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 323: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", value)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", value.Value(), INFINITY)); + } + break; + case 324: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 325: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", value)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", value.Value(), -INFINITY)); + } + break; + case 326: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 327: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableFloatDouble", value)); + } + break; + case 328: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 329: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", value)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", value.Value(), 0)); + } + break; + case 330: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 331: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnum8", value)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", value.Value(), 0U)); + } + break; + case 332: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 333: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnum8", value)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", value.Value(), 254U)); + } + break; + case 334: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 335: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnum8", value)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", value.Value(), 254U)); + } + break; + case 336: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 337: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableEnum8", value)); + } + break; + case 338: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 339: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnum16", value)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", value.Value(), 0U)); + } + break; + case 340: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 341: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnum16", value)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", value.Value(), 65534U)); + } + break; + case 342: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 343: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnum16", value)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", value.Value(), 65534U)); + } + break; + case 344: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 345: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableEnum16", value)); + } + break; + case 346: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 347: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", value)); + VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", value.Value(), 0U)); + } + break; + case 348: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 349: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", value)); + VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", value.Value(), 3U)); + } + break; + case 350: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 351: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", value)); + VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", value.Value(), 3U)); + nullableEnumAttr3 = value; + } + break; + case 352: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 353: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableEnumAttr", value)); + } + break; + case 354: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, nullableEnumAttr3)); + } + break; + case 355: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + } + break; + case 356: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 357: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); + if (value.IsNull()) + { + nullableOctetStrTestValue.SetNull(); + } + else + { + if (nullableOctetStrTestValueBuffer != nullptr) + { + chip::Platform::MemoryFree(nullableOctetStrTestValueBuffer); + } + nullableOctetStrTestValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.Value().size())); + memcpy(nullableOctetStrTestValueBuffer, value.Value().data(), value.Value().size()); + nullableOctetStrTestValue.SetNonNull(nullableOctetStrTestValueBuffer, value.Value().size()); + } + } + break; + case 358: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 359: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableOctetString", value)); + } + break; + case 360: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 361: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + } + break; + case 362: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, nullableOctetStrTestValue)); + } + break; + case 363: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableCharString", value)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", value.Value(), chip::CharSpan("", 0))); + } + break; + case 364: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 365: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableCharString", value)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", value.Value(), chip::CharSpan("☉T☉", 7))); + if (value.IsNull()) + { + nullableCharStringSave.SetNull(); + } + else + { + if (nullableCharStringSaveBuffer != nullptr) + { + chip::Platform::MemoryFree(nullableCharStringSaveBuffer); + } + nullableCharStringSaveBuffer = static_cast(chip::Platform::MemoryAlloc(value.Value().size())); + memcpy(nullableCharStringSaveBuffer, value.Value().data(), value.Value().size()); + nullableCharStringSave.SetNonNull(nullableCharStringSaveBuffer, value.Value().size()); + } + } + break; + case 366: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (nullableCharStringSave.IsNull()) + { + VerifyOrReturn(CheckValueNull("nullableCharString", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("nullableCharString", value)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", value.Value(), nullableCharStringSave.Value())); + } + } + break; + case 367: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 368: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableCharString", value)); + } + break; + case 369: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 370: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableCharString", value)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", value.Value(), chip::CharSpan("", 0))); + } + break; + case 371: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, nullableCharStringSave)); + } + break; + case 372: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); + break; + case 373: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); + break; + case 374: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 375: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 376: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 0)); + VerifyOrReturn(CheckValue("listInt8u[0]", iter_0.GetValue(), 1U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 1)); + VerifyOrReturn(CheckValue("listInt8u[1]", iter_0.GetValue(), 2U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 2)); + VerifyOrReturn(CheckValue("listInt8u[2]", iter_0.GetValue(), 3U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 3)); + VerifyOrReturn(CheckValue("listInt8u[3]", iter_0.GetValue(), 4U)); + VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter_0, 4)); + } + } + break; + case 377: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 378: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 0)); + VerifyOrReturn(CheckValue("listInt8u[0]", iter_0.GetValue(), 5U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 1)); + VerifyOrReturn(CheckValue("listInt8u[1]", iter_0.GetValue(), 6U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 2)); + VerifyOrReturn(CheckValue("listInt8u[2]", iter_0.GetValue(), 7U)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter_0, 3)); + VerifyOrReturn(CheckValue("listInt8u[3]", iter_0.GetValue(), 8U)); + VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter_0, 4)); + } + } + shouldContinue = true; + break; + case 379: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", value, 70U)); + } + break; + case 380: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 381: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 382: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 383: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 384: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", value, 70U)); + } + break; + case 385: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 386: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", value, 20U)); + } + break; + case 387: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 388: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", value, 100U)); + } + break; + case 389: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 390: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", value, 50U)); + } + break; + case 391: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", value, 200U)); + } + break; + case 392: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 393: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 394: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 395: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 396: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", value, 200U)); + } + break; + case 397: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 398: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", value, 100U)); + } + break; + case 399: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 400: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", value, 1000U)); + } + break; + case 401: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 402: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", value, 500U)); + } + break; + case 403: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", value, -20)); + } + break; + case 404: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 405: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 406: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 407: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 408: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", value, -20)); + } + break; + case 409: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 410: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", value, -40)); + } + break; + case 411: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 412: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", value, 50)); + } + break; + case 413: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 414: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", value, 6)); + } + break; + case 415: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", value, -100)); + } + break; + case 416: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 417: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 418: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 419: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 420: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", value, -100)); + } + break; + case 421: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 422: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", value, -150)); + } + break; + case 423: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 424: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", value, 200)); + } + break; + case 425: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 426: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", value, 7)); + } + break; + case 427: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", value.Value(), 70U)); + } + break; + case 428: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 429: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 430: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 431: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 432: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", value.Value(), 70U)); + } + break; + case 433: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 434: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", value.Value(), 20U)); + } + break; + case 435: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 436: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", value.Value(), 100U)); + } + break; + case 437: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 438: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", value.Value(), 50U)); + } + break; + case 439: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 440: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt8u", value)); + } + break; + case 441: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", value.Value(), 200U)); + } + break; + case 442: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 443: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 444: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 445: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 446: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", value.Value(), 200U)); + } + break; + case 447: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 448: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", value.Value(), 100U)); + } + break; + case 449: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 450: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", value.Value(), 1000U)); + } + break; + case 451: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 452: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", value.Value(), 500U)); + } + break; + case 453: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 454: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt16u", value)); + } + break; + case 455: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", value.Value(), -20)); + } + break; + case 456: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 457: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 458: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 459: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 460: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", value.Value(), -20)); + } + break; + case 461: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 462: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", value.Value(), -40)); + } + break; + case 463: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 464: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", value.Value(), 50)); + } + break; + case 465: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 466: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", value.Value(), 6)); + } + break; + case 467: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 468: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt8s", value)); + } + break; + case 469: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", value.Value(), -100)); + } + break; + case 470: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 471: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 472: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 473: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 474: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", value.Value(), -100)); + } + break; + case 475: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 476: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", value.Value(), -150)); + } + break; + case 477: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 478: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", value.Value(), 200)); + } + break; + case 479: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 480: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", value)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", value.Value(), 7)); + } + break; + case 481: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 482: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt16s", value)); + } + break; + case 483: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); + break; + case 484: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 485: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); + break; + case 486: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 487: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); + VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 4)); + VerifyOrReturn(CheckValue("acceptedCommandList[4]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 5)); + VerifyOrReturn(CheckValue("acceptedCommandList[5]", iter_0.GetValue(), 8UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 6)); + VerifyOrReturn(CheckValue("acceptedCommandList[6]", iter_0.GetValue(), 9UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 7)); + VerifyOrReturn(CheckValue("acceptedCommandList[7]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 8)); + VerifyOrReturn(CheckValue("acceptedCommandList[8]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 9)); + VerifyOrReturn(CheckValue("acceptedCommandList[9]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 10)); + VerifyOrReturn(CheckValue("acceptedCommandList[10]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 11)); + VerifyOrReturn(CheckValue("acceptedCommandList[11]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 12)); + VerifyOrReturn(CheckValue("acceptedCommandList[12]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 13)); + VerifyOrReturn(CheckValue("acceptedCommandList[13]", iter_0.GetValue(), 17UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 14)); + VerifyOrReturn(CheckValue("acceptedCommandList[14]", iter_0.GetValue(), 18UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 15)); + VerifyOrReturn(CheckValue("acceptedCommandList[15]", iter_0.GetValue(), 19UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 16)); + VerifyOrReturn(CheckValue("acceptedCommandList[16]", iter_0.GetValue(), 20UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 17)); + VerifyOrReturn(CheckValue("acceptedCommandList[17]", iter_0.GetValue(), 21UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 18)); + } + } + break; + case 488: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("generatedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("generatedCommandList[2]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 3)); + VerifyOrReturn(CheckValue("generatedCommandList[3]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 4)); + VerifyOrReturn(CheckValue("generatedCommandList[4]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 5)); + VerifyOrReturn(CheckValue("generatedCommandList[5]", iter_0.GetValue(), 8UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 6)); + VerifyOrReturn(CheckValue("generatedCommandList[6]", iter_0.GetValue(), 9UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 7)); + VerifyOrReturn(CheckValue("generatedCommandList[7]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 8)); + VerifyOrReturn(CheckValue("generatedCommandList[8]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 9)); + } + } + break; + case 489: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 490: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("structAttr.a", value.a, 5U)); + VerifyOrReturn(CheckValue("structAttr.b", value.b, true)); + VerifyOrReturn(CheckValue("structAttr.c", value.c, 2U)); + VerifyOrReturn(CheckValueAsString("structAttr.d", value.d, chip::ByteSpan(chip::Uint8::from_const_char("abc"), 3))); + VerifyOrReturn(CheckValueAsString("structAttr.e", value.e, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("structAttr.f", value.f, 17U)); + VerifyOrReturn(CheckValue("structAttr.g", value.g, 1.5f)); + VerifyOrReturn(CheckValue("structAttr.h", value.h, 3.14159265358979)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Send Test Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::Test::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::Test::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Send Test Not Handled Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNotHandled::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestNotHandled::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Send Test Specific Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestSpecific::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestSpecific::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Send Test Add Arguments Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Type value; + value.arg1 = 3U; + value.arg2 = 17U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestAddArguments::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Send failing Test Add Arguments Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Type value; + value.arg1 = 250U; + value.arg2 = 6U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestAddArguments::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Read attribute BOOLEAN Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Write attribute BOOLEAN True"); + ListFreer listFreer; + bool value; + value = 1; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Read attribute BOOLEAN True"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Write attribute BOOLEAN False"); + ListFreer listFreer; + bool value; + value = 0; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "Read attribute BOOLEAN False"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Read attribute BITMAP8 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Write attribute BITMAP8 Max Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(255U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Read attribute BITMAP8 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Write attribute BITMAP8 Min Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, "Read attribute BITMAP8 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Read attribute BITMAP16 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Write attribute BITMAP16 Max Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(65535U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Read attribute BITMAP16 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Write attribute BITMAP16 Min Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 20: { + LogStep(20, "Read attribute BITMAP16 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Read attribute BITMAP32 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Write attribute BITMAP32 Max Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(4294967295UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 23: { + LogStep(23, "Read attribute BITMAP32 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Write attribute BITMAP32 Min Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 25: { + LogStep(25, "Read attribute BITMAP32 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Read attribute BITMAP64 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Write attribute BITMAP64 Max Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(18446744073709551615ULL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 28: { + LogStep(28, "Read attribute BITMAP64 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "Write attribute BITMAP64 Min Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0ULL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 30: { + LogStep(30, "Read attribute BITMAP64 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, "Read attribute INT8U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Write attribute INT8U Max Value"); + ListFreer listFreer; + uint8_t value; + value = 255U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 33: { + LogStep(33, "Read attribute INT8U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "Write attribute INT8U Min Value"); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 35: { + LogStep(35, "Read attribute INT8U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "Read attribute INT16U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, true, + chip::NullOptional); + } + case 37: { + LogStep(37, "Write attribute INT16U Max Value"); + ListFreer listFreer; + uint16_t value; + value = 65535U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 38: { + LogStep(38, "Read attribute INT16U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, true, + chip::NullOptional); + } + case 39: { + LogStep(39, "Write attribute INT16U Min Value"); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 40: { + LogStep(40, "Read attribute INT16U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "Read attribute INT32U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "Write attribute INT32U Max Value"); + ListFreer listFreer; + uint32_t value; + value = 4294967295UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, "Read attribute INT32U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Write attribute INT32U Min Value"); + ListFreer listFreer; + uint32_t value; + value = 0UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 45: { + LogStep(45, "Read attribute INT32U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Read attribute INT64U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "Write attribute INT64U Max Value"); + ListFreer listFreer; + uint64_t value; + value = 18446744073709551615ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 48: { + LogStep(48, "Read attribute INT64U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Write attribute INT64U Min Value"); + ListFreer listFreer; + uint64_t value; + value = 0ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 50: { + LogStep(50, "Read attribute INT64U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, true, + chip::NullOptional); + } + case 51: { + LogStep(51, "Read attribute INT8S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Write attribute INT8S Max Value"); + ListFreer listFreer; + int8_t value; + value = 127; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 53: { + LogStep(53, "Read attribute INT8S Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, true, + chip::NullOptional); + } + case 54: { + LogStep(54, "Write attribute INT8S Min Value"); + ListFreer listFreer; + int8_t value; + value = -128; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 55: { + LogStep(55, "Read attribute INT8S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, true, + chip::NullOptional); + } + case 56: { + LogStep(56, "Write attribute INT8S Default Value"); + ListFreer listFreer; + int8_t value; + value = 0; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 57: { + LogStep(57, "Read attribute INT8S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, true, + chip::NullOptional); + } + case 58: { + LogStep(58, "Read attribute INT16S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, true, + chip::NullOptional); + } + case 59: { + LogStep(59, "Write attribute INT16S Max Value"); + ListFreer listFreer; + int16_t value; + value = 32767; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 60: { + LogStep(60, "Read attribute INT16S Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, true, + chip::NullOptional); + } + case 61: { + LogStep(61, "Write attribute INT16S Min Value"); + ListFreer listFreer; + int16_t value; + value = -32768; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 62: { + LogStep(62, "Read attribute INT16S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, true, + chip::NullOptional); + } + case 63: { + LogStep(63, "Write attribute INT16S Default Value"); + ListFreer listFreer; + int16_t value; + value = 0; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 64: { + LogStep(64, "Read attribute INT16S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, true, + chip::NullOptional); + } + case 65: { + LogStep(65, "Read attribute INT32S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, true, + chip::NullOptional); + } + case 66: { + LogStep(66, "Write attribute INT32S Max Value"); + ListFreer listFreer; + int32_t value; + value = 2147483647L; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 67: { + LogStep(67, "Read attribute INT32S Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, true, + chip::NullOptional); + } + case 68: { + LogStep(68, "Write attribute INT32S Min Value"); + ListFreer listFreer; + int32_t value; + value = -2147483648L; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 69: { + LogStep(69, "Read attribute INT32S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, true, + chip::NullOptional); + } + case 70: { + LogStep(70, "Write attribute INT32S Default Value"); + ListFreer listFreer; + int32_t value; + value = 0L; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 71: { + LogStep(71, "Read attribute INT32S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, true, + chip::NullOptional); + } + case 72: { + LogStep(72, "Read attribute INT64S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, true, + chip::NullOptional); + } + case 73: { + LogStep(73, "Write attribute INT64S Max Value"); + ListFreer listFreer; + int64_t value; + value = 9223372036854775807LL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 74: { + LogStep(74, "Read attribute INT64S Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, true, + chip::NullOptional); + } + case 75: { + LogStep(75, "Write attribute INT64S Min Value"); + ListFreer listFreer; + int64_t value; + value = -9223372036854775807LL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 76: { + LogStep(76, "Read attribute INT64S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, true, + chip::NullOptional); + } + case 77: { + LogStep(77, "Write attribute INT64S Default Value"); + ListFreer listFreer; + int64_t value; + value = 0LL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 78: { + LogStep(78, "Read attribute INT64S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, true, + chip::NullOptional); + } + case 79: { + LogStep(79, "Read attribute SINGLE Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, true, + chip::NullOptional); + } + case 80: { + LogStep(80, "Write attribute SINGLE medium Value"); + ListFreer listFreer; + float value; + value = 0.1f; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 81: { + LogStep(81, "Read attribute SINGLE medium Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, true, + chip::NullOptional); + } + case 82: { + LogStep(82, "Write attribute SINGLE large Value"); + ListFreer listFreer; + float value; + value = 17000000000.0f; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 83: { + LogStep(83, "Read attribute SINGLE large Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, true, + chip::NullOptional); + } + case 84: { + LogStep(84, "Write attribute SINGLE small Value"); + ListFreer listFreer; + float value; + value = 1.7e-10f; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 85: { + LogStep(85, "Read attribute SINGLE small Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, true, + chip::NullOptional); + } + case 86: { + LogStep(86, "Write attribute SINGLE Default Value"); + ListFreer listFreer; + float value; + value = 0.0f; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 87: { + LogStep(87, "Read attribute SINGLE Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatSingle::Id, true, + chip::NullOptional); + } + case 88: { + LogStep(88, "Read attribute DOUBLE Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, true, + chip::NullOptional); + } + case 89: { + LogStep(89, "Write attribute DOUBLE medium Value"); + ListFreer listFreer; + double value; + value = 0.1234567890123; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 90: { + LogStep(90, "Read attribute DOUBLE medium Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, true, + chip::NullOptional); + } + case 91: { + LogStep(91, "Write attribute DOUBLE large Value"); + ListFreer listFreer; + double value; + value = 1.7e+200; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 92: { + LogStep(92, "Read attribute DOUBLE large Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, true, + chip::NullOptional); + } + case 93: { + LogStep(93, "Write attribute DOUBLE small Value"); + ListFreer listFreer; + double value; + value = 1.7e-200; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 94: { + LogStep(94, "Read attribute DOUBLE small Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, true, + chip::NullOptional); + } + case 95: { + LogStep(95, "Write attribute DOUBLE Default Value"); + ListFreer listFreer; + double value; + value = 0; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 96: { + LogStep(96, "Read attribute DOUBLE Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::FloatDouble::Id, true, + chip::NullOptional); + } + case 97: { + LogStep(97, "Read attribute ENUM8 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, true, + chip::NullOptional); + } + case 98: { + LogStep(98, "Write attribute ENUM8 Max Value"); + ListFreer listFreer; + uint8_t value; + value = 255U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 99: { + LogStep(99, "Read attribute ENUM8 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, true, + chip::NullOptional); + } + case 100: { + LogStep(100, "Write attribute ENUM8 Min Value"); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 101: { + LogStep(101, "Read attribute ENUM8 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, true, + chip::NullOptional); + } + case 102: { + LogStep(102, "Read attribute ENUM16 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, true, + chip::NullOptional); + } + case 103: { + LogStep(103, "Write attribute ENUM16 Max Value"); + ListFreer listFreer; + uint16_t value; + value = 65535U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 104: { + LogStep(104, "Read attribute ENUM16 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, true, + chip::NullOptional); + } + case 105: { + LogStep(105, "Write attribute ENUM16 Min Value"); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 106: { + LogStep(106, "Read attribute ENUM16 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, true, + chip::NullOptional); + } + case 107: { + LogStep(107, "Read attribute OCTET_STRING Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 108: { + LogStep(108, "Write attribute OCTET_STRING with embedded null"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("Tes\000ti\000nggarbage: not in length on purpose"), 9); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 109: { + LogStep(109, "Read attribute OCTET_STRING with embedded null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 110: { + LogStep(110, "Write attribute OCTET_STRING with hex: format"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("\x00\x01\x02\x03\x04\x05garbage: not in length on purpose"), 6); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 111: { + LogStep(111, "Read attribute OCTET_STRING with hex: format"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 112: { + LogStep(112, "Write attribute OCTET_STRING with weird chars"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("\015\012\377\042\240garbage: not in length on purpose"), 5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 113: { + LogStep(113, "Read attribute OCTET_STRING with weird chars"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 114: { + LogStep(114, "Write attribute OCTET_STRING"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 115: { + LogStep(115, "Read attribute OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 116: { + LogStep(116, "Write attribute OCTET_STRING"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("TestValueLongerThan10garbage: not in length on purpose"), 21); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 117: { + LogStep(117, "Read attribute OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 118: { + LogStep(118, "Write attribute OCTET_STRING"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 119: { + LogStep(119, "Read attribute LONG_OCTET_STRING Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongOctetString::Id, + true, chip::NullOptional); + } + case 120: { + LogStep(120, "Write attribute LONG_OCTET_STRING"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan( + chip::Uint8::from_const_char("1111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111garbage: not in length on purpose"), + 300); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 121: { + LogStep(121, "Read attribute LONG_OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongOctetString::Id, + true, chip::NullOptional); + } + case 122: { + LogStep(122, "Write attribute LONG_OCTET_STRING"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 123: { + LogStep(123, "Read attribute CHAR_STRING Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 124: { + LogStep(124, "Write attribute CHAR_STRING"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("☉T☉garbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 125: { + LogStep(125, "Read attribute CHAR_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 126: { + LogStep(126, "Write attribute CHAR_STRING - Value too long"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("☉TestValueLongerThan10☉garbage: not in length on purpose", 27); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 127: { + LogStep(127, "Read attribute CHAR_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 128: { + LogStep(128, "Write attribute CHAR_STRING - Empty"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 129: { + LogStep(129, "Read attribute LONG_CHAR_STRING Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongCharString::Id, true, + chip::NullOptional); + } + case 130: { + LogStep(130, "Write attribute LONG_CHAR_STRING"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span( + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉garbage: not in length on purpose", + 900); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongCharString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 131: { + LogStep(131, "Read attribute LONG_CHAR_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongCharString::Id, true, + chip::NullOptional); + } + case 132: { + LogStep(132, "Write attribute LONG_CHAR_STRING"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::LongCharString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 133: { + LogStep(133, "Read attribute LIST_LONG_OCTET_STRING (for chunked read)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListLongOctetString::Id, + true, chip::NullOptional); + } + case 134: { + LogStep(134, "Write attribute LIST_LONG_OCTET_STRING (for chunked write)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(5); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + listHolder_0->mList[1] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + listHolder_0->mList[2] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + listHolder_0->mList[3] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + listHolder_0->mList[4] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + value = chip::app::DataModel::List(listHolder_0->mList, 5); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListLongOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 135: { + LogStep(135, "Read attribute LIST_LONG_OCTET_STRING (for chunked read)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListLongOctetString::Id, + true, chip::NullOptional); + } + case 136: { + LogStep(136, "Write attribute LIST_LONG_OCTET_STRING (for chunked write)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + listHolder_0->mList[1] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + listHolder_0->mList[2] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + listHolder_0->mList[3] = chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefgarbage: not in " + "length on purpose"), + 512); + value = chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListLongOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 137: { + LogStep(137, "Read attribute EPOCH_US Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, true, + chip::NullOptional); + } + case 138: { + LogStep(138, "Write attribute EPOCH_US Max Value"); + ListFreer listFreer; + uint64_t value; + value = 18446744073709551615ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 139: { + LogStep(139, "Read attribute EPOCH_US Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, true, + chip::NullOptional); + } + case 140: { + LogStep(140, "Write attribute EPOCH_US Min Value"); + ListFreer listFreer; + uint64_t value; + value = 0ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 141: { + LogStep(141, "Read attribute EPOCH_US Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, true, + chip::NullOptional); + } + case 142: { + LogStep(142, "Read attribute EPOCH_S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, true, + chip::NullOptional); + } + case 143: { + LogStep(143, "Write attribute EPOCH_S Max Value"); + ListFreer listFreer; + uint32_t value; + value = 4294967295UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 144: { + LogStep(144, "Read attribute EPOCH_S Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, true, + chip::NullOptional); + } + case 145: { + LogStep(145, "Write attribute EPOCH_S Min Value"); + ListFreer listFreer; + uint32_t value; + value = 0UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 146: { + LogStep(146, "Read attribute EPOCH_S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, true, + chip::NullOptional); + } + case 147: { + LogStep(147, "Read attribute UNSUPPORTED"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Unsupported::Id, true, + chip::NullOptional); + } + case 148: { + LogStep(148, "Writeattribute UNSUPPORTED"); + ListFreer listFreer; + bool value; + value = 0; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Unsupported::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 149: { + LogStep(149, "Send Test Command to unsupported endpoint"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::Test::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(200), UnitTesting::Id, UnitTesting::Commands::Test::Id, value, + chip::NullOptional + + ); + } + case 150: { + LogStep(150, "Send Test Command to unsupported cluster"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::Test::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), UnitTesting::Id, UnitTesting::Commands::Test::Id, value, + chip::NullOptional + + ); + } + case 151: { + LogStep(151, "Read attribute vendor_id Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, true, + chip::NullOptional); + } + case 152: { + LogStep(152, "Write attribute vendor_id"); + ListFreer listFreer; + chip::VendorId value; + value = static_cast(17); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 153: { + LogStep(153, "Read attribute vendor_id"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, true, + chip::NullOptional); + } + case 154: { + LogStep(154, "Restore attribute vendor_id"); + ListFreer listFreer; + chip::VendorId value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 155: { + LogStep(155, "Send a command with a vendor_id and enum"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestEnumsRequest::Type value; + value.arg1 = static_cast(20003); + value.arg2 = static_cast(1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestEnumsRequest::Id, value, + chip::NullOptional + + ); + } + case 156: { + LogStep(156, "Send a command with a vendor_id and invalid enum"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestEnumsRequest::Type value; + value.arg1 = static_cast(20003); + value.arg2 = static_cast(101); + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestEnumsRequest::Id, value, + chip::NullOptional + + ); + } + case 157: { + LogStep(157, "Send Test Command With Struct Argument and arg1.b is true"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestStructArgumentRequest::Type value; + + value.arg1.a = 0U; + value.arg1.b = true; + value.arg1.c = static_cast(2); + value.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + value.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + value.arg1.f = static_cast>(1U); + value.arg1.g = 0.0f; + value.arg1.h = 0; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestStructArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 158: { + LogStep(158, "Send Test Command With Struct Argument and arg1.b is false"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestStructArgumentRequest::Type value; + + value.arg1.a = 0U; + value.arg1.b = false; + value.arg1.c = static_cast(2); + value.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + value.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + value.arg1.f = static_cast>(1U); + value.arg1.g = 0.0f; + value.arg1.h = 0; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestStructArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 159: { + LogStep(159, "Send Test Command With Nested Struct Argument and arg1.c.b is true"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNestedStructArgumentRequest::Type value; + + value.arg1.a = 0U; + value.arg1.b = true; + + value.arg1.c.a = 0U; + value.arg1.c.b = true; + value.arg1.c.c = static_cast(2); + value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + value.arg1.c.f = static_cast>(1U); + value.arg1.c.g = 0.0f; + value.arg1.c.h = 0; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestNestedStructArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 160: { + LogStep(160, "Send Test Command With Nested Struct Argument arg1.c.b is false"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNestedStructArgumentRequest::Type value; + + value.arg1.a = 0U; + value.arg1.b = true; + + value.arg1.c.a = 0U; + value.arg1.c.b = false; + value.arg1.c.c = static_cast(2); + value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + value.arg1.c.f = static_cast>(1U); + value.arg1.c.g = 0.0f; + value.arg1.c.h = 0; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestNestedStructArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 161: { + LogStep(161, "Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNestedStructListArgumentRequest::Type value; + + value.arg1.a = 0U; + value.arg1.b = true; + + value.arg1.c.a = 0U; + value.arg1.c.b = true; + value.arg1.c.c = static_cast(2); + value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + value.arg1.c.f = static_cast>(1U); + value.arg1.c.g = 0.0f; + value.arg1.c.h = 0; + + { + auto * listHolder_1 = new ListHolder(2); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].a = 1U; + listHolder_1->mList[0].b = true; + listHolder_1->mList[0].c = static_cast(3); + listHolder_1->mList[0].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_1->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_1->mList[0].f = static_cast>(1U); + listHolder_1->mList[0].g = 0.0f; + listHolder_1->mList[0].h = 0; + + listHolder_1->mList[1].a = 2U; + listHolder_1->mList[1].b = true; + listHolder_1->mList[1].c = static_cast(3); + listHolder_1->mList[1].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_1->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_1->mList[1].f = static_cast>(1U); + listHolder_1->mList[1].g = 0.0f; + listHolder_1->mList[1].h = 0; + + value.arg1.d = chip::app::DataModel::List( + listHolder_1->mList, 2); + } + + { + auto * listHolder_1 = new ListHolder(3); + listFreer.add(listHolder_1); + listHolder_1->mList[0] = 1UL; + listHolder_1->mList[1] = 2UL; + listHolder_1->mList[2] = 3UL; + value.arg1.e = chip::app::DataModel::List(listHolder_1->mList, 3); + } + + { + auto * listHolder_1 = new ListHolder(3); + listFreer.add(listHolder_1); + listHolder_1->mList[0] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + listHolder_1->mList[1] = + chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + listHolder_1->mList[2] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + value.arg1.f = chip::app::DataModel::List(listHolder_1->mList, 3); + } + + { + auto * listHolder_1 = new ListHolder(2); + listFreer.add(listHolder_1); + listHolder_1->mList[0] = 0U; + listHolder_1->mList[1] = 255U; + value.arg1.g = chip::app::DataModel::List(listHolder_1->mList, 2); + } + + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestNestedStructListArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 162: { + LogStep(162, "Send Test Command With Nested Struct List Argument and some fields b of arg1.d are false"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNestedStructListArgumentRequest::Type value; + + value.arg1.a = 0U; + value.arg1.b = true; + + value.arg1.c.a = 0U; + value.arg1.c.b = true; + value.arg1.c.c = static_cast(2); + value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + value.arg1.c.f = static_cast>(1U); + value.arg1.c.g = 0.0f; + value.arg1.c.h = 0; + + { + auto * listHolder_1 = new ListHolder(2); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].a = 1U; + listHolder_1->mList[0].b = true; + listHolder_1->mList[0].c = static_cast(3); + listHolder_1->mList[0].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_1->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_1->mList[0].f = static_cast>(1U); + listHolder_1->mList[0].g = 0.0f; + listHolder_1->mList[0].h = 0; + + listHolder_1->mList[1].a = 2U; + listHolder_1->mList[1].b = false; + listHolder_1->mList[1].c = static_cast(3); + listHolder_1->mList[1].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_1->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_1->mList[1].f = static_cast>(1U); + listHolder_1->mList[1].g = 0.0f; + listHolder_1->mList[1].h = 0; + + value.arg1.d = chip::app::DataModel::List( + listHolder_1->mList, 2); + } + + { + auto * listHolder_1 = new ListHolder(3); + listFreer.add(listHolder_1); + listHolder_1->mList[0] = 1UL; + listHolder_1->mList[1] = 2UL; + listHolder_1->mList[2] = 3UL; + value.arg1.e = chip::app::DataModel::List(listHolder_1->mList, 3); + } + + { + auto * listHolder_1 = new ListHolder(3); + listFreer.add(listHolder_1); + listHolder_1->mList[0] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + listHolder_1->mList[1] = + chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + listHolder_1->mList[2] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + value.arg1.f = chip::app::DataModel::List(listHolder_1->mList, 3); + } + + { + auto * listHolder_1 = new ListHolder(2); + listFreer.add(listHolder_1); + listHolder_1->mList[0] = 0U; + listHolder_1->mList[1] = 255U; + value.arg1.g = chip::app::DataModel::List(listHolder_1->mList, 2); + } + + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestNestedStructListArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 163: { + LogStep(163, "Send Test Command With Struct Argument and see what we get back"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::SimpleStructEchoRequest::Type value; + + value.arg1.a = 17U; + value.arg1.b = false; + value.arg1.c = static_cast(2); + value.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + value.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + value.arg1.f = static_cast>(1U); + value.arg1.g = 0.1f; + value.arg1.h = 0.1; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::SimpleStructEchoRequest::Id, + value, chip::NullOptional + + ); + } + case 164: { + LogStep(164, "Send Test Command With List of INT8U and none of them is set to 0"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListInt8UArgumentRequest::Type value; + + { + auto * listHolder_0 = new ListHolder(9); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 1U; + listHolder_0->mList[1] = 2U; + listHolder_0->mList[2] = 3U; + listHolder_0->mList[3] = 4U; + listHolder_0->mList[4] = 5U; + listHolder_0->mList[5] = 6U; + listHolder_0->mList[6] = 7U; + listHolder_0->mList[7] = 8U; + listHolder_0->mList[8] = 9U; + value.arg1 = chip::app::DataModel::List(listHolder_0->mList, 9); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListInt8UArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 165: { + LogStep(165, "Send Test Command With List of INT8U and one of them is set to 0"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListInt8UArgumentRequest::Type value; + + { + auto * listHolder_0 = new ListHolder(10); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 1U; + listHolder_0->mList[1] = 2U; + listHolder_0->mList[2] = 3U; + listHolder_0->mList[3] = 4U; + listHolder_0->mList[4] = 5U; + listHolder_0->mList[5] = 6U; + listHolder_0->mList[6] = 7U; + listHolder_0->mList[7] = 8U; + listHolder_0->mList[8] = 9U; + listHolder_0->mList[9] = 0U; + value.arg1 = chip::app::DataModel::List(listHolder_0->mList, 10); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListInt8UArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 166: { + LogStep(166, "Send Test Command With List of INT8U and get it reversed"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseRequest::Type value; + + { + auto * listHolder_0 = new ListHolder(9); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 1U; + listHolder_0->mList[1] = 2U; + listHolder_0->mList[2] = 3U; + listHolder_0->mList[3] = 4U; + listHolder_0->mList[4] = 5U; + listHolder_0->mList[5] = 6U; + listHolder_0->mList[6] = 7U; + listHolder_0->mList[7] = 8U; + listHolder_0->mList[8] = 9U; + value.arg1 = chip::app::DataModel::List(listHolder_0->mList, 9); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListInt8UReverseRequest::Id, value, chip::NullOptional + + ); + } + case 167: { + LogStep(167, "Send Test Command With empty List of INT8U and get an empty list back"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseRequest::Type value; + + value.arg1 = chip::app::DataModel::List(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListInt8UReverseRequest::Id, value, chip::NullOptional + + ); + } + case 168: { + LogStep(168, "Send Test Command With List of Struct Argument and arg1.b of first item is true"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListStructArgumentRequest::Type value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].a = 0U; + listHolder_0->mList[0].b = true; + listHolder_0->mList[0].c = static_cast(2); + listHolder_0->mList[0].d = + chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); + listHolder_0->mList[0].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); + listHolder_0->mList[0].f = static_cast>(1U); + listHolder_0->mList[0].g = 0.0f; + listHolder_0->mList[0].h = 0; + + listHolder_0->mList[1].a = 1U; + listHolder_0->mList[1].b = true; + listHolder_0->mList[1].c = static_cast(3); + listHolder_0->mList[1].d = + chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); + listHolder_0->mList[1].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); + listHolder_0->mList[1].f = static_cast>(1U); + listHolder_0->mList[1].g = 0.0f; + listHolder_0->mList[1].h = 0; + + value.arg1 = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListStructArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 169: { + LogStep(169, "Send Test Command With List of Struct Argument and arg1.b of first item is false"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListStructArgumentRequest::Type value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].a = 1U; + listHolder_0->mList[0].b = true; + listHolder_0->mList[0].c = static_cast(3); + listHolder_0->mList[0].d = + chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); + listHolder_0->mList[0].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); + listHolder_0->mList[0].f = static_cast>(1U); + listHolder_0->mList[0].g = 0.0f; + listHolder_0->mList[0].h = 0; + + listHolder_0->mList[1].a = 0U; + listHolder_0->mList[1].b = false; + listHolder_0->mList[1].c = static_cast(2); + listHolder_0->mList[1].d = + chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); + listHolder_0->mList[1].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); + listHolder_0->mList[1].f = static_cast>(1U); + listHolder_0->mList[1].g = 0.0f; + listHolder_0->mList[1].h = 0; + + value.arg1 = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListStructArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 170: { + LogStep(170, + "Send Test Command With List of Nested Struct List Argument and all fields b of elements of arg1.d are true"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListNestedStructListArgumentRequest::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].a = 0U; + listHolder_0->mList[0].b = true; + + listHolder_0->mList[0].c.a = 0U; + listHolder_0->mList[0].c.b = true; + listHolder_0->mList[0].c.c = static_cast(2); + listHolder_0->mList[0].c.d = + chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + listHolder_0->mList[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + listHolder_0->mList[0].c.f = static_cast>(1U); + listHolder_0->mList[0].c.g = 0.0f; + listHolder_0->mList[0].c.h = 0; + + { + auto * listHolder_2 = new ListHolder(2); + listFreer.add(listHolder_2); + + listHolder_2->mList[0].a = 1U; + listHolder_2->mList[0].b = true; + listHolder_2->mList[0].c = static_cast(3); + listHolder_2->mList[0].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_2->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_2->mList[0].f = static_cast>(1U); + listHolder_2->mList[0].g = 0.0f; + listHolder_2->mList[0].h = 0; + + listHolder_2->mList[1].a = 2U; + listHolder_2->mList[1].b = true; + listHolder_2->mList[1].c = static_cast(3); + listHolder_2->mList[1].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_2->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_2->mList[1].f = static_cast>(1U); + listHolder_2->mList[1].g = 0.0f; + listHolder_2->mList[1].h = 0; + + listHolder_0->mList[0].d = + chip::app::DataModel::List( + listHolder_2->mList, 2); + } + + { + auto * listHolder_2 = new ListHolder(3); + listFreer.add(listHolder_2); + listHolder_2->mList[0] = 1UL; + listHolder_2->mList[1] = 2UL; + listHolder_2->mList[2] = 3UL; + listHolder_0->mList[0].e = chip::app::DataModel::List(listHolder_2->mList, 3); + } + + { + auto * listHolder_2 = new ListHolder(3); + listFreer.add(listHolder_2); + listHolder_2->mList[0] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + listHolder_2->mList[1] = + chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + listHolder_2->mList[2] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + listHolder_0->mList[0].f = chip::app::DataModel::List(listHolder_2->mList, 3); + } + + { + auto * listHolder_2 = new ListHolder(2); + listFreer.add(listHolder_2); + listHolder_2->mList[0] = 0U; + listHolder_2->mList[1] = 255U; + listHolder_0->mList[0].g = chip::app::DataModel::List(listHolder_2->mList, 2); + } + + value.arg1 = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListNestedStructListArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 171: { + LogStep(171, "Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d are false"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestListNestedStructListArgumentRequest::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].a = 0U; + listHolder_0->mList[0].b = true; + + listHolder_0->mList[0].c.a = 0U; + listHolder_0->mList[0].c.b = true; + listHolder_0->mList[0].c.c = static_cast(2); + listHolder_0->mList[0].c.d = + chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + listHolder_0->mList[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + listHolder_0->mList[0].c.f = static_cast>(1U); + listHolder_0->mList[0].c.g = 0.0f; + listHolder_0->mList[0].c.h = 0; + + { + auto * listHolder_2 = new ListHolder(2); + listFreer.add(listHolder_2); + + listHolder_2->mList[0].a = 1U; + listHolder_2->mList[0].b = true; + listHolder_2->mList[0].c = static_cast(3); + listHolder_2->mList[0].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_2->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_2->mList[0].f = static_cast>(1U); + listHolder_2->mList[0].g = 0.0f; + listHolder_2->mList[0].h = 0; + + listHolder_2->mList[1].a = 2U; + listHolder_2->mList[1].b = false; + listHolder_2->mList[1].c = static_cast(3); + listHolder_2->mList[1].d = + chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + listHolder_2->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + listHolder_2->mList[1].f = static_cast>(1U); + listHolder_2->mList[1].g = 0.0f; + listHolder_2->mList[1].h = 0; + + listHolder_0->mList[0].d = + chip::app::DataModel::List( + listHolder_2->mList, 2); + } + + { + auto * listHolder_2 = new ListHolder(3); + listFreer.add(listHolder_2); + listHolder_2->mList[0] = 1UL; + listHolder_2->mList[1] = 2UL; + listHolder_2->mList[2] = 3UL; + listHolder_0->mList[0].e = chip::app::DataModel::List(listHolder_2->mList, 3); + } + + { + auto * listHolder_2 = new ListHolder(3); + listFreer.add(listHolder_2); + listHolder_2->mList[0] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + listHolder_2->mList[1] = + chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + listHolder_2->mList[2] = + chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + listHolder_0->mList[0].f = chip::app::DataModel::List(listHolder_2->mList, 3); + } + + { + auto * listHolder_2 = new ListHolder(2); + listFreer.add(listHolder_2); + listHolder_2->mList[0] = 0U; + listHolder_2->mList[1] = 255U; + listHolder_0->mList[0].g = chip::app::DataModel::List(listHolder_2->mList, 2); + } + + value.arg1 = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestListNestedStructListArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 172: { + LogStep(172, "Write attribute LIST With List of INT8U and none of them is set to 0"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 1U; + listHolder_0->mList[1] = 2U; + listHolder_0->mList[2] = 3U; + listHolder_0->mList[3] = 4U; + value = chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 173: { + LogStep(173, "Read attribute LIST With List of INT8U"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, true, + chip::NullOptional); + } + case 174: { + LogStep(174, "Write attribute LIST With List of OCTET_STRING"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); + listHolder_0->mList[1] = chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); + listHolder_0->mList[2] = chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); + listHolder_0->mList[3] = chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); + value = chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 175: { + LogStep(175, "Read attribute LIST With List of OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListOctetString::Id, + true, chip::NullOptional); + } + case 176: { + LogStep(176, "Write attribute LIST With List of LIST_STRUCT_OCTET_STRING"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].member1 = 0ULL; + listHolder_0->mList[0].member2 = + chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); + + listHolder_0->mList[1].member1 = 1ULL; + listHolder_0->mList[1].member2 = + chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); + + listHolder_0->mList[2].member1 = 2ULL; + listHolder_0->mList[2].member2 = + chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); + + listHolder_0->mList[3].member1 = 3ULL; + listHolder_0->mList[3].member2 = + chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); + + value = chip::app::DataModel::List( + listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::ListStructOctetString::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 177: { + LogStep(177, "Read attribute LIST With List of LIST_STRUCT_OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::ListStructOctetString::Id, true, chip::NullOptional); + } + case 178: { + LogStep(178, "Send Test Command with optional arg set."); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalRequest::Type value; + value.arg1.Emplace(); + value.arg1.Value().SetNonNull(); + value.arg1.Value().Value() = 5U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestNullableOptionalRequest::Id, value, chip::NullOptional + + ); + } + case 179: { + LogStep(179, "Send Test Command without its optional arg."); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestNullableOptionalRequest::Id, value, chip::NullOptional + + ); + } + case 180: { + LogStep(180, "Read list of structs containing nullables and optionals"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::ListNullablesAndOptionalsStruct::Id, true, chip::NullOptional); + } + case 181: { + LogStep(181, "Write list of structs containing nullables and optionals"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].nullableInt.SetNull(); + listHolder_0->mList[0].nullableString.SetNull(); + listHolder_0->mList[0].nullableStruct.SetNull(); + listHolder_0->mList[0].nullableList.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = static_cast(1); + listHolder_3->mList[1] = static_cast(2); + listHolder_0->mList[0].nullableList.Value() = + chip::app::DataModel::List(listHolder_3->mList, 2); + } + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::ListNullablesAndOptionalsStruct::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 182: { + LogStep(182, "Read list of structs containing nullables and optionals after writing"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::ListNullablesAndOptionalsStruct::Id, true, chip::NullOptional); + } + case 183: { + LogStep(183, "Write attribute NULLABLE_BOOLEAN null"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBoolean::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 184: { + LogStep(184, "Read attribute NULLABLE_BOOLEAN null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBoolean::Id, + true, chip::NullOptional); + } + case 185: { + LogStep(185, "Write attribute NULLABLE_BOOLEAN True"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBoolean::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 186: { + LogStep(186, "Read attribute NULLABLE_BOOLEAN True"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBoolean::Id, + true, chip::NullOptional); + } + case 187: { + LogStep(187, "Read attribute NULLABLE_BOOLEAN not null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBoolean::Id, + true, chip::NullOptional); + } + case 188: { + LogStep(188, "Write attribute NULLABLE_BITMAP8 Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(254U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap8::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 189: { + LogStep(189, "Read attribute NULLABLE_BITMAP8 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap8::Id, + true, chip::NullOptional); + } + case 190: { + LogStep(190, "Write attribute NULLABLE_BITMAP8 Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(255U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap8::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 191: { + LogStep(191, "Read attribute NULLABLE_BITMAP8 unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap8::Id, + true, chip::NullOptional); + } + case 192: { + LogStep(192, "Write attribute NULLABLE_BITMAP8 null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap8::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 193: { + LogStep(193, "Read attribute NULLABLE_BITMAP8 null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap8::Id, + true, chip::NullOptional); + } + case 194: { + LogStep(194, "Read attribute NULLABLE_BITMAP8 not 254 Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap8::Id, + true, chip::NullOptional); + } + case 195: { + LogStep(195, "Write attribute NULLABLE_BITMAP16 Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(65534U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap16::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 196: { + LogStep(196, "Read attribute NULLABLE_BITMAP16 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap16::Id, + true, chip::NullOptional); + } + case 197: { + LogStep(197, "Write attribute NULLABLE_BITMAP16 Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(65535U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap16::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 198: { + LogStep(198, "Read attribute NULLABLE_BITMAP16 unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap16::Id, + true, chip::NullOptional); + } + case 199: { + LogStep(199, "Write attribute NULLABLE_BITMAP16 null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap16::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 200: { + LogStep(200, "Read attribute NULLABLE_BITMAP16 null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap16::Id, + true, chip::NullOptional); + } + case 201: { + LogStep(201, "Write attribute NULLABLE_BITMAP32 Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(4294967294UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap32::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 202: { + LogStep(202, "Read attribute NULLABLE_BITMAP32 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap32::Id, + true, chip::NullOptional); + } + case 203: { + LogStep(203, "Write attribute NULLABLE_BITMAP32 Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(4294967295UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap32::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 204: { + LogStep(204, "Read attribute NULLABLE_BITMAP32 unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap32::Id, + true, chip::NullOptional); + } + case 205: { + LogStep(205, "Write attribute NULLABLE_BITMAP32 null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap32::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 206: { + LogStep(206, "Read attribute NULLABLE_BITMAP32 null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap32::Id, + true, chip::NullOptional); + } + case 207: { + LogStep(207, "Write attribute NULLABLE_BITMAP64 Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(18446744073709551614ULL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap64::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 208: { + LogStep(208, "Read attribute NULLABLE_BITMAP64 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap64::Id, + true, chip::NullOptional); + } + case 209: { + LogStep(209, "Write attribute NULLABLE_BITMAP64 Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNonNull(); + value.Value() = static_cast>(18446744073709551615ULL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap64::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 210: { + LogStep(210, "Read attribute NULLABLE_BITMAP64 unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap64::Id, + true, chip::NullOptional); + } + case 211: { + LogStep(211, "Write attribute NULLABLE_BITMAP64 null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable> value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap64::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 212: { + LogStep(212, "Read attribute NULLABLE_BITMAP64 null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableBitmap64::Id, + true, chip::NullOptional); + } + case 213: { + LogStep(213, "Write attribute NULLABLE_INT8U Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 214: { + LogStep(214, "Read attribute NULLABLE_INT8U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 215: { + LogStep(215, "Write attribute NULLABLE_INT8U Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 254U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 216: { + LogStep(216, "Read attribute NULLABLE_INT8U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 217: { + LogStep(217, "Write attribute NULLABLE_INT8U Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 255U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 218: { + LogStep(218, "Read attribute NULLABLE_INT8U unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 219: { + LogStep(219, "Read attribute NULLABLE_INT8U unchanged Value with constraint"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 220: { + LogStep(220, "Write attribute NULLABLE_INT8U null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 221: { + LogStep(221, "Read attribute NULLABLE_INT8U null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 222: { + LogStep(222, "Read attribute NULLABLE_INT8U null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 223: { + LogStep(223, "Read attribute NULLABLE_INT8U null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 224: { + LogStep(224, "Write attribute NULLABLE_INT8U Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 128U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 225: { + LogStep(225, "Read attribute NULLABLE_INT8U Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 226: { + LogStep(226, "Read attribute NULLABLE_INT8U notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 227: { + LogStep(227, "Write attribute NULLABLE_INT16U Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 228: { + LogStep(228, "Read attribute NULLABLE_INT16U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 229: { + LogStep(229, "Write attribute NULLABLE_INT16U Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 65534U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 230: { + LogStep(230, "Read attribute NULLABLE_INT16U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 231: { + LogStep(231, "Write attribute NULLABLE_INT16U Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 65535U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 232: { + LogStep(232, "Read attribute NULLABLE_INT16U unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 233: { + LogStep(233, "Write attribute NULLABLE_INT16U null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 234: { + LogStep(234, "Read attribute NULLABLE_INT16U null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 235: { + LogStep(235, "Read attribute NULLABLE_INT16U null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 236: { + LogStep(236, "Read attribute NULLABLE_INT16U null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 237: { + LogStep(237, "Write attribute NULLABLE_INT16U Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 32000U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 238: { + LogStep(238, "Read attribute NULLABLE_INT16U Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 239: { + LogStep(239, "Read attribute NULLABLE_INT16U notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16u::Id, true, + chip::NullOptional); + } + case 240: { + LogStep(240, "Write attribute NULLABLE_INT32U Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 241: { + LogStep(241, "Read attribute NULLABLE_INT32U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 242: { + LogStep(242, "Write attribute NULLABLE_INT32U Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 4294967294UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 243: { + LogStep(243, "Read attribute NULLABLE_INT32U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 244: { + LogStep(244, "Write attribute NULLABLE_INT32U Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 4294967295UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 245: { + LogStep(245, "Read attribute NULLABLE_INT32U unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 246: { + LogStep(246, "Write attribute NULLABLE_INT32U null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 247: { + LogStep(247, "Read attribute NULLABLE_INT32U null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 248: { + LogStep(248, "Read attribute NULLABLE_INT32U null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 249: { + LogStep(249, "Read attribute NULLABLE_INT32U null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 250: { + LogStep(250, "Write attribute NULLABLE_INT32U Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 2147483647UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 251: { + LogStep(251, "Read attribute NULLABLE_INT32U Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 252: { + LogStep(252, "Read attribute NULLABLE_INT32U notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32u::Id, true, + chip::NullOptional); + } + case 253: { + LogStep(253, "Write attribute NULLABLE_INT64U Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 254: { + LogStep(254, "Read attribute NULLABLE_INT64U Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 255: { + LogStep(255, "Write attribute NULLABLE_INT64U Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 18446744073709551614ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 256: { + LogStep(256, "Read attribute NULLABLE_INT64U Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 257: { + LogStep(257, "Write attribute NULLABLE_INT64U Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 18446744073709551615ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 258: { + LogStep(258, "Read attribute NULLABLE_INT64U unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 259: { + LogStep(259, "Write attribute NULLABLE_INT64U null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 260: { + LogStep(260, "Read attribute NULLABLE_INT64U null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 261: { + LogStep(261, "Read attribute NULLABLE_INT64U null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 262: { + LogStep(262, "Read attribute NULLABLE_INT64U null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 263: { + LogStep(263, "Write attribute NULLABLE_INT64U Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 18000000000000000000ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 264: { + LogStep(264, "Read attribute NULLABLE_INT64U Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 265: { + LogStep(265, "Read attribute NULLABLE_INT64U notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64u::Id, true, + chip::NullOptional); + } + case 266: { + LogStep(266, "Write attribute NULLABLE_INT8S Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -127; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 267: { + LogStep(267, "Read attribute NULLABLE_INT8S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, true, + chip::NullOptional); + } + case 268: { + LogStep(268, "Write attribute NULLABLE_INT8S Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -128; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 269: { + LogStep(269, "Read attribute NULLABLE_INT8S unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, true, + chip::NullOptional); + } + case 270: { + LogStep(270, "Write attribute NULLABLE_INT8S null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 271: { + LogStep(271, "Read attribute NULLABLE_INT8S null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, true, + chip::NullOptional); + } + case 272: { + LogStep(272, "Read attribute NULLABLE_INT8S null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, true, + chip::NullOptional); + } + case 273: { + LogStep(273, "Read attribute NULLABLE_INT8S null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, true, + chip::NullOptional); + } + case 274: { + LogStep(274, "Write attribute NULLABLE_INT8S Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -127; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 275: { + LogStep(275, "Read attribute NULLABLE_INT8S Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, true, + chip::NullOptional); + } + case 276: { + LogStep(276, "Read attribute NULLABLE_INT8S notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8s::Id, true, + chip::NullOptional); + } + case 277: { + LogStep(277, "Write attribute NULLABLE_INT16S Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -32767; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 278: { + LogStep(278, "Read attribute NULLABLE_INT16S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, true, + chip::NullOptional); + } + case 279: { + LogStep(279, "Write attribute NULLABLE_INT16S Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -32768; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 280: { + LogStep(280, "Read attribute NULLABLE_INT16S unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, true, + chip::NullOptional); + } + case 281: { + LogStep(281, "Write attribute NULLABLE_INT16S null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 282: { + LogStep(282, "Read attribute NULLABLE_INT16S null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, true, + chip::NullOptional); + } + case 283: { + LogStep(283, "Read attribute NULLABLE_INT16S null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, true, + chip::NullOptional); + } + case 284: { + LogStep(284, "Read attribute NULLABLE_INT16S null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, true, + chip::NullOptional); + } + case 285: { + LogStep(285, "Write attribute NULLABLE_INT16S Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -32767; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 286: { + LogStep(286, "Read attribute NULLABLE_INT16S Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, true, + chip::NullOptional); + } + case 287: { + LogStep(287, "Read attribute NULLABLE_INT16S notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt16s::Id, true, + chip::NullOptional); + } + case 288: { + LogStep(288, "Write attribute NULLABLE_INT32S Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -2147483647L; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 289: { + LogStep(289, "Read attribute NULLABLE_INT32S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, true, + chip::NullOptional); + } + case 290: { + LogStep(290, "Write attribute NULLABLE_INT32S Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -2147483648L; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 291: { + LogStep(291, "Read attribute NULLABLE_INT32S unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, true, + chip::NullOptional); + } + case 292: { + LogStep(292, "Write attribute NULLABLE_INT32S null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 293: { + LogStep(293, "Read attribute NULLABLE_INT32S null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, true, + chip::NullOptional); + } + case 294: { + LogStep(294, "Read attribute NULLABLE_INT32S null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, true, + chip::NullOptional); + } + case 295: { + LogStep(295, "Read attribute NULLABLE_INT32S null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, true, + chip::NullOptional); + } + case 296: { + LogStep(296, "Write attribute NULLABLE_INT32S Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -2147483647L; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 297: { + LogStep(297, "Read attribute NULLABLE_INT32S Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, true, + chip::NullOptional); + } + case 298: { + LogStep(298, "Read attribute NULLABLE_INT32S notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt32s::Id, true, + chip::NullOptional); + } + case 299: { + LogStep(299, "Write attribute NULLABLE_INT64S Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -9223372036854775807LL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 300: { + LogStep(300, "Read attribute NULLABLE_INT64S Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, true, + chip::NullOptional); + } + case 301: { + LogStep(301, "Write attribute NULLABLE_INT64S Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(-9223372036854775807LL - 1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 302: { + LogStep(302, "Read attribute NULLABLE_INT64S unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, true, + chip::NullOptional); + } + case 303: { + LogStep(303, "Write attribute NULLABLE_INT64S null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 304: { + LogStep(304, "Read attribute NULLABLE_INT64S null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, true, + chip::NullOptional); + } + case 305: { + LogStep(305, "Read attribute NULLABLE_INT64S null Value & range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, true, + chip::NullOptional); + } + case 306: { + LogStep(306, "Read attribute NULLABLE_INT64S null Value & not"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, true, + chip::NullOptional); + } + case 307: { + LogStep(307, "Write attribute NULLABLE_INT64S Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -9223372036854775807LL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 308: { + LogStep(308, "Read attribute NULLABLE_INT64S Value in range"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, true, + chip::NullOptional); + } + case 309: { + LogStep(309, "Read attribute NULLABLE_INT64S notValue OK"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt64s::Id, true, + chip::NullOptional); + } + case 310: { + LogStep(310, "Write attribute NULLABLE_SINGLE medium Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0.1f; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 311: { + LogStep(311, "Read attribute NULLABLE_SINGLE medium Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + true, chip::NullOptional); + } + case 312: { + LogStep(312, "Write attribute NULLABLE_SINGLE largest Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = INFINITY; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 313: { + LogStep(313, "Read attribute NULLABLE_SINGLE largest Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + true, chip::NullOptional); + } + case 314: { + LogStep(314, "Write attribute NULLABLE_SINGLE smallest Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -INFINITY; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 315: { + LogStep(315, "Read attribute NULLABLE_SINGLE smallest Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + true, chip::NullOptional); + } + case 316: { + LogStep(316, "Write attribute NULLABLE_SINGLE null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 317: { + LogStep(317, "Read attribute NULLABLE_SINGLE null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + true, chip::NullOptional); + } + case 318: { + LogStep(318, "Write attribute NULLABLE_SINGLE 0 Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0.0f; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 319: { + LogStep(319, "Read attribute NULLABLE_SINGLE 0 Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatSingle::Id, + true, chip::NullOptional); + } + case 320: { + LogStep(320, "Write attribute NULLABLE_DOUBLE medium Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0.1234567890123; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 321: { + LogStep(321, "Read attribute NULLABLE_DOUBLE medium Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + true, chip::NullOptional); + } + case 322: { + LogStep(322, "Write attribute NULLABLE_DOUBLE largest Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = INFINITY; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 323: { + LogStep(323, "Read attribute NULLABLE_DOUBLE largest Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + true, chip::NullOptional); + } + case 324: { + LogStep(324, "Write attribute NULLABLE_DOUBLE smallest Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -INFINITY; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 325: { + LogStep(325, "Read attribute NULLABLE_DOUBLE smallest Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + true, chip::NullOptional); + } + case 326: { + LogStep(326, "Write attribute NULLABLE_DOUBLE null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 327: { + LogStep(327, "Read attribute NULLABLE_DOUBLE null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + true, chip::NullOptional); + } + case 328: { + LogStep(328, "Write attribute NULLABLE_DOUBLE 0 Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 329: { + LogStep(329, "Read attribute NULLABLE_DOUBLE 0 Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableFloatDouble::Id, + true, chip::NullOptional); + } + case 330: { + LogStep(330, "Write attribute NULLABLE_ENUM8 Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 331: { + LogStep(331, "Read attribute NULLABLE_ENUM8 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, true, + chip::NullOptional); + } + case 332: { + LogStep(332, "Write attribute NULLABLE_ENUM8 Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 254U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 333: { + LogStep(333, "Read attribute NULLABLE_ENUM8 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, true, + chip::NullOptional); + } + case 334: { + LogStep(334, "Write attribute NULLABLE_ENUM8 Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 255U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 335: { + LogStep(335, "Read attribute NULLABLE_ENUM8 unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, true, + chip::NullOptional); + } + case 336: { + LogStep(336, "Write attribute NULLABLE_ENUM8 null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 337: { + LogStep(337, "Read attribute NULLABLE_ENUM8 null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum8::Id, true, + chip::NullOptional); + } + case 338: { + LogStep(338, "Write attribute NULLABLE_ENUM16 Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 339: { + LogStep(339, "Read attribute NULLABLE_ENUM16 Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, true, + chip::NullOptional); + } + case 340: { + LogStep(340, "Write attribute NULLABLE_ENUM16 Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 65534U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 341: { + LogStep(341, "Read attribute NULLABLE_ENUM16 Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, true, + chip::NullOptional); + } + case 342: { + LogStep(342, "Write attribute NULLABLE_ENUM16 Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 65535U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 343: { + LogStep(343, "Read attribute NULLABLE_ENUM16 unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, true, + chip::NullOptional); + } + case 344: { + LogStep(344, "Write attribute NULLABLE_ENUM16 null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 345: { + LogStep(345, "Read attribute NULLABLE_ENUM16 null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnum16::Id, true, + chip::NullOptional); + } + case 346: { + LogStep(346, "Write attribute NULLABLE_SIMPLE_ENUM Min Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 347: { + LogStep(347, "Read attribute NULLABLE_SIMPLE_ENUM Min Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + true, chip::NullOptional); + } + case 348: { + LogStep(348, "Write attribute NULLABLE_SIMPLE_ENUM Max Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 349: { + LogStep(349, "Read attribute NULLABLE_SIMPLE_ENUM Max Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + true, chip::NullOptional); + } + case 350: { + LogStep(350, "Write attribute NULLABLE_SIMPLE_ENUM Invalid Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(255); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 351: { + LogStep(351, "Read attribute NULLABLE_SIMPLE_ENUM unchanged Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + true, chip::NullOptional); + } + case 352: { + LogStep(352, "Write attribute NULLABLE_SIMPLE_ENUM null Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 353: { + LogStep(353, "Read attribute NULLABLE_SIMPLE_ENUM null Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + true, chip::NullOptional); + } + case 354: { + LogStep(354, "Read attribute NULLABLE_SIMPLE_ENUM not 3 Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableEnumAttr::Id, + true, chip::NullOptional); + } + case 355: { + LogStep(355, "Read attribute NULLABLE_OCTET_STRING Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 356: { + LogStep(356, "Write attribute NULLABLE_OCTET_STRING"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 357: { + LogStep(357, "Read attribute NULLABLE_OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 358: { + LogStep(358, "Write attribute NULLABLE_OCTET_STRING"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 359: { + LogStep(359, "Read attribute NULLABLE_OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 360: { + LogStep(360, "Write attribute NULLABLE_OCTET_STRING"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 361: { + LogStep(361, "Read attribute NULLABLE_OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 362: { + LogStep(362, "Read attribute NULLABLE_OCTET_STRING not TestValue"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 363: { + LogStep(363, "Read attribute NULLABLE_CHAR_STRING Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 364: { + LogStep(364, "Write attribute NULLABLE_CHAR_STRING"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = chip::Span("☉T☉garbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 365: { + LogStep(365, "Read attribute NULLABLE_CHAR_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 366: { + LogStep(366, "Read attribute NULLABLE_CHAR_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 367: { + LogStep(367, "Write attribute NULLABLE_CHAR_STRING - Value too long"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 368: { + LogStep(368, "Read attribute NULLABLE_CHAR_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 369: { + LogStep(369, "Write attribute NULLABLE_CHAR_STRING - Empty"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 370: { + LogStep(370, "Read attribute NULLABLE_CHAR_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 371: { + LogStep(371, "Read attribute NULLABLE_CHAR_STRING not ☉T☉"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 372: { + LogStep(372, "Read attribute from nonexistent endpoint."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(200), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, true, + chip::NullOptional); + } + case 373: { + LogStep(373, "Read attribute from nonexistent cluster."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, true, + chip::NullOptional); + } + case 374: { + LogStep(374, "Send a command that takes an optional parameter but do not set it."); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 375: { + LogStep(375, "Send a command that takes an optional parameter but do not set it."); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Type value; + value.arg1.Emplace(); + value.arg1.Value() = 1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Id, value, chip::NullOptional + + ); + } + case 376: { + LogStep(376, "Subscribe to list attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, 2, 5, + true, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 377: { + LogStep(377, "Write subscribed-to list attribute"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 5U; + listHolder_0->mList[1] = 6U; + listHolder_0->mList[2] = 7U; + listHolder_0->mList[3] = 8U; + value = chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 378: { + LogStep(378, "Check for list attribute report"); + return WaitForReport(); + } + case 379: { + LogStep(379, "Read range-restricted unsigned 8-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8u::Id, + true, chip::NullOptional); + } + case 380: { + LogStep(380, "Write min value to a range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8u::Id, value, chip::NullOptional, chip::NullOptional); + } + case 381: { + LogStep(381, "Write just-below-range value to a range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + uint8_t value; + value = 19U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8u::Id, value, chip::NullOptional, chip::NullOptional); + } + case 382: { + LogStep(382, "Write just-above-range value to a range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + uint8_t value; + value = 101U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8u::Id, value, chip::NullOptional, chip::NullOptional); + } + case 383: { + LogStep(383, "Write max value to a range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + uint8_t value; + value = 255U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8u::Id, value, chip::NullOptional, chip::NullOptional); + } + case 384: { + LogStep(384, "Verify range-restricted unsigned 8-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8u::Id, + true, chip::NullOptional); + } + case 385: { + LogStep(385, "Write min valid value to a range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + uint8_t value; + value = 20U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8u::Id, value, chip::NullOptional, chip::NullOptional); + } + case 386: { + LogStep(386, "Verify range-restricted unsigned 8-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8u::Id, + true, chip::NullOptional); + } + case 387: { + LogStep(387, "Write max valid value to a range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + uint8_t value; + value = 100U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8u::Id, value, chip::NullOptional, chip::NullOptional); + } + case 388: { + LogStep(388, "Verify range-restricted unsigned 8-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8u::Id, + true, chip::NullOptional); + } + case 389: { + LogStep(389, "Write middle valid value to a range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + uint8_t value; + value = 50U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8u::Id, value, chip::NullOptional, chip::NullOptional); + } + case 390: { + LogStep(390, "Verify range-restricted unsigned 8-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8u::Id, + true, chip::NullOptional); + } + case 391: { + LogStep(391, "Read range-restricted unsigned 16-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 392: { + LogStep(392, "Write min value to a range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 393: { + LogStep(393, "Write just-below-range value to a range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + uint16_t value; + value = 99U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 394: { + LogStep(394, "Write just-above-range value to a range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + uint16_t value; + value = 1001U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 395: { + LogStep(395, "Write max value to a range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + uint16_t value; + value = 65535U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 396: { + LogStep(396, "Verify range-restricted unsigned 16-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 397: { + LogStep(397, "Write min valid value to a range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + uint16_t value; + value = 100U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 398: { + LogStep(398, "Verify range-restricted unsigned 16-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 399: { + LogStep(399, "Write max valid value to a range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + uint16_t value; + value = 1000U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 400: { + LogStep(400, "Verify range-restricted unsigned 16-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 401: { + LogStep(401, "Write middle valid value to a range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + uint16_t value; + value = 500U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 402: { + LogStep(402, "Verify range-restricted unsigned 16-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 403: { + LogStep(403, "Read range-restricted signed 8-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8s::Id, + true, chip::NullOptional); + } + case 404: { + LogStep(404, "Write min value to a range-restricted signed 8-bit integer"); + ListFreer listFreer; + int8_t value; + value = -128; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8s::Id, value, chip::NullOptional, chip::NullOptional); + } + case 405: { + LogStep(405, "Write just-below-range value to a range-restricted signed 8-bit integer"); + ListFreer listFreer; + int8_t value; + value = -41; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8s::Id, value, chip::NullOptional, chip::NullOptional); + } + case 406: { + LogStep(406, "Write just-above-range value to a range-restricted signed 8-bit integer"); + ListFreer listFreer; + int8_t value; + value = 51; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8s::Id, value, chip::NullOptional, chip::NullOptional); + } + case 407: { + LogStep(407, "Write max value to a range-restricted signed 8-bit integer"); + ListFreer listFreer; + int8_t value; + value = 127; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8s::Id, value, chip::NullOptional, chip::NullOptional); + } + case 408: { + LogStep(408, "Verify range-restricted signed 8-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8s::Id, + true, chip::NullOptional); + } + case 409: { + LogStep(409, "Write min valid value to a range-restricted signed 8-bit integer"); + ListFreer listFreer; + int8_t value; + value = -40; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8s::Id, value, chip::NullOptional, chip::NullOptional); + } + case 410: { + LogStep(410, "Verify range-restricted signed 8-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8s::Id, + true, chip::NullOptional); + } + case 411: { + LogStep(411, "Write max valid value to a range-restricted signed 8-bit integer"); + ListFreer listFreer; + int8_t value; + value = 50; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8s::Id, value, chip::NullOptional, chip::NullOptional); + } + case 412: { + LogStep(412, "Verify range-restricted signed 8-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8s::Id, + true, chip::NullOptional); + } + case 413: { + LogStep(413, "Write middle valid value to a range-restricted signed 8-bit integer"); + ListFreer listFreer; + int8_t value; + value = 6; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt8s::Id, value, chip::NullOptional, chip::NullOptional); + } + case 414: { + LogStep(414, "Verify range-restricted signed 8-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::RangeRestrictedInt8s::Id, + true, chip::NullOptional); + } + case 415: { + LogStep(415, "Read range-restricted signed 16-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 416: { + LogStep(416, "Write min value to a range-restricted signed 16-bit integer"); + ListFreer listFreer; + int16_t value; + value = -32768; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 417: { + LogStep(417, "Write just-below-range value to a range-restricted signed 16-bit integer"); + ListFreer listFreer; + int16_t value; + value = -151; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 418: { + LogStep(418, "Write just-above-range value to a range-restricted signed 16-bit integer"); + ListFreer listFreer; + int16_t value; + value = 201; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 419: { + LogStep(419, "Write max value to a range-restricted signed 16-bit integer"); + ListFreer listFreer; + int16_t value; + value = 32767; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 420: { + LogStep(420, "Verify range-restricted signed 16-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 421: { + LogStep(421, "Write min valid value to a range-restricted signed 16-bit integer"); + ListFreer listFreer; + int16_t value; + value = -150; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 422: { + LogStep(422, "Verify range-restricted signed 16-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 423: { + LogStep(423, "Write max valid value to a range-restricted signed 16-bit integer"); + ListFreer listFreer; + int16_t value; + value = 200; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 424: { + LogStep(424, "Verify range-restricted signed 16-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 425: { + LogStep(425, "Write middle valid value to a range-restricted signed 16-bit integer"); + ListFreer listFreer; + int16_t value; + value = 7; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 426: { + LogStep(426, "Verify range-restricted signed 16-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::RangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 427: { + LogStep(427, "Read nullable range-restricted unsigned 8-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, true, chip::NullOptional); + } + case 428: { + LogStep(428, "Write min value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 429: { + LogStep(429, "Write just-below-range value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 19U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 430: { + LogStep(430, "Write just-above-range value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 101U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 431: { + LogStep(431, "Write max value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 254U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 432: { + LogStep(432, "Verify nullable range-restricted unsigned 8-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, true, chip::NullOptional); + } + case 433: { + LogStep(433, "Write min valid value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 20U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 434: { + LogStep(434, "Verify nullable range-restricted unsigned 8-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, true, chip::NullOptional); + } + case 435: { + LogStep(435, "Write max valid value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 100U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 436: { + LogStep(436, "Verify nullable range-restricted unsigned 8-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, true, chip::NullOptional); + } + case 437: { + LogStep(437, "Write middle valid value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 50U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 438: { + LogStep(438, "Verify nullable range-restricted unsigned 8-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, true, chip::NullOptional); + } + case 439: { + LogStep(439, "Write null value to a nullable range-restricted unsigned 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 440: { + LogStep(440, "Verify nullable range-restricted unsigned 8-bit integer value is null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id, true, chip::NullOptional); + } + case 441: { + LogStep(441, "Read nullable range-restricted unsigned 16-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 442: { + LogStep(442, "Write min value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 443: { + LogStep(443, "Write just-below-range value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 99U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 444: { + LogStep(444, "Write just-above-range value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 1001U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 445: { + LogStep(445, "Write max value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 65534U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 446: { + LogStep(446, "Verify nullable range-restricted unsigned 16-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 447: { + LogStep(447, "Write min valid value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 100U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 448: { + LogStep(448, "Verify nullable range-restricted unsigned 16-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 449: { + LogStep(449, "Write max valid value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 1000U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 450: { + LogStep(450, "Verify nullable range-restricted unsigned 16-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 451: { + LogStep(451, "Write middle valid value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 500U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 452: { + LogStep(452, "Verify nullable range-restricted unsigned 16-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 453: { + LogStep(453, "Write null value to a nullable range-restricted unsigned 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 454: { + LogStep(454, "Verify nullable range-restricted unsigned 16-bit integer value is null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id, true, chip::NullOptional); + } + case 455: { + LogStep(455, "Read nullable range-restricted signed 8-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, true, chip::NullOptional); + } + case 456: { + LogStep(456, "Write min value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -127; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 457: { + LogStep(457, "Write just-below-range value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -41; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 458: { + LogStep(458, "Write just-above-range value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 51; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 459: { + LogStep(459, "Write max value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 127; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 460: { + LogStep(460, "Verify nullable range-restricted signed 8-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, true, chip::NullOptional); + } + case 461: { + LogStep(461, "Write min valid value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -40; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 462: { + LogStep(462, "Verify nullable range-restricted signed 8-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, true, chip::NullOptional); + } + case 463: { + LogStep(463, "Write max valid value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 50; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 464: { + LogStep(464, "Verify nullable range-restricted signed 8-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, true, chip::NullOptional); + } + case 465: { + LogStep(465, "Write middle valid value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 6; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 466: { + LogStep(466, "Verify nullable range-restricted signed 8-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, true, chip::NullOptional); + } + case 467: { + LogStep(467, "Write null value to a nullable range-restricted signed 8-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 468: { + LogStep(468, "Verify nullable range-restricted signed 8-bit integer value is at null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id, true, chip::NullOptional); + } + case 469: { + LogStep(469, "Read nullable range-restricted signed 16-bit integer"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 470: { + LogStep(470, "Write min value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -32767; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 471: { + LogStep(471, "Write just-below-range value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -151; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 472: { + LogStep(472, "Write just-above-range value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 201; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 473: { + LogStep(473, "Write max value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 32767; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 474: { + LogStep(474, "Verify nullable range-restricted signed 16-bit integer value has not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 475: { + LogStep(475, "Write min valid value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = -150; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 476: { + LogStep(476, "Verify nullable range-restricted signed 16-bit integer value is at min valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 477: { + LogStep(477, "Write max valid value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 200; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 478: { + LogStep(478, "Verify nullable range-restricted signed 16-bit integer value is at max valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 479: { + LogStep(479, "Write middle valid value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 7; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 480: { + LogStep(480, "Verify nullable range-restricted signed 16-bit integer value is at mid valid"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 481: { + LogStep(481, "Write null value to a nullable range-restricted signed 16-bit integer"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 482: { + LogStep(482, "Verify nullable range-restricted signed 16-bit integer value is null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id, true, chip::NullOptional); + } + case 483: { + LogStep(483, "Write attribute that returns general status on write"); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::GeneralErrorBoolean::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 484: { + LogStep(484, "Write attribute that returns cluster-specific status on write"); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ClusterErrorBoolean::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 485: { + LogStep(485, "Read attribute that returns general status on read"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::GeneralErrorBoolean::Id, + true, chip::NullOptional); + } + case 486: { + LogStep(486, "read attribute that returns cluster-specific status on read"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ClusterErrorBoolean::Id, + true, chip::NullOptional); + } + case 487: { + LogStep(487, "read AcceptedCommandList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 488: { + LogStep(488, "read GeneratedCommandList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 489: { + LogStep(489, "Write struct-typed attribute"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type value; + + value.a = 5U; + value.b = true; + value.c = static_cast(2); + value.d = chip::ByteSpan(chip::Uint8::from_const_char("abcgarbage: not in length on purpose"), 3); + value.e = chip::Span("garbage: not in length on purpose", 0); + value.f = static_cast>(17U); + value.g = 1.5f; + value.h = 3.14159265358979; + + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::StructAttr::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 490: { + LogStep(490, "Read struct-typed attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::StructAttr::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestClusterComplexTypesSuite : public TestCommand +{ +public: + TestClusterComplexTypesSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestClusterComplexTypes", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestClusterComplexTypesSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("wasPresent", value.wasPresent, true)); + VerifyOrReturn(CheckValuePresent("wasNull", value.wasNull)); + VerifyOrReturn(CheckValue("wasNull.Value()", value.wasNull.Value(), true)); + VerifyOrReturn(CheckValuePresent("originalValue", value.originalValue)); + VerifyOrReturn(CheckValueNull("originalValue.Value()", value.originalValue.Value())); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("timedWriteBoolean", value, false)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("timedWriteBoolean", value, false)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("timedWriteBoolean", value, false)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("timedWriteBoolean", value, true)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, false)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, false)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, true)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Send Test Command with optional arg set to null."); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalRequest::Type value; + value.arg1.Emplace(); + value.arg1.Value().SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TestNullableOptionalRequest::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Send command that needs timed invoke without a timeout value"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TimedInvokeRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TimedInvokeRequest::Id, + value, chip::NullOptional, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Send command that needs timed invoke with a long timeout value"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TimedInvokeRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TimedInvokeRequest::Id, + value, chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Send command that needs timed invoke with a too-short timeout value"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TimedInvokeRequest::Type value; + ReturnErrorOnFailure(SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Commands::TimedInvokeRequest::Id, value, chip::Optional(1), + chip::NullOptional + + )); + + using namespace chip::System::Clock::Literals; + return BusyWaitFor(100_ms); + } + case 5: { + LogStep(5, "Send command that does not need timed invoke with a long timeout value"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::Test::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::Test::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Send command that does not need timed invoke with a too-short timeout value"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::Test::Type value; + ReturnErrorOnFailure(SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::Test::Id, + value, chip::Optional(1), chip::NullOptional + + )); + + using namespace chip::System::Clock::Literals; + return BusyWaitFor(100_ms); + } + case 7: { + LogStep(7, "Read attribute that needs timed write initial state"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::TimedWriteBoolean::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Write attribute that needs timed write without a timeout value"); + ListFreer listFreer; + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::TimedWriteBoolean::Id, + value, chip::NullOptional, chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Read attribute that needs timed write state unchanged 1"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::TimedWriteBoolean::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Write attribute that needs timed write with a too-short timeout value"); + ListFreer listFreer; + bool value; + value = true; + ReturnErrorOnFailure(WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::TimedWriteBoolean::Id, value, chip::Optional(1), + chip::NullOptional, chip::NullOptional)); + + using namespace chip::System::Clock::Literals; + return BusyWaitFor(100_ms); + } + case 11: { + LogStep(11, "Read attribute that needs timed write state unchanged 2"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::TimedWriteBoolean::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Write attribute that needs timed write with a long timeout value"); + ListFreer listFreer; + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::TimedWriteBoolean::Id, + value, chip::Optional(10000), chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Read attribute that needs timed write state changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::TimedWriteBoolean::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Write attribute that needs timed write reset to default"); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::TimedWriteBoolean::Id, + value, chip::Optional(10000), chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, "Read attribute that does not need timed write initial value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Write attribute that does not need timed write with a too-short timeout value"); + ListFreer listFreer; + bool value; + value = true; + ReturnErrorOnFailure(WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, + UnitTesting::Attributes::Boolean::Id, value, chip::Optional(1), + chip::NullOptional, chip::NullOptional)); + + using namespace chip::System::Clock::Literals; + return BusyWaitFor(100_ms); + } + case 17: { + LogStep(17, "Read attribute that does not need timed write unchanged value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Write attribute that does not need timed write with a long timeout value"); + ListFreer listFreer; + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, value, + chip::Optional(10000), chip::NullOptional, chip::NullOptional); + } + case 19: { + LogStep(19, "Read attribute that does not need timed write changed value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Write attribute that does not need timed write reset to default"); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestConstraintsSuite : public TestCommand +{ +public: + TestConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestConstraints", 61, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestConstraintsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintContains("value", value, 2U)); + VerifyOrReturn(CheckConstraintContains("value", value, 3U)); + VerifyOrReturn(CheckConstraintContains("value", value, 4U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0U)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 0UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 5UL)); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 5UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 5UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 5UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 1UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 5UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, 6UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 5)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 20)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintStartsWith("value", value, "**")); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintEndsWith("value", value, "**")); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsHexString("value", value, false)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsHexString("value", value, true)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 5)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 20)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 0U)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Write attribute LIST With List of INT8U"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 1U; + listHolder_0->mList[1] = 2U; + listHolder_0->mList[2] = 3U; + listHolder_0->mList[3] = 4U; + value = chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute LIST With Partial List of INT8U that should be in it"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute LIST With Partial List of INT8U that should not be included"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Write attribute LIST Back to Default Value"); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::ListInt8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Read attribute BITMAP32 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Write attribute BITMAP32 with MaskVal1 and MaskVal3"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(5UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Read attribute BITMAP32 with MaskVal1 and MaskVal3 and ensure MaskVal2 is not set"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Read attribute BITMAP32 with MaskVal1 and MaskVal3 and ensure MaskVal1 is set"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Read attribute BITMAP32 with MaskVal1 and MaskVal3 and ensure MaskVal3 is set"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Read attribute BITMAP32 with MaskVal1 and MaskVal3 and ensure Maskval1 and MaskVal3 are set"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Write attribute BITMAP32 with MaskVal1"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(1UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 are set"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Write attribute BITMAP32 Back to Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "Write attribute INT32U Value"); + ListFreer listFreer; + uint32_t value; + value = 5UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, "Read attribute INT32U Value MinValue Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Read attribute INT32U Value MaxValue Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Read attribute INT32U Value NotValue Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Write attribute INT32U Value Back to Default Value"); + ListFreer listFreer; + uint32_t value; + value = 0UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 19: { + LogStep(19, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("** Test **garbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 20: { + LogStep(20, "Read attribute CHAR_STRING Value MinLength Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Read attribute CHAR_STRING Value MaxLength Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Read attribute CHAR_STRING Value StartsWith Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Read attribute CHAR_STRING Value EndsWith Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("lowercasegarbage: not in length on purpose", 9); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 25: { + LogStep(25, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("UPPERCASEgarbage: not in length on purpose", 9); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 27: { + LogStep(27, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("lowUPPERgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 29: { + LogStep(29, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Write attribute CHAR_STRING Value with only digits"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("1234567890garbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 31: { + LogStep(31, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Write attribute CHAR_STRING Value with only non-letters"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("12.4,76:garbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 33: { + LogStep(33, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "Write attribute CHAR_STRING Value with uppercase letters and symbols"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("ABC;.* garbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 35: { + LogStep(35, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "Write attribute CHAR_STRING Value with lowercase letters and symbols"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("abc;.* garbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 37: { + LogStep(37, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Write attribute CHAR_STRING Value which is empty"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 39: { + LogStep(39, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 40: { + LogStep(40, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("ABCDEF012Vgarbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 41: { + LogStep(41, "Read attribute CHAR_STRING Value isHexString Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("ABCDEF0123garbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, "Read attribute CHAR_STRING Value isHexString Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Write attribute CHAR_STRING Value Back to Default Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 45: { + LogStep(45, "Write attribute NULLABLE_CHAR_STRING Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 46: { + LogStep(46, "Read attribute NULLABLE_CHAR_STRING Value MinLength Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 47: { + LogStep(47, "Read attribute NULLABLE_CHAR_STRING Value MaxLength Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + true, chip::NullOptional); + } + case 48: { + LogStep(48, "Write attribute NULLABLE_CHAR_STRING Value Back to Default Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableCharString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 49: { + LogStep(49, "Read attribute NULLABLE_INT8U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 50: { + LogStep(50, "Write attribute NULLABLE_INT8U with a value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 51: { + LogStep(51, "Read attribute NULLABLE_INT8U with a value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Write attribute NULLABLE_INT8U without a value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 53: { + LogStep(53, "Read attribute NULLABLE_INT8U with a value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 54: { + LogStep(54, "Write attribute NULLABLE_INT8U back to Default Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 55: { + LogStep(55, "Read attribute NULLABLE_OCTET_STRING Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 56: { + LogStep(56, "Write attribute NULLABLE_OCTET_STRING"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 57: { + LogStep(57, "Read attribute NULLABLE_OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 58: { + LogStep(58, "Write attribute NULLABLE_OCTET_STRING"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 59: { + LogStep(59, "Read attribute NULLABLE_OCTET_STRING"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + true, chip::NullOptional); + } + case 60: { + LogStep(60, "Write attribute NULLABLE_OCTET_STRING back to Default Value"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, + value, chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestDelayCommandsSuite : public TestCommand +{ +public: + TestDelayCommandsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestDelayCommands", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestDelayCommandsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestEventsSuite : public TestCommand +{ +public: + TestEventsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestEvents", 12, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestEventsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint64_t eventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + switch (mTestSubStepIndex) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 2: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + eventNumber = value.value; + } + break; + case 4: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 1U)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 2U)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 5: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 1U)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 2U)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 6: + switch (mTestSubStepIndex) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, static_cast(eventNumber + 1))); + } + break; + case 8: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 1U)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 2U)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 3U)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 1U)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, false)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 9: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 1U)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 2U)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 3U)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 1U)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, false)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, static_cast(eventNumber + 2))); + } + break; + case 11: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 4U)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 3U)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + shouldContinue = true; + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Check there is no event on the target endpoint"); + mTestSubStepCount = 0; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, false, + chip::NullOptional); + } + case 2: { + LogStep(2, "Check reading events from an invalid endpoint"); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(0), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, false, + chip::NullOptional); + } + case 3: { + LogStep(3, "Generate an event on the accessory"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventRequest::Type value; + value.arg1 = 1U; + value.arg2 = static_cast(2); + value.arg3 = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestEmitTestEventRequest::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Read the event back"); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, false, + chip::NullOptional); + } + case 5: { + LogStep(5, "Read the event with eventNumber set to the event value"); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, false, + chip::Optional(eventNumber)); + } + case 6: { + LogStep(6, "Read the event with eventNumber set to the event value + 1"); + mTestSubStepCount = 0; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, false, + chip::Optional(eventNumber + 1)); + } + case 7: { + LogStep(7, "Generate a second event on the accessory"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventRequest::Type value; + value.arg1 = 3U; + value.arg2 = static_cast(1); + value.arg3 = false; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestEmitTestEventRequest::Id, + value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Read the event back"); + mTestSubStepCount = 2; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, false, + chip::NullOptional); + } + case 9: { + LogStep(9, "Subscribe to the event"); + mTestSubStepCount = 2; + return SubscribeEvent(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, 3, 5, false, + chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 10: { + LogStep(10, "Generate a third event on the accessory"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventRequest::Type value; + value.arg1 = 4U; + value.arg2 = static_cast(3); + value.arg3 = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestEmitTestEventRequest::Id, + value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Check for event report"); + mTestSubStepCount = 1; + return WaitForReport(); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestDiscoverySuite : public TestCommand +{ +public: + TestDiscoverySuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestDiscovery", 30, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("shortDiscriminator", 0, UINT16_MAX, &mShortDiscriminator); + AddArgument("vendorId", 0, UINT16_MAX, &mVendorId); + AddArgument("productId", 0, UINT16_MAX, &mProductId); + AddArgument("deviceType", 0, UINT16_MAX, &mDeviceType); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestDiscoverySuite() + { + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + deviceInstanceNameBeforeRebootBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mShortDiscriminator; + chip::Optional mVendorId; + chip::Optional mProductId; + chip::Optional mDeviceType; + chip::Optional mTimeout; + + char * deviceInstanceNameBeforeRebootBuffer = nullptr; + chip::CharSpan deviceInstanceNameBeforeReboot; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + } + deviceInstanceNameBeforeRebootBuffer = static_cast(chip::Platform::MemoryAlloc(value.instanceName.size())); + memcpy(deviceInstanceNameBeforeRebootBuffer, value.instanceName.data(), value.instanceName.size()); + deviceInstanceNameBeforeReboot = chip::CharSpan(deviceInstanceNameBeforeRebootBuffer, value.instanceName.size()); + } + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn( + CheckConstraintMinValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn( + CheckConstraintMinValue("value.mrpRetryIntervalActive.Value()", value.mrpRetryIntervalActive.Value(), 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1U)); + } + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U)); + } + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintNotValue("value.instanceName", value.instanceName, deviceInstanceNameBeforeReboot)); + } + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Stop target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Start target device with the provided discriminator for basic commissioning advertisement"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.discriminator.Emplace(); + value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + return Start(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Open Commissioning Window with too-short timeout"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 120U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Open Commissioning Window with too-long timeout"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 1000U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Open Commissioning Window"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Check Instance Name"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Check Hostname"); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Check Hostname"); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Check Long Discriminator _L"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Check Short Discriminator (_S)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Check Commissioning Mode (_CM)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Check Vendor ID (_V)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Check Device Type ID (_T)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "TXT key for discriminator (D)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "TXT key for Vendor ID and Product ID (VP)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Optional TXT key for MRP Sleepy Idle Interval (SII)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_COMM_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Optional TXT key for MRP Sleepy Active Interval (SAI)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_COMM_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "TXT key for commissioning mode (CM)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Optional TXT key for device type (DT)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Optional TXT key for device name (DN)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Optional TXT key for rotating device identifier (RI)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 22: { + LogStep(22, "Optional TXT key for pairing hint (PH)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Optional TXT key for pairing instructions (PI)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Check IPs"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Stop target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Start target device with the provided discriminator for basic commissioning advertisement"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.discriminator.Emplace(); + value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + return Start(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "Open Commissioning Window"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Check Instance Name"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestLogCommandsSuite : public TestCommand +{ +public: + TestLogCommandsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestLogCommands", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestLogCommandsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Log a simple message"); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::Log::Type value; + value.message = chip::Span("This is a simple messagegarbage: not in length on purpose", 24); + return Log(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Do a simple user prompt message"); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("This is a simple messagegarbage: not in length on purpose", 24); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestSaveAsSuite : public TestCommand +{ +public: + TestSaveAsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestSaveAs", 110, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestSaveAsSuite() + { + if (readAttributeCharStringDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeCharStringDefaultValueBuffer); + readAttributeCharStringDefaultValueBuffer = nullptr; + } + if (readAttributeCharStringNotDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeCharStringNotDefaultValueBuffer); + readAttributeCharStringNotDefaultValueBuffer = nullptr; + } + if (readAttributeOctetStringDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeOctetStringDefaultValueBuffer); + readAttributeOctetStringDefaultValueBuffer = nullptr; + } + if (readAttributeOctetStringNotDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeOctetStringNotDefaultValueBuffer); + readAttributeOctetStringNotDefaultValueBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t TestAddArgumentDefaultValue; + bool readAttributeBooleanDefaultValue; + chip::BitMask readAttributeBitmap8DefaultValue; + chip::BitMask readAttributeBitmap16DefaultValue; + chip::BitMask readAttributeBitmap32DefaultValue; + chip::BitMask readAttributeBitmap64DefaultValue; + uint8_t readAttributeInt8uDefaultValue; + uint16_t readAttributeInt16uDefaultValue; + uint32_t readAttributeInt32uDefaultValue; + uint64_t readAttributeInt64uDefaultValue; + int8_t readAttributeInt8sDefaultValue; + int16_t readAttributeInt16sDefaultValue; + int32_t readAttributeInt32sDefaultValue; + int64_t readAttributeInt64sDefaultValue; + uint8_t readAttributeEnum8DefaultValue; + uint16_t readAttributeEnum16DefaultValue; + uint64_t readAttributeEpochUSDefaultValue; + uint32_t readAttributeEpochSDefaultValue; + chip::VendorId readAttributeVendorIdDefaultValue; + char * readAttributeCharStringDefaultValueBuffer = nullptr; + chip::CharSpan readAttributeCharStringDefaultValue; + char * readAttributeCharStringNotDefaultValueBuffer = nullptr; + chip::CharSpan readAttributeCharStringNotDefaultValue; + uint8_t * readAttributeOctetStringDefaultValueBuffer = nullptr; + chip::ByteSpan readAttributeOctetStringDefaultValue; + uint8_t * readAttributeOctetStringNotDefaultValueBuffer = nullptr; + chip::ByteSpan readAttributeOctetStringNotDefaultValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("returnValue", value.returnValue, 20U)); + TestAddArgumentDefaultValue = value.returnValue; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("returnValue", value.returnValue, TestAddArgumentDefaultValue)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.returnValue", value.returnValue, TestAddArgumentDefaultValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, 0)); + readAttributeBooleanDefaultValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBooleanDefaultValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("boolean", value, readAttributeBooleanDefaultValue)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap8", value, 0U)); + readAttributeBitmap8DefaultValue = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap8DefaultValue)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap8", value, readAttributeBitmap8DefaultValue)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap16", value, 0U)); + readAttributeBitmap16DefaultValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap16DefaultValue)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap16", value, readAttributeBitmap16DefaultValue)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 0UL)); + readAttributeBitmap32DefaultValue = value; + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap32DefaultValue)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, readAttributeBitmap32DefaultValue)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap64", value, 0ULL)); + readAttributeBitmap64DefaultValue = value; + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap64DefaultValue)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap64", value, readAttributeBitmap64DefaultValue)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8u", value, 0U)); + readAttributeInt8uDefaultValue = value; + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt8uDefaultValue)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8u", value, readAttributeInt8uDefaultValue)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16u", value, 0U)); + readAttributeInt16uDefaultValue = value; + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt16uDefaultValue)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16u", value, readAttributeInt16uDefaultValue)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32u", value, 0UL)); + readAttributeInt32uDefaultValue = value; + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt32uDefaultValue)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32u", value, readAttributeInt32uDefaultValue)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64u", value, 0ULL)); + readAttributeInt64uDefaultValue = value; + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt64uDefaultValue)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64u", value, readAttributeInt64uDefaultValue)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8s", value, 0)); + readAttributeInt8sDefaultValue = value; + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt8sDefaultValue)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int8s", value, readAttributeInt8sDefaultValue)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16s", value, 0)); + readAttributeInt16sDefaultValue = value; + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt16sDefaultValue)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int16s", value, readAttributeInt16sDefaultValue)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32s", value, 0L)); + readAttributeInt32sDefaultValue = value; + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt32sDefaultValue)); + } + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int32s", value, readAttributeInt32sDefaultValue)); + } + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64s", value, 0LL)); + readAttributeInt64sDefaultValue = value; + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeInt64sDefaultValue)); + } + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("int64s", value, readAttributeInt64sDefaultValue)); + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum8", value, 0U)); + readAttributeEnum8DefaultValue = value; + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeEnum8DefaultValue)); + } + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum8", value, readAttributeEnum8DefaultValue)); + } + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum16", value, 0U)); + readAttributeEnum16DefaultValue = value; + } + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeEnum16DefaultValue)); + } + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enum16", value, readAttributeEnum16DefaultValue)); + } + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochUs", value, 0ULL)); + readAttributeEpochUSDefaultValue = value; + } + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeEpochUSDefaultValue)); + } + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochUs", value, readAttributeEpochUSDefaultValue)); + } + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochS", value, 0UL)); + readAttributeEpochSDefaultValue = value; + } + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeEpochSDefaultValue)); + } + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("epochS", value, readAttributeEpochSDefaultValue)); + } + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value, 0U)); + readAttributeVendorIdDefaultValue = value; + } + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeVendorIdDefaultValue)); + } + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value, readAttributeVendorIdDefaultValue)); + } + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, chip::CharSpan("", 0))); + if (readAttributeCharStringDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeCharStringDefaultValueBuffer); + } + readAttributeCharStringDefaultValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(readAttributeCharStringDefaultValueBuffer, value.data(), value.size()); + readAttributeCharStringDefaultValue = chip::CharSpan(readAttributeCharStringDefaultValueBuffer, value.size()); + } + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, readAttributeCharStringDefaultValue)); + } + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, chip::CharSpan("NotDefault", 10))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeCharStringDefaultValue)); + if (readAttributeCharStringNotDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeCharStringNotDefaultValueBuffer); + } + readAttributeCharStringNotDefaultValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(readAttributeCharStringNotDefaultValueBuffer, value.data(), value.size()); + readAttributeCharStringNotDefaultValue = chip::CharSpan(readAttributeCharStringNotDefaultValueBuffer, value.size()); + } + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, readAttributeCharStringNotDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeCharStringDefaultValue)); + } + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("charString", value, chip::CharSpan("NotDefault", 10))); + } + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 102: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("octetString", value, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + if (readAttributeOctetStringDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeOctetStringDefaultValueBuffer); + } + readAttributeOctetStringDefaultValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(readAttributeOctetStringDefaultValueBuffer, value.data(), value.size()); + readAttributeOctetStringDefaultValue = chip::ByteSpan(readAttributeOctetStringDefaultValueBuffer, value.size()); + } + break; + case 103: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("octetString", value, readAttributeOctetStringDefaultValue)); + } + break; + case 104: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 105: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValueAsString("octetString", value, chip::ByteSpan(chip::Uint8::from_const_char("NotDefault"), 10))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeOctetStringDefaultValue)); + if (readAttributeOctetStringNotDefaultValueBuffer != nullptr) + { + chip::Platform::MemoryFree(readAttributeOctetStringNotDefaultValueBuffer); + } + readAttributeOctetStringNotDefaultValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(readAttributeOctetStringNotDefaultValueBuffer, value.data(), value.size()); + readAttributeOctetStringNotDefaultValue = + chip::ByteSpan(readAttributeOctetStringNotDefaultValueBuffer, value.size()); + } + break; + case 106: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("octetString", value, readAttributeOctetStringNotDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeOctetStringDefaultValue)); + } + break; + case 107: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 108: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::ByteSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValueAsString("octetString", value, chip::ByteSpan(chip::Uint8::from_const_char("NotDefault"), 10))); + } + break; + case 109: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Send Test Add Arguments Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Type value; + value.arg1 = 3U; + value.arg2 = 17U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestAddArguments::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Send Test Add Arguments Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Type value; + value.arg1 = 3U; + value.arg2 = 17U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestAddArguments::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Send Test Add Arguments Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Type value; + value.arg1 = 3U; + value.arg2 = TestAddArgumentDefaultValue; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestAddArguments::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Read attribute BOOLEAN Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Write attribute BOOLEAN Not Default Value"); + ListFreer listFreer; + bool value; + value = 1; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Read attribute BOOLEAN Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Write attribute BOOLEAN DefaultValue"); + ListFreer listFreer; + bool value; + value = readAttributeBooleanDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Read attribute BOOLEAN False"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Boolean::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Read attribute BITMAP8 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Write attribute BITMAP8 Not Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(1U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, "Read attribute BITMAP8 Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Write attribute BITMAP8 Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = readAttributeBitmap8DefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Read attribute BITMAP8 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap8::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Read attribute BITMAP16 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Write attribute BITMAP16 Not Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(1U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "Read attribute BITMAP16 Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Write attribute BITMAP16 Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = readAttributeBitmap16DefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Read attribute BITMAP16 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap16::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Read attribute BITMAP32 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Write attribute BITMAP32 Not Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(1UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 21: { + LogStep(21, "Read attribute BITMAP32 Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Write attribute BITMAP32 Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = readAttributeBitmap32DefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 23: { + LogStep(23, "Read attribute BITMAP32 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Read attribute BITMAP64 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Write attribute BITMAP64 Not Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(1ULL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 26: { + LogStep(26, "Read attribute BITMAP64 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Write attribute BITMAP64 Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = readAttributeBitmap64DefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 28: { + LogStep(28, "Read attribute BITMAP64 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap64::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "Read attribute INT8U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Write attribute INT8U Not Default Value"); + ListFreer listFreer; + uint8_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 31: { + LogStep(31, "Read attribute INT8U Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Write attribute INT8U Default Value"); + ListFreer listFreer; + uint8_t value; + value = readAttributeInt8uDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 33: { + LogStep(33, "Read attribute INT8U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8u::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "Read attribute INT16U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Write attribute INT16U Not Default Value"); + ListFreer listFreer; + uint16_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 36: { + LogStep(36, "Read attribute INT16U Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, true, + chip::NullOptional); + } + case 37: { + LogStep(37, "Write attribute INT16U Default Value"); + ListFreer listFreer; + uint16_t value; + value = readAttributeInt16uDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 38: { + LogStep(38, "Read attribute INT16U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16u::Id, true, + chip::NullOptional); + } + case 39: { + LogStep(39, "Read attribute INT32U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 40: { + LogStep(40, "Write attribute INT32U Not Default Value"); + ListFreer listFreer; + uint32_t value; + value = 1UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 41: { + LogStep(41, "Read attribute INT32U Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "Write attribute INT32U Default Value"); + ListFreer listFreer; + uint32_t value; + value = readAttributeInt32uDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, "Read attribute INT32U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Read attribute INT64U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, true, + chip::NullOptional); + } + case 45: { + LogStep(45, "Write attribute INT64U Not Default Value"); + ListFreer listFreer; + uint64_t value; + value = 1ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 46: { + LogStep(46, "Read attribute INT64U Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "Write attribute INT64U Default Value"); + ListFreer listFreer; + uint64_t value; + value = readAttributeInt64uDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 48: { + LogStep(48, "Read attribute INT64U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64u::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Read attribute INT8S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, true, + chip::NullOptional); + } + case 50: { + LogStep(50, "Write attribute INT8S Not Default Value"); + ListFreer listFreer; + int8_t value; + value = 1; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 51: { + LogStep(51, "Read attribute INT8S Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Write attribute INT8S Default Value"); + ListFreer listFreer; + int8_t value; + value = readAttributeInt8sDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 53: { + LogStep(53, "Read attribute INT8S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int8s::Id, true, + chip::NullOptional); + } + case 54: { + LogStep(54, "Read attribute INT16S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, true, + chip::NullOptional); + } + case 55: { + LogStep(55, "Write attribute INT16S Not Default Value"); + ListFreer listFreer; + int16_t value; + value = 1; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 56: { + LogStep(56, "Read attribute INT16S Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, true, + chip::NullOptional); + } + case 57: { + LogStep(57, "Write attribute INT16S Default Value"); + ListFreer listFreer; + int16_t value; + value = readAttributeInt16sDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 58: { + LogStep(58, "Read attribute INT16S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int16s::Id, true, + chip::NullOptional); + } + case 59: { + LogStep(59, "Read attribute INT32S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, true, + chip::NullOptional); + } + case 60: { + LogStep(60, "Write attribute INT32S Not Default Value"); + ListFreer listFreer; + int32_t value; + value = 1L; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 61: { + LogStep(61, "Read attribute INT32S Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, true, + chip::NullOptional); + } + case 62: { + LogStep(62, "Write attribute INT32S Default Value"); + ListFreer listFreer; + int32_t value; + value = readAttributeInt32sDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 63: { + LogStep(63, "Read attribute INT32S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32s::Id, true, + chip::NullOptional); + } + case 64: { + LogStep(64, "Read attribute INT64S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, true, + chip::NullOptional); + } + case 65: { + LogStep(65, "Write attribute INTS Not Default Value"); + ListFreer listFreer; + int64_t value; + value = 1LL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 66: { + LogStep(66, "Read attribute INT64S Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, true, + chip::NullOptional); + } + case 67: { + LogStep(67, "Write attribute INT64S Default Value"); + ListFreer listFreer; + int64_t value; + value = readAttributeInt64sDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 68: { + LogStep(68, "Read attribute INT64S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int64s::Id, true, + chip::NullOptional); + } + case 69: { + LogStep(69, "Read attribute ENUM8 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, true, + chip::NullOptional); + } + case 70: { + LogStep(70, "Write attribute ENUM8 Not Default Value"); + ListFreer listFreer; + uint8_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 71: { + LogStep(71, "Read attribute ENUM8 Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, true, + chip::NullOptional); + } + case 72: { + LogStep(72, "Write attribute ENUM8 Default Value"); + ListFreer listFreer; + uint8_t value; + value = readAttributeEnum8DefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 73: { + LogStep(73, "Read attribute ENUM8 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum8::Id, true, + chip::NullOptional); + } + case 74: { + LogStep(74, "Read attribute ENUM16 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, true, + chip::NullOptional); + } + case 75: { + LogStep(75, "Write attribute ENUM16 Not Default Value"); + ListFreer listFreer; + uint16_t value; + value = 1U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 76: { + LogStep(76, "Read attribute ENUM16 Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, true, + chip::NullOptional); + } + case 77: { + LogStep(77, "Write attribute ENUM16 Default Value"); + ListFreer listFreer; + uint16_t value; + value = readAttributeEnum16DefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 78: { + LogStep(78, "Read attribute ENUM16 Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Enum16::Id, true, + chip::NullOptional); + } + case 79: { + LogStep(79, "Read attribute EPOCH_US Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, true, + chip::NullOptional); + } + case 80: { + LogStep(80, "Write attribute EPOCH_US Not Default Value"); + ListFreer listFreer; + uint64_t value; + value = 1ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 81: { + LogStep(81, "Read attribute EPOCH_US Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, true, + chip::NullOptional); + } + case 82: { + LogStep(82, "Write attribute EPOCH_US Default Value"); + ListFreer listFreer; + uint64_t value; + value = readAttributeEpochUSDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 83: { + LogStep(83, "Read attribute EPOCH_US Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochUs::Id, true, + chip::NullOptional); + } + case 84: { + LogStep(84, "Read attribute EPOCH_S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, true, + chip::NullOptional); + } + case 85: { + LogStep(85, "Write attribute EPOCH_S Not Default Value"); + ListFreer listFreer; + uint32_t value; + value = 1UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 86: { + LogStep(86, "Read attribute EPOCH_S Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, true, + chip::NullOptional); + } + case 87: { + LogStep(87, "Write attribute EPOCH_S Default Value"); + ListFreer listFreer; + uint32_t value; + value = readAttributeEpochSDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 88: { + LogStep(88, "Read attribute EPOCH_S Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::EpochS::Id, true, + chip::NullOptional); + } + case 89: { + LogStep(89, "Read attribute vendor_id Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, true, + chip::NullOptional); + } + case 90: { + LogStep(90, "Write attribute vendor_id Not Default Value"); + ListFreer listFreer; + chip::VendorId value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 91: { + LogStep(91, "Read attribute vendor_id Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, true, + chip::NullOptional); + } + case 92: { + LogStep(92, "Write attribute vendor_id Default Value"); + ListFreer listFreer; + chip::VendorId value; + value = readAttributeVendorIdDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 93: { + LogStep(93, "Read attribute vendor_id Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::VendorId::Id, true, + chip::NullOptional); + } + case 94: { + LogStep(94, "Read attribute char_string Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 95: { + LogStep(95, "Read attribute char_string Default Value and compare to saved value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 96: { + LogStep(96, "Write attribute char_string Not Default Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("NotDefaultgarbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 97: { + LogStep(97, "Read attribute char_string Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 98: { + LogStep(98, "Read attribute char_string Not Default Value and compare to saved value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 99: { + LogStep(99, "Write attribute char_string Not Default Value from saved value"); + ListFreer listFreer; + chip::CharSpan value; + value = readAttributeCharStringNotDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 100: { + LogStep(100, "Read attribute char_string Not Default Value and compare to expected value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 101: { + LogStep(101, "Write attribute char_string Default Value"); + ListFreer listFreer; + chip::CharSpan value; + value = readAttributeCharStringDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 102: { + LogStep(102, "Read attribute octet_string Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 103: { + LogStep(103, "Read attribute octet_string Default Value and compare to saved value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 104: { + LogStep(104, "Write attribute octet_string Not Default Value"); + ListFreer listFreer; + chip::ByteSpan value; + value = chip::ByteSpan(chip::Uint8::from_const_char("NotDefaultgarbage: not in length on purpose"), 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 105: { + LogStep(105, "Read attribute octet_string Not Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 106: { + LogStep(106, "Read attribute octet_string Not Default Value and compare to saved value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 107: { + LogStep(107, "Write attribute octet_string Not Default Value from saved value"); + ListFreer listFreer; + chip::ByteSpan value; + value = readAttributeOctetStringNotDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 108: { + LogStep(108, "Read attribute octet_string Not Default Value and compare to expected value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, true, + chip::NullOptional); + } + case 109: { + LogStep(109, "Write attribute octet_string Default Value"); + ListFreer listFreer; + chip::ByteSpan value; + value = readAttributeOctetStringDefaultValue; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::OctetString::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestConfigVariablesSuite : public TestCommand +{ +public: + TestConfigVariablesSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestConfigVariables", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("arg1", 0, UINT8_MAX, &mArg1); + AddArgument("returnValueWithArg1", 0, UINT8_MAX, &mReturnValueWithArg1); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestConfigVariablesSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mArg1; + chip::Optional mReturnValueWithArg1; + chip::Optional mTimeout; + + uint8_t TestAddArgumentDefaultValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("returnValue", value.returnValue, 20U)); + TestAddArgumentDefaultValue = value.returnValue; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("returnValue", value.returnValue, + mReturnValueWithArg1.HasValue() ? mReturnValueWithArg1.Value() : 25U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Send Test Add Arguments Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Type value; + value.arg1 = 3U; + value.arg2 = 17U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestAddArguments::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Send Test Add Arguments Command"); + ListFreer listFreer; + chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Type value; + value.arg1 = mArg1.HasValue() ? mArg1.Value() : 5U; + value.arg2 = TestAddArgumentDefaultValue; + return SendCommand(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Commands::TestAddArguments::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestDescriptorClusterSuite : public TestCommand +{ +public: + TestDescriptorClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestDescriptorCluster", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestDescriptorClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("deviceTypeList", iter_0, 0)); + VerifyOrReturn(CheckValue("deviceTypeList[0].deviceType", iter_0.GetValue().deviceType, 17UL)); + VerifyOrReturn(CheckValue("deviceTypeList[0].revision", iter_0.GetValue().revision, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("deviceTypeList", iter_0, 1)); + VerifyOrReturn(CheckValue("deviceTypeList[1].deviceType", iter_0.GetValue().deviceType, 22UL)); + VerifyOrReturn(CheckValue("deviceTypeList[1].revision", iter_0.GetValue().revision, 1U)); + VerifyOrReturn(CheckNoMoreListItems("deviceTypeList", iter_0, 2)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 0)); + VerifyOrReturn(CheckValue("serverList[0]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 1)); + VerifyOrReturn(CheckValue("serverList[1]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 2)); + VerifyOrReturn(CheckValue("serverList[2]", iter_0.GetValue(), 29UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 3)); + VerifyOrReturn(CheckValue("serverList[3]", iter_0.GetValue(), 30UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 4)); + VerifyOrReturn(CheckValue("serverList[4]", iter_0.GetValue(), 31UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 5)); + VerifyOrReturn(CheckValue("serverList[5]", iter_0.GetValue(), 40UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 6)); + VerifyOrReturn(CheckValue("serverList[6]", iter_0.GetValue(), 42UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 7)); + VerifyOrReturn(CheckValue("serverList[7]", iter_0.GetValue(), 43UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 8)); + VerifyOrReturn(CheckValue("serverList[8]", iter_0.GetValue(), 44UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 9)); + VerifyOrReturn(CheckValue("serverList[9]", iter_0.GetValue(), 45UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 10)); + VerifyOrReturn(CheckValue("serverList[10]", iter_0.GetValue(), 46UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 11)); + VerifyOrReturn(CheckValue("serverList[11]", iter_0.GetValue(), 47UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 12)); + VerifyOrReturn(CheckValue("serverList[12]", iter_0.GetValue(), 48UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 13)); + VerifyOrReturn(CheckValue("serverList[13]", iter_0.GetValue(), 49UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 14)); + VerifyOrReturn(CheckValue("serverList[14]", iter_0.GetValue(), 50UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 15)); + VerifyOrReturn(CheckValue("serverList[15]", iter_0.GetValue(), 51UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 16)); + VerifyOrReturn(CheckValue("serverList[16]", iter_0.GetValue(), 52UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 17)); + VerifyOrReturn(CheckValue("serverList[17]", iter_0.GetValue(), 53UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 18)); + VerifyOrReturn(CheckValue("serverList[18]", iter_0.GetValue(), 54UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 19)); + VerifyOrReturn(CheckValue("serverList[19]", iter_0.GetValue(), 55UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 20)); + VerifyOrReturn(CheckValue("serverList[20]", iter_0.GetValue(), 56UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 21)); + VerifyOrReturn(CheckValue("serverList[21]", iter_0.GetValue(), 60UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 22)); + VerifyOrReturn(CheckValue("serverList[22]", iter_0.GetValue(), 62UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 23)); + VerifyOrReturn(CheckValue("serverList[23]", iter_0.GetValue(), 63UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 24)); + VerifyOrReturn(CheckValue("serverList[24]", iter_0.GetValue(), 64UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 25)); + VerifyOrReturn(CheckValue("serverList[25]", iter_0.GetValue(), 65UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 26)); + VerifyOrReturn(CheckValue("serverList[26]", iter_0.GetValue(), 70UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 27)); + VerifyOrReturn(CheckValue("serverList[27]", iter_0.GetValue(), 1029UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 28)); + VerifyOrReturn(CheckValue("serverList[28]", iter_0.GetValue(), 4294048774UL)); + VerifyOrReturn(CheckNoMoreListItems("serverList", iter_0, 29)); + } + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("clientList", iter_0, 0)); + VerifyOrReturn(CheckValue("clientList[0]", iter_0.GetValue(), 41UL)); + VerifyOrReturn(CheckNoMoreListItems("clientList", iter_0, 1)); + } + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("partsList", iter_0, 0)); + VerifyOrReturn(CheckValue("partsList[0]", iter_0.GetValue(), 1U)); + VerifyOrReturn(CheckNextListItemDecodes("partsList", iter_0, 1)); + VerifyOrReturn(CheckValue("partsList[1]", iter_0.GetValue(), 2U)); + VerifyOrReturn(CheckNoMoreListItems("partsList", iter_0, 2)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute Device list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::DeviceTypeList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute Server list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::ServerList::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute Client list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::ClientList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Read attribute Parts list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::PartsList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestBasicInformationSuite : public TestCommand +{ +public: + TestBasicInformationSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestBasicInformation", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestBasicInformationSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("XX", 2))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("US", 2))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 8UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 9UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); + VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); + VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 14)); + VerifyOrReturn(CheckValue("attributeList[14]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 15)); + VerifyOrReturn(CheckValue("attributeList[15]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 16)); + VerifyOrReturn(CheckValue("attributeList[16]", iter_0.GetValue(), 16UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 17)); + VerifyOrReturn(CheckValue("attributeList[17]", iter_0.GetValue(), 18UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 18)); + VerifyOrReturn(CheckValue("attributeList[18]", iter_0.GetValue(), 19UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 19)); + VerifyOrReturn(CheckValue("attributeList[19]", iter_0.GetValue(), 20UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 20)); + VerifyOrReturn(CheckValue("attributeList[20]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 21)); + VerifyOrReturn(CheckValue("attributeList[21]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 22)); + VerifyOrReturn(CheckValue("attributeList[22]", iter_0.GetValue(), 65530UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 23)); + VerifyOrReturn(CheckValue("attributeList[23]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 24)); + VerifyOrReturn(CheckValue("attributeList[24]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 25)); + VerifyOrReturn(CheckValue("attributeList[25]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 26)); + } + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 8UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 9UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); + VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); + VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 14)); + VerifyOrReturn(CheckValue("attributeList[14]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 15)); + VerifyOrReturn(CheckValue("attributeList[15]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 16)); + VerifyOrReturn(CheckValue("attributeList[16]", iter_0.GetValue(), 16UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 17)); + VerifyOrReturn(CheckValue("attributeList[17]", iter_0.GetValue(), 18UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 18)); + VerifyOrReturn(CheckValue("attributeList[18]", iter_0.GetValue(), 19UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 19)); + VerifyOrReturn(CheckValue("attributeList[19]", iter_0.GetValue(), 20UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 20)); + VerifyOrReturn(CheckValue("attributeList[20]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 21)); + VerifyOrReturn(CheckValue("attributeList[21]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 22)); + VerifyOrReturn(CheckValue("attributeList[22]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 23)); + VerifyOrReturn(CheckValue("attributeList[23]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 24)); + VerifyOrReturn(CheckValue("attributeList[24]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 25)); + } + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, false)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::BasicInformation::Structs::ProductAppearanceStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productAppearance.finish", value.finish, 2U)); + VerifyOrReturn(CheckValueNonNull("productAppearance.primaryColor", value.primaryColor)); + VerifyOrReturn(CheckValue("productAppearance.primaryColor.Value()", value.primaryColor.Value(), 5U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read location"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Write location"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("USgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Read back location"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Restore initial location value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("XXgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Read AttributeList value"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read AttributeList value"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read NodeLabel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Write NodeLabel"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("My nodegarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Read back NodeLabel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read LocalConfigDisabled"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Write LocalConfigDisabled"); + ListFreer listFreer; + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 12: { + LogStep(12, "Read back LocalConfigDisabled"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Reboot the device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Connect to the device again"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Read back NodeLabel after reboot"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Restore initial NodeLabel value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "Read back LocalConfigDisabled after reboot"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Restore initial LocalConfigDisabled value"); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::LocalConfigDisabled::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 19: { + LogStep(19, "Read the ProductApppearance value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, + BasicInformation::Attributes::ProductAppearance::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestFabricRemovalWhileSubscribedSuite : public TestCommand +{ +public: + TestFabricRemovalWhileSubscribedSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestFabricRemovalWhileSubscribed", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestFabricRemovalWhileSubscribedSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + uint8_t ourFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissionedFabrics", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + ourFabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read number of commissioned fabrics"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CommissionedFabrics::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read current fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Open commissioning window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = 74565ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 5: { + LogStep(5, "Wait for the commissioned device to be retrieved for beta"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = 74565ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 6: { + LogStep(6, "Subscribe Fabrics Attribute from beta"); + return SubscribeAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, 2, 5, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 7: { + LogStep(7, "Remove single own fabric"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = ourFabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestGeneralCommissioningSuite : public TestCommand +{ +public: + TestGeneralCommissioningSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestGeneralCommissioning", 40, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestGeneralCommissioningSuite() + { + if (originalLocationBuffer != nullptr) + { + chip::Platform::MemoryFree(originalLocationBuffer); + originalLocationBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + chip::app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum originalRegulatoryConfig; + char * originalLocationBuffer = nullptr; + chip::CharSpan originalLocation; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 137438953472ULL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 81ULL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 0ULL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 1ULL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 3U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 1ULL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 4U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 1ULL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 2ULL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 4U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 2ULL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 2U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 2ULL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 0ULL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 3ULL)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 0ULL)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + originalRegulatoryConfig = value; + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("XX", 2))); + if (originalLocationBuffer != nullptr) + { + chip::Platform::MemoryFree(originalLocationBuffer); + } + originalLocationBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(originalLocationBuffer, value.data(), value.size()); + originalLocation = chip::CharSpan(originalLocationBuffer, value.size()); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, originalLocation)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, originalLocation)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0U)); + VerifyOrReturn(CheckValueAsString("debugText", value.debugText, chip::CharSpan("", 0))); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("US", 2))); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Write Breadcrumb (1/2)"); + ListFreer listFreer; + uint64_t value; + value = 137438953472ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, value, chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Read back Breadcrumb (1/2)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Write Breadcrumb (2/2)"); + ListFreer listFreer; + uint64_t value; + value = 81ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, value, chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Read back Breadcrumb (2/2)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Reboot to reset Breadcrumb"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Connect to the device again"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Read back Breadcrumb after reboot and ensure it was not persisted"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Set Breadcrumb to nonzero value"); + ListFreer listFreer; + uint64_t value; + value = 1ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, value, chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Check Breadcrumb set worked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Send CommissioningComplete without armed fail-safe"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::CommissioningComplete::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Check Breadcrumb was not touched by invalid CommissioningComplete"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Open Commissioning Window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Try to arm fail-safe"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 10U; + value.breadcrumb = 5000ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Check Breadcrumb was not touched by ArmFailSafe with commissioning window open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Reset Breadcrumb to 0 so we can commission"); + ListFreer listFreer; + uint64_t value; + value = 0ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, value, chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = 74565ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 17: { + LogStep(17, "Wait for the commissioned device to be retrieved for beta"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = 74565ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 18: { + LogStep(18, "Arm fail-safe"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 500U; + value.breadcrumb = 2ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value, chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Check Breadcrumb was properly set by ArmFailSafe"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Try to arm fail-safe from wrong fabric"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 10U; + value.breadcrumb = 5000ULL; + return SendCommand(kIdentityBeta, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value, chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Check Breadcrumb was not touched by ArmFailSafe with existing fail-safe armed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Send CommissioningComplete from wrong fabric"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type value; + return SendCommand(kIdentityBeta, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::CommissioningComplete::Id, value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Check Breadcrumb was not touched by CommissioningComplete from wrong fabric"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Close out the fail-safe gracefully"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::CommissioningComplete::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Check Breadcrumb was reset to 0 by CommissioningComplete"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Arm fail-safe again"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 500U; + value.breadcrumb = 3ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value, chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Check Breadcrumb was set by arming fail-safe again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Force-expire the fail-safe"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 0U; + value.breadcrumb = 4ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value, chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Check Breadcrumb was reset by expiring the fail-safe"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Validate presence of SupportsConcurrentConnection"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::SupportsConcurrentConnection::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "Read original regulatory location"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::RegulatoryConfig::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "Read original location"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, "Try to SetRegulatoryConfig with 0-length country code"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type value; + value.newRegulatoryConfig = static_cast(0); + value.countryCode = chip::Span("garbage: not in length on purpose", 0); + value.breadcrumb = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::SetRegulatoryConfig::Id, value, chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Read back location"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 35: { + LogStep(35, "Try to SetRegulatoryConfig with length-1 country code"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type value; + value.newRegulatoryConfig = static_cast(0); + value.countryCode = chip::Span("Ugarbage: not in length on purpose", 1); + value.breadcrumb = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::SetRegulatoryConfig::Id, value, chip::NullOptional + + ); + } + case 36: { + LogStep(36, "Read back location second time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 37: { + LogStep(37, "Try to SetRegulatoryConfig with length-2 country code"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type value; + value.newRegulatoryConfig = static_cast(0); + value.countryCode = chip::Span("USgarbage: not in length on purpose", 2); + value.breadcrumb = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::SetRegulatoryConfig::Id, value, chip::NullOptional + + ); + } + case 38: { + LogStep(38, "Read back location third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::Location::Id, + true, chip::NullOptional); + } + case 39: { + LogStep(39, "Restore initial values"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type value; + value.newRegulatoryConfig = originalRegulatoryConfig; + value.countryCode = originalLocation; + value.breadcrumb = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::SetRegulatoryConfig::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestIdentifyClusterSuite : public TestCommand +{ +public: + TestIdentifyClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestIdentifyCluster", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestIdentifyClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Send Identify command and expect success response"); + ListFreer listFreer; + chip::app::Clusters::Identify::Commands::Identify::Type value; + value.identifyTime = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), Identify::Id, Identify::Commands::Identify::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestOperationalCredentialsClusterSuite : public TestCommand +{ +public: + TestOperationalCredentialsClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestOperationalCredentialsCluster", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestOperationalCredentialsClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t ourFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + ourFabricIndex = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("statusCode", value.statusCode, 11U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, ourFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("statusCode", value.statusCode, 0U)); + VerifyOrReturn(CheckValuePresent("fabricIndex", value.fabricIndex)); + VerifyOrReturn(CheckValue("fabricIndex.Value()", value.fabricIndex.Value(), ourFabricIndex)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("Batcave", 7))); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, ourFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read number of supported fabrics"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::SupportedFabrics::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read number of commissioned fabrics"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CommissionedFabrics::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read current fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Remove nonexistent fabric"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = 243U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Read fabric list before setting label"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Set the fabric label"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type value; + value.label = chip::Span("Batcavegarbage: not in length on purpose", 7); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::UpdateFabricLabel::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Read fabric list after setting label"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestModeSelectClusterSuite : public TestCommand +{ +public: + TestModeSelectClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestModeSelectCluster", 32, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestModeSelectClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t currentModeBeforeToggle; + chip::app::DataModel::Nullable OnModeValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("description", value, chip::CharSpan("Coffee", 6))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("standardNamespace", value)); + VerifyOrReturn(CheckValue("standardNamespace.Value()", value.Value(), 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 0)); + VerifyOrReturn( + CheckValueAsString("supportedModes[0].label", iter_0.GetValue().label, chip::CharSpan("Black", 5))); + VerifyOrReturn(CheckValue("supportedModes[0].mode", iter_0.GetValue().mode, 0U)); + { + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[0].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[0].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[0].semanticTags", iter_2, 1)); + } + VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 1)); + VerifyOrReturn( + CheckValueAsString("supportedModes[1].label", iter_0.GetValue().label, chip::CharSpan("Cappuccino", 10))); + VerifyOrReturn(CheckValue("supportedModes[1].mode", iter_0.GetValue().mode, 4U)); + { + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[1].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[1].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[1].semanticTags", iter_2, 1)); + } + VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 2)); + VerifyOrReturn( + CheckValueAsString("supportedModes[2].label", iter_0.GetValue().label, chip::CharSpan("Espresso", 8))); + VerifyOrReturn(CheckValue("supportedModes[2].mode", iter_0.GetValue().mode, 7U)); + { + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[2].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[2].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[2].semanticTags", iter_2, 1)); + } + VerifyOrReturn(CheckNoMoreListItems("supportedModes", iter_0, 3)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 3)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 3)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, 0U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("startUpMode", value)); + VerifyOrReturn(CheckValue("startUpMode.Value()", value.Value(), 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("onMode", value)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, 4U)); + currentModeBeforeToggle = value; + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, currentModeBeforeToggle)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("onMode", value)); + VerifyOrReturn(CheckValue("onMode.Value()", value.Value(), 7U)); + OnModeValue = value; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, OnModeValue)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("startUpMode", value)); + VerifyOrReturn(CheckValue("startUpMode.Value()", value.Value(), 7U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, 4U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentMode", value, 7U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read Description"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::Description::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read StandardNamespace"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StandardNamespace::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read SupportedModes"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::SupportedModes::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Read CurrentMode"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Read StartUpMode"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Read OnMode"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Change to Supported Mode"); + ListFreer listFreer; + chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; + value.newMode = 4U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Commands::ChangeToMode::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Verify Current Mode Change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Change to Unsupported Mode"); + ListFreer listFreer; + chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; + value.newMode = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Commands::ChangeToMode::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Toggle OnOff"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Toggle OnOff"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Verify Current Mode does not change when OnMode is null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Change to Unsupported OnMode"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 2U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "Change OnMode"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 7U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, "Verify OnMode"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Toggle OnOff"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Toggle OnOff"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Verify Current Mode Changes if OnMode is not null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Change to Unsupported StartUp Mode"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 2U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 20: { + LogStep(20, "Change to Supported StartUp Mode"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 7U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 21: { + LogStep(21, "Verify StartUp Mode Change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Change CurrentMode to another value"); + ListFreer listFreer; + chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; + value.newMode = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Commands::ChangeToMode::Id, value, + chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Change On Mode"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 4U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 24: { + LogStep(24, "Set StartUpOnOff"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 25: { + LogStep(25, "Reboot target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "Verify Current Mode Change based on OnMode, as it overwrites StartUpMode"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Change On Mode to Null"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 29: { + LogStep(29, "Reboot target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Verify Current Mode Change based on new StartUp Mode"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestTemperatureControlSuite : public TestCommand +{ +public: + TestTemperatureControlSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestTemperatureControl", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestTemperatureControlSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("supportedTemperatureLevels", iter_0, 0)); + VerifyOrReturn( + CheckValueAsString("supportedTemperatureLevels[0]", iter_0.GetValue(), chip::CharSpan("Hot", 3))); + VerifyOrReturn(CheckNextListItemDecodes("supportedTemperatureLevels", iter_0, 1)); + VerifyOrReturn( + CheckValueAsString("supportedTemperatureLevels[1]", iter_0.GetValue(), chip::CharSpan("Warm", 4))); + VerifyOrReturn(CheckNextListItemDecodes("supportedTemperatureLevels", iter_0, 2)); + VerifyOrReturn( + CheckValueAsString("supportedTemperatureLevels[2]", iter_0.GetValue(), chip::CharSpan("Freezing", 8))); + VerifyOrReturn(CheckNoMoreListItems("supportedTemperatureLevels", iter_0, 3)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("selectedTemperatureLevel", value, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("selectedTemperatureLevel", value, 1U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("selectedTemperatureLevel", value, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read supported temperature levels"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::SupportedTemperatureLevels::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read selected temperature level"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::SelectedTemperatureLevel::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Set temperature level to different level"); + ListFreer listFreer; + chip::app::Clusters::TemperatureControl::Commands::SetTemperature::Type value; + value.targetTemperatureLevel.Emplace(); + value.targetTemperatureLevel.Value() = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Commands::SetTemperature::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Read back selected temperature level"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::SelectedTemperatureLevel::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Set temperature level to different level"); + ListFreer listFreer; + chip::app::Clusters::TemperatureControl::Commands::SetTemperature::Type value; + value.targetTemperatureLevel.Emplace(); + value.targetTemperatureLevel.Value() = 3U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Commands::SetTemperature::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Read back selected temperature level"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureControl::Id, + TemperatureControl::Attributes::SelectedTemperatureLevel::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestSelfFabricRemovalSuite : public TestCommand +{ +public: + TestSelfFabricRemovalSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestSelfFabricRemoval", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestSelfFabricRemovalSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t ourFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissionedFabrics", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + ourFabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read number of commissioned fabrics"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CommissionedFabrics::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read current fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Remove single own fabric"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = ourFabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestSystemCommandsSuite : public TestCommand +{ +public: + TestSystemCommandsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestSystemCommands", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestSystemCommandsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mPayload; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Stop the default accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Start the default accessory with no command line options"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + return Start(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Stop the default accessory by key"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("defaultgarbage: not in length on purpose", 7); + return Stop(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Start the default accessory with discriminator command line option"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.discriminator.Emplace(); + value.discriminator.Value() = 1111U; + return Start(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Stop the default accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Start the default accessory with discriminator and port command line options"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.discriminator.Emplace(); + value.discriminator.Value() = 1111U; + value.port.Emplace(); + value.port.Value() = 5560U; + return Start(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Stop the default accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Start the default accessory with minCommissioningTimeout only"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.minCommissioningTimeout.Emplace(); + value.minCommissioningTimeout.Value() = 10U; + return Start(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Stop the default accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Start the default accessory by key with all command line options"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("defaultgarbage: not in length on purpose", 7); + value.discriminator.Emplace(); + value.discriminator.Value() = 1111U; + value.port.Emplace(); + value.port.Value() = 5560U; + value.kvs.Emplace(); + value.kvs.Value() = chip::Span("/tmp/chip_kvs_defaultgarbage: not in length on purpose", 21); + value.minCommissioningTimeout.Emplace(); + value.minCommissioningTimeout.Value() = 10U; + return Start(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Start a second accessory with all command line options"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("chip-lock-appgarbage: not in length on purpose", 13); + value.discriminator.Emplace(); + value.discriminator.Value() = 50U; + value.port.Emplace(); + value.port.Value() = 5561U; + value.kvs.Emplace(); + value.kvs.Value() = chip::Span("/tmp/chip_kvs_lockgarbage: not in length on purpose", 18); + return Start(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Commission second accessory from alpha"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = 3735928559ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0IX4122-.548G00", 22); + return PairWithCode(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Wait for the second commissioned device to be retrieved for alpha"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = 3735928559ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Stop the second accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("chip-lock-appgarbage: not in length on purpose", 13); + return Stop(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Start a second accessory with different KVS"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("chip-lock-appgarbage: not in length on purpose", 13); + value.discriminator.Emplace(); + value.discriminator.Value() = 50U; + value.port.Emplace(); + value.port.Value() = 5561U; + value.kvs.Emplace(); + value.kvs.Value() = chip::Span("/tmp/chip_kvs_lock2garbage: not in length on purpose", 19); + return Start(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Reboot the default accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Reboot the default accessory by key"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("defaultgarbage: not in length on purpose", 7); + return Reboot(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Reboot the second accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("chip-lock-appgarbage: not in length on purpose", 13); + return Reboot(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Factory Reset the default accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Factory Reset the default accessory by key"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("defaultgarbage: not in length on purpose", 7); + return FactoryReset(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Factory Reset the second accessory"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("chip-lock-appgarbage: not in length on purpose", 13); + return FactoryReset(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestBindingSuite : public TestCommand +{ +public: + TestBindingSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestBinding", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestBindingSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("binding", iter_0, 0)); + } + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 0)); + VerifyOrReturn(CheckValuePresent("binding[0].group", iter_0.GetValue().group)); + VerifyOrReturn(CheckValue("binding[0].group.Value()", iter_0.GetValue().group.Value(), 1U)); + VerifyOrReturn(CheckValue("binding[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 1)); + VerifyOrReturn(CheckValuePresent("binding[1].node", iter_0.GetValue().node)); + VerifyOrReturn(CheckValue("binding[1].node.Value()", iter_0.GetValue().node.Value(), 1ULL)); + VerifyOrReturn(CheckValuePresent("binding[1].endpoint", iter_0.GetValue().endpoint)); + VerifyOrReturn(CheckValue("binding[1].endpoint.Value()", iter_0.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("binding[1].cluster", iter_0.GetValue().cluster)); + VerifyOrReturn(CheckValue("binding[1].cluster.Value()", iter_0.GetValue().cluster.Value(), 6UL)); + VerifyOrReturn(CheckValue("binding[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 2)); + VerifyOrReturn(CheckValuePresent("binding[2].node", iter_0.GetValue().node)); + VerifyOrReturn(CheckValue("binding[2].node.Value()", iter_0.GetValue().node.Value(), 2ULL)); + VerifyOrReturn(CheckValuePresent("binding[2].endpoint", iter_0.GetValue().endpoint)); + VerifyOrReturn(CheckValue("binding[2].endpoint.Value()", iter_0.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckValue("binding[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("binding", iter_0, 3)); + } + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 0)); + VerifyOrReturn(CheckValuePresent("binding[0].node", iter_0.GetValue().node)); + VerifyOrReturn(CheckValue("binding[0].node.Value()", iter_0.GetValue().node.Value(), 3ULL)); + VerifyOrReturn(CheckValuePresent("binding[0].endpoint", iter_0.GetValue().endpoint)); + VerifyOrReturn(CheckValue("binding[0].endpoint.Value()", iter_0.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckValue("binding[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("binding", iter_0, 1)); + } + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 0)); + VerifyOrReturn(CheckValuePresent("binding[0].group", iter_0.GetValue().group)); + VerifyOrReturn(CheckValue("binding[0].group.Value()", iter_0.GetValue().group.Value(), 1U)); + VerifyOrReturn(CheckValue("binding[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 1)); + VerifyOrReturn(CheckValuePresent("binding[1].node", iter_0.GetValue().node)); + VerifyOrReturn(CheckValue("binding[1].node.Value()", iter_0.GetValue().node.Value(), 1ULL)); + VerifyOrReturn(CheckValuePresent("binding[1].endpoint", iter_0.GetValue().endpoint)); + VerifyOrReturn(CheckValue("binding[1].endpoint.Value()", iter_0.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("binding[1].cluster", iter_0.GetValue().cluster)); + VerifyOrReturn(CheckValue("binding[1].cluster.Value()", iter_0.GetValue().cluster.Value(), 6UL)); + VerifyOrReturn(CheckValue("binding[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 2)); + VerifyOrReturn(CheckValuePresent("binding[2].node", iter_0.GetValue().node)); + VerifyOrReturn(CheckValue("binding[2].node.Value()", iter_0.GetValue().node.Value(), 2ULL)); + VerifyOrReturn(CheckValuePresent("binding[2].endpoint", iter_0.GetValue().endpoint)); + VerifyOrReturn(CheckValue("binding[2].endpoint.Value()", iter_0.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckValue("binding[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("binding", iter_0, 3)); + } + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Write empty binding table"); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::Binding::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Read empty binding table"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::Binding::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Write invalid binding table"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].node.Emplace(); + listHolder_0->mList[1].node.Value() = 1ULL; + listHolder_0->mList[1].group.Emplace(); + listHolder_0->mList[1].group.Value() = 1U; + listHolder_0->mList[1].endpoint.Emplace(); + listHolder_0->mList[1].endpoint.Value() = 1U; + listHolder_0->mList[1].cluster.Emplace(); + listHolder_0->mList[1].cluster.Value() = 6UL; + listHolder_0->mList[1].fabricIndex = 0U; + + value = + chip::app::DataModel::List(listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::Binding::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Write binding table (endpoint 1)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].group.Emplace(); + listHolder_0->mList[0].group.Value() = 1U; + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].node.Emplace(); + listHolder_0->mList[1].node.Value() = 1ULL; + listHolder_0->mList[1].endpoint.Emplace(); + listHolder_0->mList[1].endpoint.Value() = 1U; + listHolder_0->mList[1].cluster.Emplace(); + listHolder_0->mList[1].cluster.Value() = 6UL; + listHolder_0->mList[1].fabricIndex = 0U; + + listHolder_0->mList[2].node.Emplace(); + listHolder_0->mList[2].node.Value() = 2ULL; + listHolder_0->mList[2].endpoint.Emplace(); + listHolder_0->mList[2].endpoint.Value() = 1U; + listHolder_0->mList[2].fabricIndex = 0U; + + value = + chip::app::DataModel::List(listHolder_0->mList, 3); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::Binding::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Read binding table (endpoint 1)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::Binding::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Write binding table (endpoint 0)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].node.Emplace(); + listHolder_0->mList[0].node.Value() = 3ULL; + listHolder_0->mList[0].endpoint.Emplace(); + listHolder_0->mList[0].endpoint.Value() = 1U; + listHolder_0->mList[0].fabricIndex = 0U; + + value = + chip::app::DataModel::List(listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Binding::Id, Binding::Attributes::Binding::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Read binding table (endpoint 0)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Binding::Id, Binding::Attributes::Binding::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Verify endpoint 1 not changed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::Binding::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Write over-long binding table on endpoint 1"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(11); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].node.Emplace(); + listHolder_0->mList[0].node.Value() = 1ULL; + listHolder_0->mList[0].endpoint.Emplace(); + listHolder_0->mList[0].endpoint.Value() = 1U; + listHolder_0->mList[0].cluster.Emplace(); + listHolder_0->mList[0].cluster.Value() = 6UL; + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].node.Emplace(); + listHolder_0->mList[1].node.Value() = 2ULL; + listHolder_0->mList[1].endpoint.Emplace(); + listHolder_0->mList[1].endpoint.Value() = 2U; + listHolder_0->mList[1].cluster.Emplace(); + listHolder_0->mList[1].cluster.Value() = 6UL; + listHolder_0->mList[1].fabricIndex = 0U; + + listHolder_0->mList[2].node.Emplace(); + listHolder_0->mList[2].node.Value() = 3ULL; + listHolder_0->mList[2].endpoint.Emplace(); + listHolder_0->mList[2].endpoint.Value() = 3U; + listHolder_0->mList[2].cluster.Emplace(); + listHolder_0->mList[2].cluster.Value() = 6UL; + listHolder_0->mList[2].fabricIndex = 0U; + + listHolder_0->mList[3].node.Emplace(); + listHolder_0->mList[3].node.Value() = 4ULL; + listHolder_0->mList[3].endpoint.Emplace(); + listHolder_0->mList[3].endpoint.Value() = 4U; + listHolder_0->mList[3].cluster.Emplace(); + listHolder_0->mList[3].cluster.Value() = 6UL; + listHolder_0->mList[3].fabricIndex = 0U; + + listHolder_0->mList[4].node.Emplace(); + listHolder_0->mList[4].node.Value() = 5ULL; + listHolder_0->mList[4].endpoint.Emplace(); + listHolder_0->mList[4].endpoint.Value() = 5U; + listHolder_0->mList[4].cluster.Emplace(); + listHolder_0->mList[4].cluster.Value() = 6UL; + listHolder_0->mList[4].fabricIndex = 0U; + + listHolder_0->mList[5].node.Emplace(); + listHolder_0->mList[5].node.Value() = 6ULL; + listHolder_0->mList[5].endpoint.Emplace(); + listHolder_0->mList[5].endpoint.Value() = 6U; + listHolder_0->mList[5].cluster.Emplace(); + listHolder_0->mList[5].cluster.Value() = 6UL; + listHolder_0->mList[5].fabricIndex = 0U; + + listHolder_0->mList[6].node.Emplace(); + listHolder_0->mList[6].node.Value() = 7ULL; + listHolder_0->mList[6].endpoint.Emplace(); + listHolder_0->mList[6].endpoint.Value() = 7U; + listHolder_0->mList[6].cluster.Emplace(); + listHolder_0->mList[6].cluster.Value() = 6UL; + listHolder_0->mList[6].fabricIndex = 0U; + + listHolder_0->mList[7].node.Emplace(); + listHolder_0->mList[7].node.Value() = 8ULL; + listHolder_0->mList[7].endpoint.Emplace(); + listHolder_0->mList[7].endpoint.Value() = 8U; + listHolder_0->mList[7].cluster.Emplace(); + listHolder_0->mList[7].cluster.Value() = 6UL; + listHolder_0->mList[7].fabricIndex = 0U; + + listHolder_0->mList[8].node.Emplace(); + listHolder_0->mList[8].node.Value() = 9ULL; + listHolder_0->mList[8].endpoint.Emplace(); + listHolder_0->mList[8].endpoint.Value() = 9U; + listHolder_0->mList[8].cluster.Emplace(); + listHolder_0->mList[8].cluster.Value() = 6UL; + listHolder_0->mList[8].fabricIndex = 0U; + + listHolder_0->mList[9].node.Emplace(); + listHolder_0->mList[9].node.Value() = 10ULL; + listHolder_0->mList[9].endpoint.Emplace(); + listHolder_0->mList[9].endpoint.Value() = 10U; + listHolder_0->mList[9].cluster.Emplace(); + listHolder_0->mList[9].cluster.Value() = 6UL; + listHolder_0->mList[9].fabricIndex = 0U; + + listHolder_0->mList[10].node.Emplace(); + listHolder_0->mList[10].node.Value() = 11ULL; + listHolder_0->mList[10].endpoint.Emplace(); + listHolder_0->mList[10].endpoint.Value() = 11U; + listHolder_0->mList[10].cluster.Emplace(); + listHolder_0->mList[10].cluster.Value() = 6UL; + listHolder_0->mList[10].fabricIndex = 0U; + + value = + chip::app::DataModel::List(listHolder_0->mList, 11); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::Binding::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestUserLabelClusterSuite : public TestCommand +{ +public: + TestUserLabelClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestUserLabelCluster", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestUserLabelClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("labelList[0].label", iter_0.GetValue().label, chip::CharSpan("room", 4))); + VerifyOrReturn( + CheckValueAsString("labelList[0].value", iter_0.GetValue().value, chip::CharSpan("bedroom 1", 9))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 1)); + VerifyOrReturn( + CheckValueAsString("labelList[1].label", iter_0.GetValue().label, chip::CharSpan("orientation", 11))); + VerifyOrReturn(CheckValueAsString("labelList[1].value", iter_0.GetValue().value, chip::CharSpan("South", 5))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 2)); + VerifyOrReturn(CheckValueAsString("labelList[2].label", iter_0.GetValue().label, chip::CharSpan("floor", 5))); + VerifyOrReturn(CheckValueAsString("labelList[2].value", iter_0.GetValue().value, chip::CharSpan("2", 1))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 3)); + VerifyOrReturn( + CheckValueAsString("labelList[3].label", iter_0.GetValue().label, chip::CharSpan("direction", 9))); + VerifyOrReturn(CheckValueAsString("labelList[3].value", iter_0.GetValue().value, chip::CharSpan("down", 4))); + VerifyOrReturn(CheckNoMoreListItems("labelList", iter_0, 4)); + } + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("labelList", iter_0, 0)); + } + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("labelList[0].label", iter_0.GetValue().label, chip::CharSpan("room", 4))); + VerifyOrReturn( + CheckValueAsString("labelList[0].value", iter_0.GetValue().value, chip::CharSpan("bedroom 2", 9))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 1)); + VerifyOrReturn( + CheckValueAsString("labelList[1].label", iter_0.GetValue().label, chip::CharSpan("orientation", 11))); + VerifyOrReturn(CheckValueAsString("labelList[1].value", iter_0.GetValue().value, chip::CharSpan("North", 5))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 2)); + VerifyOrReturn(CheckValueAsString("labelList[2].label", iter_0.GetValue().label, chip::CharSpan("floor", 5))); + VerifyOrReturn(CheckValueAsString("labelList[2].value", iter_0.GetValue().value, chip::CharSpan("5", 1))); + VerifyOrReturn(CheckNextListItemDecodes("labelList", iter_0, 3)); + VerifyOrReturn( + CheckValueAsString("labelList[3].label", iter_0.GetValue().label, chip::CharSpan("direction", 9))); + VerifyOrReturn(CheckValueAsString("labelList[3].value", iter_0.GetValue().value, chip::CharSpan("up", 2))); + VerifyOrReturn(CheckNoMoreListItems("labelList", iter_0, 4)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Commit User Label List"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("roomgarbage: not in length on purpose", 4); + listHolder_0->mList[0].value = chip::Span("bedroom 1garbage: not in length on purpose", 9); + + listHolder_0->mList[1].label = chip::Span("orientationgarbage: not in length on purpose", 11); + listHolder_0->mList[1].value = chip::Span("Southgarbage: not in length on purpose", 5); + + listHolder_0->mList[2].label = chip::Span("floorgarbage: not in length on purpose", 5); + listHolder_0->mList[2].value = chip::Span("2garbage: not in length on purpose", 1); + + listHolder_0->mList[3].label = chip::Span("directiongarbage: not in length on purpose", 9); + listHolder_0->mList[3].value = chip::Span("downgarbage: not in length on purpose", 4); + + value = + chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Verify committed User Label List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Clear User Label List"); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Read User Label List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Write User Label List"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("roomgarbage: not in length on purpose", 4); + listHolder_0->mList[0].value = chip::Span("bedroom 2garbage: not in length on purpose", 9); + + listHolder_0->mList[1].label = chip::Span("orientationgarbage: not in length on purpose", 11); + listHolder_0->mList[1].value = chip::Span("Northgarbage: not in length on purpose", 5); + + listHolder_0->mList[2].label = chip::Span("floorgarbage: not in length on purpose", 5); + listHolder_0->mList[2].value = chip::Span("5garbage: not in length on purpose", 1); + + listHolder_0->mList[3].label = chip::Span("directiongarbage: not in length on purpose", 9); + listHolder_0->mList[3].value = chip::Span("upgarbage: not in length on purpose", 2); + + value = + chip::app::DataModel::List(listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Reboot target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Verify User Label List after reboot"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestUserLabelClusterConstraintsSuite : public TestCommand +{ +public: + TestUserLabelClusterConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestUserLabelClusterConstraints", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestUserLabelClusterConstraintsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Attempt to write overly long item for label"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = + chip::Span("this is longer than sixteen charactersgarbage: not in length on purpose", 38); + listHolder_0->mList[0].value = chip::Span("bedroom 2garbage: not in length on purpose", 9); + + value = + chip::app::DataModel::List(listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Attempt to write overly long item for value"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].label = chip::Span("testgarbage: not in length on purpose", 4); + listHolder_0->mList[0].value = + chip::Span("this is longer than sixteen charactersgarbage: not in length on purpose", 38); + + value = + chip::app::DataModel::List(listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UserLabel::Id, UserLabel::Attributes::LabelList::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestArmFailSafeSuite : public TestCommand +{ +public: + TestArmFailSafeSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestArmFailSafe", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestArmFailSafeSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].nodeID", iter_0.GetValue().nodeID, + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILSAFE_REQUIRED)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILSAFE_REQUIRED)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILSAFE_REQUIRED)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILSAFE_REQUIRED)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Reboot target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Wait for the alpha device to be retrieved "); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Query fabrics list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "ArmFailSafe on target device with timeout 0"); + ListFreer listFreer; + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 0U; + value.breadcrumb = 0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Reads NodeLabel mandatory attribute of target device"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Invoke AddTrustedRootCertificate without fail-safe"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type value; + value.rootCACertificate = chip::ByteSpan(chip::Uint8::from_const_char("00000000garbage: not in length on purpose"), 8); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::AddTrustedRootCertificate::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Invoke AddNOC without fail-safe"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type value; + value.NOCValue = chip::ByteSpan(chip::Uint8::from_const_char("00112233garbage: not in length on purpose"), 8); + value.IPKValue = chip::ByteSpan( + chip::Uint8::from_const_char( + "\000\001\002\003\004\005\006\007\000\001\002\003\004\005\006\007garbage: not in length on purpose"), + 16); + value.caseAdminSubject = 1234ULL; + value.adminVendorId = static_cast(65521); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::AddNOC::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Invoke UpdateNOC without fail-safe"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type value; + value.NOCValue = chip::ByteSpan(chip::Uint8::from_const_char("00112233garbage: not in length on purpose"), 8); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::UpdateNOC::Id, value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Invoke CSRRequest without fail-safe"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::CSRRequest::Type value; + value.CSRNonce = chip::ByteSpan( + chip::Uint8::from_const_char("\000\001\002\003\004\005\006\007\000\001\002\003\004\005\006\007\000\001\002\003\004" + "\005\006\007\000\001\002\003\004\005\006\007garbage: not in length on purpose"), + 32); + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::CSRRequest::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestFanControlSuite : public TestCommand +{ +public: + TestFanControlSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestFanControl", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestFanControlSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::FanModeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("fanMode", value, 3U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FanControl::FanModeSequenceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("fanModeSequence", value, 5U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("percentSetting", value)); + VerifyOrReturn(CheckValue("percentSetting.Value()", value.Value(), 84U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("speedSetting", value)); + VerifyOrReturn(CheckValue("speedSetting.Value()", value.Value(), 84U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("speedCurrent", value, 84U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("percentSetting", value)); + VerifyOrReturn(CheckValue("percentSetting.Value()", value.Value(), 84U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("speedSetting", value)); + VerifyOrReturn(CheckValue("speedSetting.Value()", value.Value(), 73U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("percentSetting", value)); + VerifyOrReturn(CheckValue("percentSetting.Value()", value.Value(), 73U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("percentCurrent", value, 73U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("speedSetting", value)); + VerifyOrReturn(CheckValue("speedSetting.Value()", value.Value(), 73U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("percentSetting", value)); + VerifyOrReturn(CheckValue("percentSetting.Value()", value.Value(), 0U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("percentCurrent", value, 0U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("speedSetting", value)); + VerifyOrReturn(CheckValue("speedSetting.Value()", value.Value(), 0U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("speedCurrent", value, 0U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("percentSetting", value)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("speedSetting", value)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Write fan mode"); + ListFreer listFreer; + chip::app::Clusters::FanControl::FanModeEnum value; + value = static_cast(3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Read back fan mode"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Write fan mode sequence"); + ListFreer listFreer; + chip::app::Clusters::FanControl::FanModeSequenceEnum value; + value = static_cast(5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanModeSequence::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Read back fan mode sequence"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanModeSequence::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Write percent setting"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 84U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Read back percent setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Read back speed setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Read back speed current"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedCurrent::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Write percent setting"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "Read back percent setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Write speed setting"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 73U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "Read back speed setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Read back percent setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Read back percent current"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentCurrent::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Write speed setting"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "Read back speed setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Write fan mode"); + ListFreer listFreer; + chip::app::Clusters::FanControl::FanModeEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Read back percent setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Read back percent current"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentCurrent::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Read back speed setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Read back speed current"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedCurrent::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Write fan mode"); + ListFreer listFreer; + chip::app::Clusters::FanControl::FanModeEnum value; + value = static_cast(5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::FanMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 23: { + LogStep(23, "Read back percent setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::PercentSetting::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Read back speed setting"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FanControl::Id, FanControl::Attributes::SpeedSetting::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestAccessControlConstraintsSuite : public TestCommand +{ +public: + TestAccessControlConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestAccessControlConstraints", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestAccessControlConstraintsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Constraint error: PASE reserved for future (TC-ACL-2.4 step 29)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(1); + listHolder_0->mList[1].subjects.SetNonNull(); + + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Constraint error: Invalid combination administer + group (TC-ACL-2.4 step 31)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(5); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Constraint error: Invalid auth mode (TC-ACL-2.4 step 33)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(4); + listHolder_0->mList[1].subjects.SetNonNull(); + + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Constraint error: Invalid subject (TC-ACL-2.4 step 34)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 0ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Constraint error: Invalid target (TC-ACL-2.4 step 38)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNull(); + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Constraint error: target has both endpoint and device type (TC-ACL-2.4 step 42)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = + new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 22U; + listHolder_3->mList[0].deviceType.SetNonNull(); + listHolder_3->mList[0].deviceType.Value() = 33UL; + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List( + listHolder_3->mList, 1); + } + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Constraint error: Invalid privilege value step 32)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(6); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Constraint error: invalid subject 0xFFFF_FFFF_FFFF_FFFF (TC-ACL-2.4 step 35)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 18446744073709551615ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Constraint error: invalid subject 0xFFFF_FFFD_0000_0000 (TC-ACL-2.4 step 36)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 18446744060824649728ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "Constraint error: invalid subject 0xFFFF_FFFF_FFFF_0000 (TC-ACL-2.4 step 37)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 112233ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 18446744073709486080ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestLevelControlWithOnOffDependencySuite : public TestCommand +{ +public: + TestLevelControlWithOnOffDependencySuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestLevelControlWithOnOffDependency", 33, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestLevelControlWithOnOffDependencySuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 1U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOffTransitionTime", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("onLevel", value)); + VerifyOrReturn(CheckValue("onLevel.Value()", value.Value(), 254U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("minLevel", value, 1U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 254U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 1U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 127U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("onLevel", value)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 127U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentLevel", value)); + VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 127U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Sends a MoveToLevel command to set CurrentLevel to min value"); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 1U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Wait 100 ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Reads CurrentLevel attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Write OnOffTransitionTime attribute"); + ListFreer listFreer; + uint16_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Wait 100 ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Read OnOffTransitionTime attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Write OnLevel attribute"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNonNull(); + value.Value() = 254U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 100 ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Read OnLevel attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Read MinValue attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Send On Command"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Check on/off attribute value is true after on command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait OnOffTransitionTime"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "If OnLevel is defined, check CurrentLevel is OnLevel value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Send Off Command"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Check on/off attribute value is false after off command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Wait OnOffTransitionTime"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 0UL; + return WaitForMs(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "If OnLevel is defined, check CurrentLevel is min value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Sends a MoveToLevel command to set CurrentLevel to a mid value"); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 127U; + value.transitionTime.SetNonNull(); + value.transitionTime.Value() = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Wait 100 ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Reads CurrentLevel attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Set OnLevel attribute to null"); + ListFreer listFreer; + chip::app::DataModel::Nullable value; + value.SetNull(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 23: { + LogStep(23, "Wait 100 ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Read OnLevel attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Send On Command"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Check on/off attribute value is true after on command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Wait OnOffTransitionTime"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "If OnLevel is not defined, check CurrentLevel is restored"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "Send Off Command"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Check on/off attribute value is false after off command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "Wait OnOffTransitionTime"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 0UL; + return WaitForMs(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "If OnLevel is not defined, check CurrentLevel is restored"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestCommissioningWindowSuite : public TestCommand +{ +public: + TestCommissioningWindowSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestCommissioningWindow", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("cluster", &mCluster); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestCommissioningWindowSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mNodeId2; + chip::Optional mEndpoint; + chip::Optional mCluster; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + uint8_t alphaIndex; + uint8_t betaIndex; + chip::app::DataModel::Nullable adminVendorId; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + alphaIndex = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 2U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("adminFabricIndex", value)); + VerifyOrReturn(CheckValue("adminFabricIndex.Value()", value.Value(), alphaIndex)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("value", value)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + betaIndex = value; + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 2U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("adminFabricIndex", value)); + VerifyOrReturn(CheckValue("adminFabricIndex.Value()", value.Value(), betaIndex)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("value", value)); + adminVendorId = value; + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 2U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (adminVendorId.IsNull()) + { + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("adminVendorId", value)); + VerifyOrReturn(CheckValue("adminVendorId.Value()", value.Value(), adminVendorId.Value())); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved for alpha"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Get alpha's fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Check that commissioning window is not open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Check that there is no AdminFabricIndex"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Check that there is no AdminVendorId"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Open Commissioning Window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Check that commissioning window is open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Check the AdminFabricIndex"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Check the AdminVendorId is not null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Close Commissioning Window"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Check that commissioning window is again not open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Check that again there is no AdminFabricIndex"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Check that again there is no AdminVendorId"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Open Commissioning Window from alpha again"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 15: { + LogStep(15, "Wait for the commissioned device to be retrieved for beta"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 16: { + LogStep(16, "Check that commissioning window is not open for the third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Check that there is no AdminFabricIndex for the third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Check that there is no AdminVendorId for the third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Get beta's fabric index"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Open Commissioning Window from beta"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityBeta, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Check that commissioning window is open again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Check the AdminFabricIndex again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Check the AdminVendorId is not null again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Remove beta fabric"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = betaIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Check that commissioning window is still open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Check the AdminFabricIndex got reset"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Check the AdminVendorId did not get reset"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestCommissionerNodeIdSuite : public TestCommand +{ +public: + TestCommissionerNodeIdSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestCommissionerNodeId", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("cluster", &mCluster); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestCommissionerNodeIdSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mEndpoint; + chip::Optional mCluster; + chip::Optional mPayload; + chip::Optional mTimeout; + + uint8_t alphaIndex; + chip::NodeId commissionerNodeIdAlpha; + uint8_t betaIndex; + chip::NodeId commissionerNodeIdBeta; + uint8_t gammaIndex; + chip::NodeId commissionerNodeIdGamma; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + alphaIndex = value; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + commissionerNodeIdAlpha = value.nodeId; + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + betaIndex = value; + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + commissionerNodeIdBeta = value.nodeId; + } + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + gammaIndex = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + commissionerNodeIdGamma = value.nodeId; + } + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), commissionerNodeIdAlpha)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, alphaIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), commissionerNodeIdBeta)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, betaIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), commissionerNodeIdGamma)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, gammaIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), commissionerNodeIdBeta)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, betaIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), commissionerNodeIdGamma)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 1)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, gammaIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved for alpha"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Open Commissioning Window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 3: { + LogStep(3, "Wait for the commissioned device to be retrieved for beta"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 4: { + LogStep(4, "Open Commissioning Window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Commission from gamma"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + case 6: { + LogStep(6, "Wait for the commissioned device to be retrieved for gamma"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityGamma, value); + } + case 7: { + LogStep(7, "Read the fabric ID from the alpha fabric"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the commissioner node ID from the alpha fabric"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Read the fabric ID from the beta fabric"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the commissioner node ID from the beta fabric"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityBeta, value); + } + case 11: { + LogStep(11, "Read the fabric ID from the gamma fabric"); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Read the commissioner node ID from the gamma fabric"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityGamma, value); + } + case 13: { + LogStep(13, "Read the ACL from alpha and check commissioner node id"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Read the ACL from beta and check commissioner node id"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Read the ACL from gamma and check commissioner node id"); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Write the ACL using the commissioner node id value"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeIdBeta; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = betaIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "Write the ACL using the commissioner node id value"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = commissionerNodeIdGamma; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = gammaIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityGamma, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Read the ACL from beta and check commissioner node id"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Read the ACL from gamma and check commissioner node id"); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Remove beta fabric"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = betaIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Remove gamma fabric"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = gammaIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestTimeSynchronizationSuite : public TestCommand +{ +public: + TestTimeSynchronizationSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestTimeSynchronization", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestTimeSynchronizationSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("timeZone", iter_0, 0)); + VerifyOrReturn(CheckValue("timeZone[0].offset", iter_0.GetValue().offset, 0L)); + VerifyOrReturn(CheckValue("timeZone[0].validAt", iter_0.GetValue().validAt, 0ULL)); + VerifyOrReturn(CheckNoMoreListItems("timeZone", iter_0, 1)); + } + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("DSTOffsetRequired", value.DSTOffsetRequired, true)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("timeZone", iter_0, 0)); + VerifyOrReturn(CheckValue("timeZone[0].offset", iter_0.GetValue().offset, 100L)); + VerifyOrReturn(CheckValue("timeZone[0].validAt", iter_0.GetValue().validAt, 0ULL)); + VerifyOrReturn(CheckValuePresent("timeZone[0].name", iter_0.GetValue().name)); + VerifyOrReturn( + CheckValueAsString("timeZone[0].name.Value()", iter_0.GetValue().name.Value(), chip::CharSpan("CET", 3))); + VerifyOrReturn(CheckNoMoreListItems("timeZone", iter_0, 1)); + } + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("DSTOffsetRequired", value.DSTOffsetRequired, true)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("timeZone", iter_0, 0)); + VerifyOrReturn(CheckValue("timeZone[0].offset", iter_0.GetValue().offset, 100L)); + VerifyOrReturn(CheckValue("timeZone[0].validAt", iter_0.GetValue().validAt, 0ULL)); + VerifyOrReturn(CheckNoMoreListItems("timeZone", iter_0, 1)); + } + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("DSTOffsetRequired", value.DSTOffsetRequired, true)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("timeZone", iter_0, 0)); + VerifyOrReturn(CheckValue("timeZone[0].offset", iter_0.GetValue().offset, 0L)); + VerifyOrReturn(CheckValue("timeZone[0].validAt", iter_0.GetValue().validAt, 0ULL)); + VerifyOrReturn(CheckNoMoreListItems("timeZone", iter_0, 1)); + } + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::TimeSynchronization::Structs::DSTOffsetStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("DSTOffset", iter_0, 0)); + } + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::TimeSynchronization::Structs::DSTOffsetStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("DSTOffset", iter_0, 0)); + VerifyOrReturn(CheckValue("DSTOffset[0].offset", iter_0.GetValue().offset, 1L)); + VerifyOrReturn(CheckValue("DSTOffset[0].validStarting", iter_0.GetValue().validStarting, 1ULL)); + VerifyOrReturn(CheckValueNonNull("DSTOffset[0].validUntil", iter_0.GetValue().validUntil)); + VerifyOrReturn(CheckValue("DSTOffset[0].validUntil.Value()", iter_0.GetValue().validUntil.Value(), 2ULL)); + VerifyOrReturn(CheckNextListItemDecodes("DSTOffset", iter_0, 1)); + VerifyOrReturn(CheckValue("DSTOffset[1].offset", iter_0.GetValue().offset, 0L)); + VerifyOrReturn(CheckValue("DSTOffset[1].validStarting", iter_0.GetValue().validStarting, 3ULL)); + VerifyOrReturn(CheckValueNull("DSTOffset[1].validUntil", iter_0.GetValue().validUntil)); + VerifyOrReturn(CheckNoMoreListItems("DSTOffset", iter_0, 2)); + } + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read Time Zone"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TimeZone::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Set Time Zone list"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 100L; + listHolder_0->mList[0].validAt = 0ULL; + listHolder_0->mList[0].name.Emplace(); + listHolder_0->mList[0].name.Value() = chip::Span("CETgarbage: not in length on purpose", 3); + + value.timeZone = + chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTimeZone::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Read Time Zone"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TimeZone::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Set Time Zone with missing optional name field"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 100L; + listHolder_0->mList[0].validAt = 0ULL; + + value.timeZone = + chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTimeZone::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Read Time Zone"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TimeZone::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Set Time Zone with very long name"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 100L; + listHolder_0->mList[0].validAt = 0ULL; + listHolder_0->mList[0].name.Emplace(); + listHolder_0->mList[0].name.Value() = chip::Span( + "MunichOnTheLongRiverOfIsarInNiceSummerWeatherWithAugustinerBeerssgarbage: not in length on purpose", 65); + + value.timeZone = + chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTimeZone::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Set Time Zone with first item validAt not zero"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 100L; + listHolder_0->mList[0].validAt = 1ULL; + listHolder_0->mList[0].name.Emplace(); + listHolder_0->mList[0].name.Value() = chip::Span("CDTgarbage: not in length on purpose", 3); + + value.timeZone = + chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTimeZone::Id, value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Set Time Zone with second item validAt zero"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Type value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 100L; + listHolder_0->mList[0].validAt = 0ULL; + listHolder_0->mList[0].name.Emplace(); + listHolder_0->mList[0].name.Value() = chip::Span("CSTgarbage: not in length on purpose", 3); + + listHolder_0->mList[1].offset = 200L; + listHolder_0->mList[1].validAt = 0ULL; + listHolder_0->mList[1].name.Emplace(); + listHolder_0->mList[1].name.Value() = chip::Span("CDTgarbage: not in length on purpose", 3); + + value.timeZone = + chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTimeZone::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Set Time Zone with more than supported list count"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Type value; + + { + auto * listHolder_0 = new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 100L; + listHolder_0->mList[0].validAt = 0ULL; + listHolder_0->mList[0].name.Emplace(); + listHolder_0->mList[0].name.Value() = chip::Span("CSTgarbage: not in length on purpose", 3); + + listHolder_0->mList[1].offset = 200L; + listHolder_0->mList[1].validAt = 1ULL; + listHolder_0->mList[1].name.Emplace(); + listHolder_0->mList[1].name.Value() = chip::Span("CDTgarbage: not in length on purpose", 3); + + listHolder_0->mList[2].offset = 200L; + listHolder_0->mList[2].validAt = 2ULL; + listHolder_0->mList[2].name.Emplace(); + listHolder_0->mList[2].name.Value() = chip::Span("CETgarbage: not in length on purpose", 3); + + value.timeZone = + chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTimeZone::Id, value, chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Set Time Zone empty"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Type value; + + value.timeZone = chip::app::DataModel::List(); + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTimeZone::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Read Time Zone"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TimeZone::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Read DSTOffset"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::DSTOffset::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Set DSTOffset single item"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 1L; + listHolder_0->mList[0].validStarting = 1ULL; + listHolder_0->mList[0].validUntil.SetNonNull(); + listHolder_0->mList[0].validUntil.Value() = 2ULL; + + value.DSTOffset = + chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetDSTOffset::Id, value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Set DSTOffset empty"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Type value; + + value.DSTOffset = + chip::app::DataModel::List(); + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetDSTOffset::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Set DSTOffset with more than 1 null value"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Type value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 1L; + listHolder_0->mList[0].validStarting = 1ULL; + listHolder_0->mList[0].validUntil.SetNull(); + + listHolder_0->mList[1].offset = 0L; + listHolder_0->mList[1].validStarting = 2ULL; + listHolder_0->mList[1].validUntil.SetNull(); + + value.DSTOffset = + chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetDSTOffset::Id, value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Set unsorted DSTOffset entries"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Type value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 1L; + listHolder_0->mList[0].validStarting = 2ULL; + listHolder_0->mList[0].validUntil.SetNonNull(); + listHolder_0->mList[0].validUntil.Value() = 3ULL; + + listHolder_0->mList[1].offset = 0L; + listHolder_0->mList[1].validStarting = 1ULL; + listHolder_0->mList[1].validUntil.SetNull(); + + value.DSTOffset = + chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetDSTOffset::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Set DSTOffset with multiple entries"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Type value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 1L; + listHolder_0->mList[0].validStarting = 1ULL; + listHolder_0->mList[0].validUntil.SetNonNull(); + listHolder_0->mList[0].validUntil.Value() = 2ULL; + + listHolder_0->mList[1].offset = 0L; + listHolder_0->mList[1].validStarting = 3ULL; + listHolder_0->mList[1].validUntil.SetNull(); + + value.DSTOffset = + chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetDSTOffset::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Read DSTOffset"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::DSTOffset::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Set DSTOffset with same validStarting and validUntil"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Type value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 0L; + listHolder_0->mList[0].validStarting = 1ULL; + listHolder_0->mList[0].validUntil.SetNonNull(); + listHolder_0->mList[0].validUntil.Value() = 1ULL; + + value.DSTOffset = + chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetDSTOffset::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Set DSTOffset with more than supported list count"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Type value; + + { + auto * listHolder_0 = new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].offset = 1L; + listHolder_0->mList[0].validStarting = 1ULL; + listHolder_0->mList[0].validUntil.SetNonNull(); + listHolder_0->mList[0].validUntil.Value() = 2ULL; + + listHolder_0->mList[1].offset = 0L; + listHolder_0->mList[1].validStarting = 3ULL; + listHolder_0->mList[1].validUntil.SetNonNull(); + listHolder_0->mList[1].validUntil.Value() = 5ULL; + + listHolder_0->mList[2].offset = 0L; + listHolder_0->mList[2].validStarting = 6ULL; + listHolder_0->mList[2].validUntil.SetNull(); + + value.DSTOffset = + chip::app::DataModel::List( + listHolder_0->mList, 3); + } + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetDSTOffset::Id, value, chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestOperationalStateSuite : public TestCommand +{ +public: + TestOperationalStateSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestOperationalState", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestOperationalStateSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("phaseList", value)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("currentPhase", value)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("countdownTime", value)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 0)); + VerifyOrReturn( + CheckValue("operationalStateList[0].operationalStateID", iter_0.GetValue().operationalStateID, 0U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 1)); + VerifyOrReturn( + CheckValue("operationalStateList[1].operationalStateID", iter_0.GetValue().operationalStateID, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 2)); + VerifyOrReturn( + CheckValue("operationalStateList[2].operationalStateID", iter_0.GetValue().operationalStateID, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 3)); + VerifyOrReturn( + CheckValue("operationalStateList[3].operationalStateID", iter_0.GetValue().operationalStateID, 3U)); + VerifyOrReturn(CheckNoMoreListItems("operationalStateList", iter_0, 4)); + } + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalError.errorStateID", value.errorStateID, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::OperationalStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commandResponseState.errorStateID", value.commandResponseState.errorStateID, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::OperationalStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 1U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commandResponseState.errorStateID", value.commandResponseState.errorStateID, 0U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::OperationalStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 2U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commandResponseState.errorStateID", value.commandResponseState.errorStateID, 0U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::OperationalStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 1U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commandResponseState.errorStateID", value.commandResponseState.errorStateID, 0U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalState::OperationalStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read Phase List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Attributes::PhaseList::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read current Phase"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::CurrentPhase::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read Countdown Time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::CountdownTime::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read Operational State List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalStateList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read current Operational Error"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalError::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Start Command"); + ListFreer listFreer; + chip::app::Clusters::OperationalState::Commands::Start::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Commands::Start::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Pause Command"); + ListFreer listFreer; + chip::app::Clusters::OperationalState::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Commands::Pause::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Resume Command"); + ListFreer listFreer; + chip::app::Clusters::OperationalState::Commands::Resume::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Commands::Resume::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Stop Command"); + ListFreer listFreer; + chip::app::Clusters::OperationalState::Commands::Stop::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Commands::Stop::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestRVCOperationalStateSuite : public TestCommand +{ +public: + TestRVCOperationalStateSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestRVCOperationalState", 15, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestRVCOperationalStateSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("phaseList", value)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("currentPhase", value)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("countdownTime", value)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 0)); + VerifyOrReturn( + CheckValue("operationalStateList[0].operationalStateID", iter_0.GetValue().operationalStateID, 0U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 1)); + VerifyOrReturn( + CheckValue("operationalStateList[1].operationalStateID", iter_0.GetValue().operationalStateID, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 2)); + VerifyOrReturn( + CheckValue("operationalStateList[2].operationalStateID", iter_0.GetValue().operationalStateID, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 3)); + VerifyOrReturn( + CheckValue("operationalStateList[3].operationalStateID", iter_0.GetValue().operationalStateID, 3U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 4)); + VerifyOrReturn( + CheckValue("operationalStateList[4].operationalStateID", iter_0.GetValue().operationalStateID, 64U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 5)); + VerifyOrReturn( + CheckValue("operationalStateList[5].operationalStateID", iter_0.GetValue().operationalStateID, 65U)); + VerifyOrReturn(CheckNextListItemDecodes("operationalStateList", iter_0, 6)); + VerifyOrReturn( + CheckValue("operationalStateList[6].operationalStateID", iter_0.GetValue().operationalStateID, 66U)); + VerifyOrReturn(CheckNoMoreListItems("operationalStateList", iter_0, 7)); + } + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalError.errorStateID", value.errorStateID, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commandResponseState.errorStateID", value.commandResponseState.errorStateID, 3U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 0U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commandResponseState.errorStateID", value.commandResponseState.errorStateID, 3U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 0U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("operationalState", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read Phase List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::PhaseList::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read current Phase"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::CurrentPhase::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read Countdown Time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::CountdownTime::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read Operational State List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::OperationalStateList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read current Operational Error"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::OperationalError::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Start Command"); + ListFreer listFreer; + chip::app::Clusters::RvcOperationalState::Commands::Start::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, RvcOperationalState::Commands::Start::Id, + value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Pause Command"); + ListFreer listFreer; + chip::app::Clusters::RvcOperationalState::Commands::Pause::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, RvcOperationalState::Commands::Pause::Id, + value, chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Resume Command"); + ListFreer listFreer; + chip::app::Clusters::RvcOperationalState::Commands::Resume::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, RvcOperationalState::Commands::Resume::Id, + value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Stop Command"); + ListFreer listFreer; + chip::app::Clusters::RvcOperationalState::Commands::Stop::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, RvcOperationalState::Commands::Stop::Id, + value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Read current Operational State"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcOperationalState::Id, + RvcOperationalState::Attributes::OperationalState::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestDishwasherAlarmSuite : public TestCommand +{ +public: + TestDishwasherAlarmSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestDishwasherAlarm", 22, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestDishwasherAlarmSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("supported", value, 47UL)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("mask", value, 47UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("latch", value, 3UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("state", value, 7UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("mask", value, 41UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("latch", value, 3UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("state", value, 1UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("mask", value, 41UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("latch", value, 3UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("state", value, 1UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("mask", value, 41UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("latch", value, 3UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("state", value, 1UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("mask", value, 41UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("latch", value, 3UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("state", value, 0UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read Supported Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Supported::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read Mask Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Mask::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read Latch Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Latch::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Read State Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::State::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Read feature map Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Modify enabled alarms Command"); + ListFreer listFreer; + chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::Type value; + value.mask = static_cast>(41UL); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, + DishwasherAlarm::Commands::ModifyEnabledAlarms::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Read Mask Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Mask::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Read Latch Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Latch::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Read State Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::State::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Modify enabled alarms Command"); + ListFreer listFreer; + chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::Type value; + value.mask = static_cast>(105UL); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, + DishwasherAlarm::Commands::ModifyEnabledAlarms::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Read Mask Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Mask::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Read Latch Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Latch::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Read State Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::State::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Modify enabled alarms Command"); + ListFreer listFreer; + chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::Type value; + value.mask = static_cast>(59UL); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, + DishwasherAlarm::Commands::ModifyEnabledAlarms::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Read Mask Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Mask::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Read Latch Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Latch::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Read State Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::State::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Reset Command"); + ListFreer listFreer; + chip::app::Clusters::DishwasherAlarm::Commands::Reset::Type value; + value.alarms = static_cast>(1UL); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Commands::Reset::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Read Mask Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Mask::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Read Latch Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::Latch::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Read State Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DishwasherAlarm::Id, DishwasherAlarm::Attributes::State::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestMultiAdminSuite : public TestCommand +{ +public: + TestMultiAdminSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestMultiAdmin", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestMultiAdminSuite() + { + if (readFromAlphaBuffer != nullptr) + { + chip::Platform::MemoryFree(readFromAlphaBuffer); + readFromAlphaBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + char * readFromAlphaBuffer = nullptr; + chip::CharSpan readFromAlpha; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].nodeID", iter_0.GetValue().nodeID, + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + if (readFromAlphaBuffer != nullptr) + { + chip::Platform::MemoryFree(readFromAlphaBuffer); + } + readFromAlphaBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(readFromAlphaBuffer, value.data(), value.size()); + readFromAlpha = chip::CharSpan(readFromAlphaBuffer, value.size()); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, readFromAlpha)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Stop target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Start target device with the provided discriminator for basic commissioning advertisement"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.discriminator.Emplace(); + value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + return Start(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Wait for the commissioned device to be retrieved for alpha"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Commission from alpha when the commissioning window is not opened"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeIdForDuplicateCommissioning.HasValue() ? mNodeIdForDuplicateCommissioning.Value() : 17ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Open Commissioning Window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Commission from alpha again"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeIdForDuplicateCommissioning.HasValue() ? mNodeIdForDuplicateCommissioning.Value() : 17ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Check that we just have the one fabric and did not add a new one"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false, chip::NullOptional); + } + case 7: { + LogStep(7, "Close Commissioning Window after failed commissioning"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Open Commissioning Window from alpha again"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 10: { + LogStep(10, "Wait for the commissioned device to be retrieved for beta"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 11: { + LogStep(11, "Open Commissioning Window from beta"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityBeta, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Commission from gamma"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + case 13: { + LogStep(13, "Wait for the commissioned device to be retrieved for gamma"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + return WaitForCommissionee(kIdentityGamma, value); + } + case 14: { + LogStep(14, "read the mandatory attribute: NodeLabel from alpha"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "write the mandatory attribute NodeLabel from beta"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("written from betagarbage: not in length on purpose", 17); + return WriteAttribute(kIdentityBeta, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "read the mandatory attribute: NodeLabel from gamma"); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "write the mandatory attribute NodeLabel back to default"); + ListFreer listFreer; + chip::CharSpan value; + value = readFromAlpha; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGSW_1_1Suite : public TestCommand +{ +public: + Test_TC_DGSW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGSW_1_1", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGSW_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip(" !DGSW.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given DGSW.S.F00(Watermarks) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DGSW.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: TH reads optional attribute(ThreadMetrics) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGSW.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4c: TH reads optional attribute(CurrentHeapFree) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGSW.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4d: TH reads optional attribute(CurrentHeapUsed) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGSW.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4e: TH reads Feature dependent attribute(CurrentHeapHighWatermark) in AttributeList"); + VerifyOrDo(!ShouldSkip("( DGSW.S.F00 || DGSW.S.A0003 )"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 4f: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 5a: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip("DGSW.S.E00 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 5b: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGSW.S.E00 && PICS_EVENT_LIST_ENABLED "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::EventList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 5c: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 6a: TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("DGSW.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 6b: TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGSW.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 6c: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, + "Step 7: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestSubscribe_OnOffSuite : public TestCommand +{ +public: + TestSubscribe_OnOffSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestSubscribe_OnOff", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestSubscribe_OnOffSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, false)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, true)); + } + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, false)); + } + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Set OnOff Attribute to false"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Subscribe OnOff Attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, 2, 5, true, + chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 3: { + LogStep(3, "Turn On the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Check for attribute report"); + return WaitForReport(); + } + case 5: { + LogStep(5, "Turn Off the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Check for attribute report"); + return WaitForReport(); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestSubscribe_AdministratorCommissioningSuite : public TestCommand +{ +public: + TestSubscribe_AdministratorCommissioningSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestSubscribe_AdministratorCommissioning", 17, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ourVendorId", 0, UINT16_MAX, &mOurVendorId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestSubscribe_AdministratorCommissioningSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mOurVendorId; + chip::Optional mTimeout; + + uint8_t ourFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ourFabricIndex = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 2U)); + } + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("adminVendorId", value)); + VerifyOrReturn( + CheckValue("adminVendorId.Value()", value.Value(), mOurVendorId.HasValue() ? mOurVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("adminFabricIndex", value)); + VerifyOrReturn(CheckValue("adminFabricIndex.Value()", value.Value(), ourFabricIndex)); + } + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Get ourfabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Subscribe WindowStatus Attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, 2, 50, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 3: { + LogStep(3, "Open the commissioning window 1"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Check for first attribute report for WindowStatus"); + return WaitForReport(); + } + case 5: { + LogStep(5, "Close the commissioning window 1"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Check for second attribute report for WindowStatus"); + return WaitForReport(); + } + case 7: { + LogStep(7, "Subscribe AdminVendorId Attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, 2, 50, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 8: { + LogStep(8, "Open the commissioning window 2"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Check for first attribute report for AdminVendorId"); + return WaitForReport(); + } + case 10: { + LogStep(10, "Close the commissioning window 2"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Check for second attribute report for AdminVendorId"); + return WaitForReport(); + } + case 12: { + LogStep(12, "Subscribe AdminFabricIndex Attribute"); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, 2, 50, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 13: { + LogStep(13, "Open the commissioning window 3"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Check for first attribute report for AdminFabricIndex"); + return WaitForReport(); + } + case 15: { + LogStep(15, "Close the commissioning window 2"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Check for second attribute report for AdminFabricIndex"); + return WaitForReport(); + } + } + return CHIP_NO_ERROR; + } +}; + +class DL_UsersAndCredentialsSuite : public TestCommand +{ +public: + DL_UsersAndCredentialsSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("DL_UsersAndCredentials", 128, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~DL_UsersAndCredentialsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t NumberOfTotalUsersSupported; + uint16_t NumberOfPINUsersSupported; + uint16_t NumberOfRFIDUsersSupported; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfTotalUsersSupported", value, 10U)); + NumberOfTotalUsersSupported = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("new_user", 8))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("new_user", 8))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 305441741UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("new_user", 8))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 305441741UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 3U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("new_user", 8))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 305441741UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 3U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 6U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("new_user", 8))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 305441741UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 3U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 6U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 2U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("test_user", 9))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 466460832UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("test_user2", 10))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 12648430UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 2U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 3U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 3U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 3U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("test_user3", 10))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 47802UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 3U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("last_user", 9))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNonNull("nextUserIndex", value.nextUserIndex)); + VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextUserIndex", value.nextUserIndex)); + VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfPINUsersSupported", value, 10U)); + NumberOfPINUsersSupported = value; + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 0)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialType", iter_1.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 1)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfRFIDUsersSupported", value, 10U)); + NumberOfRFIDUsersSupported = value; + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 0)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialType", iter_1.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 1)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialType", iter_1.GetValue().credentialType, 2U)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 2)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + } + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 2U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + } + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 0)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialType", iter_1.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 1)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialType", iter_1.GetValue().credentialType, 2U)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 2)); + VerifyOrReturn(CheckValue("credentials.Value()[2].credentialType", iter_1.GetValue().credentialType, 2U)); + VerifyOrReturn(CheckValue("credentials.Value()[2].credentialIndex", iter_1.GetValue().credentialIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 3)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextUserIndex", value.nextUserIndex)); + VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); + } + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + } + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 0)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialType", iter_1.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 1)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialType", iter_1.GetValue().credentialType, 2U)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 2)); + VerifyOrReturn(CheckValue("credentials.Value()[2].credentialType", iter_1.GetValue().credentialType, 2U)); + VerifyOrReturn(CheckValue("credentials.Value()[2].credentialIndex", iter_1.GetValue().credentialIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 3)); + VerifyOrReturn(CheckValue("credentials.Value()[3].credentialType", iter_1.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("credentials.Value()[3].credentialIndex", iter_1.GetValue().credentialIndex, 3U)); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 4)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextUserIndex", value.nextUserIndex)); + VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); + } + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 0)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialType", iter_1.GetValue().credentialType, 2U)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialIndex", iter_1.GetValue().credentialIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 1)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialType", iter_1.GetValue().credentialType, 2U)); + VerifyOrReturn(CheckValue("credentials.Value()[1].credentialIndex", iter_1.GetValue().credentialIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 2)); + VerifyOrReturn(CheckValue("credentials.Value()[2].credentialType", iter_1.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("credentials.Value()[2].credentialIndex", iter_1.GetValue().credentialIndex, 3U)); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 3)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextUserIndex", value.nextUserIndex)); + VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); + } + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 2U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + } + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 0)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialType", iter_1.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialIndex", iter_1.GetValue().credentialIndex, 3U)); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 1)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 2U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 3U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 4U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 7U)); + } + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 102: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 103: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 104: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 105: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 3U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 106: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 4U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 107: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 108: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 109: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes("credentials.Value()", iter_1, 0)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialType", iter_1.GetValue().credentialType, 0U)); + VerifyOrReturn(CheckValue("credentials.Value()[0].credentialIndex", iter_1.GetValue().credentialIndex, 0U)); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 1)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 110: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 111: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 112: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 113: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 114: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 115: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 116: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 117: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 118: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 119: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 120: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 121: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 122: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 123: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + } + break; + case 124: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 5U)); + } + break; + case 125: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 6U)); + } + break; + case 126: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 137U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 7U)); + } + break; + case 127: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read available user slot and verify response fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Get number of supported users and verify default value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read fails for user with index 0"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Read fails for user with index greater than Number Of Users Supported"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Create new user with default parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Set user at the occupied index fails with appropriate response"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Modify userName for existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(2); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("new_usergarbage: not in length on purpose", 8); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Read the modified user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Modify userUniqueId for existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(2); + value.userIndex = 1U; + value.userName.SetNull(); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 305441741UL; + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Read the modified user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Modify userStatus for existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(2); + value.userIndex = 1U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(3); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Read the modified user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Modify userType for existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(2); + value.userIndex = 1U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(6); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Read the modified user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Modify credentialRule for existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(2); + value.userIndex = 1U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(2); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Read the modified user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Modify all fields for existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(2); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("test_usergarbage: not in length on purpose", 9); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 466460832UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Read the modified user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Add another user with non-default fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 2U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("test_user2garbage: not in length on purpose", 10); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 12648430UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(1); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(2); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Read the new user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Try to add a user with userStatus 0"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 3U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("test_user3garbage: not in length on purpose", 10); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 47802UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(0); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Make sure the user did not get created"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 3U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Try to add a user with userStatus 2"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 3U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("test_user3garbage: not in length on purpose", 10); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 47802UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(2); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Make sure the user did not get created"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 3U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Try to add a user with userStatus 3"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 3U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("test_user3garbage: not in length on purpose", 10); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 47802UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(3); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Read the new third user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 3U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Create user in the last slot"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = NumberOfTotalUsersSupported; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("last_usergarbage: not in length on purpose", 9); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Read the last user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = NumberOfTotalUsersSupported; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 30: { + LogStep(30, "User creation in the 0 slot fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 0U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 31: { + LogStep(31, "User creation in the out-of-bounds slot fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 32: { + LogStep(32, "Clear first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 33: { + LogStep(33, "Read cleared user and verify it is available"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Create new user in the cleared slot"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 35: { + LogStep(35, "Read the user in the previously cleared slot and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 36: { + LogStep(36, "Clear user with index 0 fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Clear user with out-of-bounds index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 38: { + LogStep(38, "Clear all users"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 65534U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Read first cleared user and verify it is available"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 40: { + LogStep(40, "Read last cleared user and verify it is available"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = NumberOfTotalUsersSupported; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 41: { + LogStep(41, "Get number of supported PIN credentials and verify default value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfPINUsersSupported::Id, + true, chip::NullOptional); + } + case 42: { + LogStep(42, "Check that PIN credential does not exist"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Reading PIN credential with index 0 returns no credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 44: { + LogStep(44, "Reading PIN credential with out-of-bounds index returns no credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = static_cast(NumberOfPINUsersSupported + 1); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 45: { + LogStep(45, "Verify that a user with UserStatus = 0 cannot be added via SetCredential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(0); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 46: { + LogStep(46, "Verify that a user with UserStatus = 2 cannot be added via SetCredential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(2); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 47: { + LogStep(47, "Create new PIN credential and user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 48: { + LogStep(48, "Verify created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 49: { + LogStep(49, "Verify created PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Create new PIN credential and user with index 0 fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 0U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 51: { + LogStep(51, "Create new PIN credential and user with out-of-bounds index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = static_cast(NumberOfPINUsersSupported + 1); + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 52: { + LogStep(52, "Get number of supported RFID credentials and verify default value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfRFIDUsersSupported::Id, + true, chip::NullOptional); + } + case 53: { + LogStep(53, "Reading RFID credential with index 0 returns no credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 54: { + LogStep(54, "Reading RFID credential with out-of-bounds index returns no credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = static_cast(NumberOfRFIDUsersSupported + 1); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 55: { + LogStep(55, "Check that RFID credential does not exist"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 56: { + LogStep(56, "Create new RFID credential and add it to existing user with non-null UserStatus should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 57: { + LogStep(57, "Create new RFID credential and add it to existing user with non-null UserType should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 58: { + LogStep(58, "Create new RFID credential and add it to existing user with non-null UserType and UserStatus should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 59: { + LogStep(59, "Create new RFID credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 60: { + LogStep(60, "Verify modified user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 61: { + LogStep(61, "Verify created credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 62: { + LogStep(62, "Create new RFID credential and user with index 0 fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 0U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("new_rfid_data_fieldgarbage: not in length on purpose"), 19); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 63: { + LogStep(63, "Create new RFID credential and user with out-of-bounds index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = static_cast(NumberOfRFIDUsersSupported + 1); + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("new_rfid_data_fieldgarbage: not in length on purpose"), 19); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 64: { + LogStep(64, "Create new credential and try to add it to 0 user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123465garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 0U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 65: { + LogStep(65, "Create new credential and try to add it to out-of-bounds user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123465garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = static_cast(NumberOfTotalUsersSupported + 1); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 66: { + LogStep(66, "Create new PIN with too short data"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("12345garbage: not in length on purpose"), 5); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 0U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 67: { + LogStep(67, "Create new PIN with too long data"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456789garbage: not in length on purpose"), 9); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 0U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 68: { + LogStep(68, "Create new RFID with too short data"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("rfid_datagarbage: not in length on purpose"), 9); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 0U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 69: { + LogStep(69, "Create new PIN with Programming user type fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 0U; + value.userStatus.SetNull(); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(3); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 70: { + LogStep(70, "Create new RFID with too short data"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan( + chip::Uint8::from_const_char("very_long_rfid_data_to_test_boundariesgarbage: not in length on purpose"), 38); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 0U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 71: { + LogStep(71, "Create new PIN credential with data the would cause duplicate"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 3U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 72: { + LogStep(72, "Create new RFID credential with data the would cause duplicate"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 73: { + LogStep(73, "Modify credentialData of existing PIN credential with non-null UserStatus should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 74: { + LogStep(74, "Modify credentialData of existing PIN credential with non-null UserType should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 75: { + LogStep(75, "Modify credentialData of existing PIN credential with non-null UserStatus and UserType should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 76: { + LogStep(76, "Modify credentialData of existing PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 77: { + LogStep(77, "Verify that credential was changed by creating new credential with old data"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 78: { + LogStep(78, "Verify that credential was changed by creating new credential with new data"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 3U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 79: { + LogStep(79, "Create new RFID credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_7890garbage: not in length on purpose"), 14); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 80: { + LogStep(80, "Verify modified user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 81: { + LogStep(81, "Create new RFID credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 3U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("789012garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 82: { + LogStep(82, "Verify modified user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 83: { + LogStep(83, "Clear first PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(1); + value.credential.Value().credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 84: { + LogStep(84, "Read back the credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 85: { + LogStep(85, "Read the user back and make sure PIN credential is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 86: { + LogStep(86, "Clear the second PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(1); + value.credential.Value().credentialIndex = 2U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 87: { + LogStep(87, "Read back the credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 88: { + LogStep(88, "Read the user back and make sure related user is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 89: { + LogStep(89, "Create new RFID credential with user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 3U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_12345garbage: not in length on purpose"), 15); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 90: { + LogStep(90, "Clear all the RFID credentials"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(2); + value.credential.Value().credentialIndex = 65534U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 91: { + LogStep(91, "Read back the fist RFID credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 92: { + LogStep(92, "Read back the second RFID credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 93: { + LogStep(93, "Read back the third RFID credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 3U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 94: { + LogStep(94, "Read the user related with first RFID back and make sure it has only PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 95: { + LogStep(95, "Read the user related with second RFID back and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 96: { + LogStep(96, "Create new PIN credential with user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 97: { + LogStep(97, "Create new RFID credential with user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_1234garbage: not in length on purpose"), 14); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 98: { + LogStep(98, "Create another RFID credential with user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 6U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_9876garbage: not in length on purpose"), 14); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 99: { + LogStep(99, "Clear all the credentials"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 100: { + LogStep(100, "Read back the first PIN credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 101: { + LogStep(101, "Read back the first RFID credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 2U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 102: { + LogStep(102, "Read back the second PIN credential and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 6U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 103: { + LogStep(103, "Read the user related with first PIN back and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 104: { + LogStep(104, "Read the user related with first RFID back and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 105: { + LogStep(105, "Read the user related with second PIN back and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 3U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 106: { + LogStep(106, "Read the user related with last RFID back and make sure it is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 4U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 107: { + LogStep(107, "Create new Programming PIN credential with invalid index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(0); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 108: { + LogStep(108, "Create new Programming PIN credential with valid index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(0); + value.credential.credentialIndex = 0U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 109: { + LogStep(109, "Verify created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 110: { + LogStep(110, "Verify created programming PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(0); + value.credential.credentialIndex = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 111: { + LogStep(111, "Modify the Programming PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(0); + value.credential.credentialIndex = 0U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("654321garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 112: { + LogStep(112, "Clearing Programming PIN fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(0); + value.credential.Value().credentialIndex = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 113: { + LogStep(113, "Clearing Programming PIN with invalid index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(0); + value.credential.Value().credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 114: { + LogStep(114, "Clearing PIN credential with zero index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(1); + value.credential.Value().credentialIndex = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 115: { + LogStep(115, "Clearing PIN credential with out-of-bound index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(1); + value.credential.Value().credentialIndex = static_cast(NumberOfPINUsersSupported + 1); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 116: { + LogStep(116, "Clearing RFID credential with zero index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(2); + value.credential.Value().credentialIndex = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 117: { + LogStep(117, "Clearing RFID credential with out-of-bound index fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(2); + value.credential.Value().credentialIndex = static_cast(NumberOfRFIDUsersSupported + 1); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 118: { + LogStep(118, "Clear the Programming PIN user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 119: { + LogStep(119, "Make sure Programming PIN user is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 120: { + LogStep(120, "Make sure programming PIN credential is deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(0); + value.credential.credentialIndex = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 121: { + LogStep(121, "Create new PIN credential and user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 122: { + LogStep(122, "Create second PIN credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000001garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 123: { + LogStep(123, "Create third PIN credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 3U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000002garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 124: { + LogStep(124, "Create fourth PIN credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 4U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000003garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 125: { + LogStep(125, "Create fifth PIN credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 5U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000004garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 126: { + LogStep(126, "Try to create sixth PIN credential and make sure it fails"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 6U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("000005garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 127: { + LogStep(127, "Final clean-up"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class DL_LockUnlockSuite : public TestCommand +{ +public: + DL_LockUnlockSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("DL_LockUnlock", 58, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~DL_LockUnlockSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(25)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperation.lockOperationType", value.lockOperationType, 4U)); + VerifyOrReturn(CheckValue("lockOperation.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValueNull("lockOperation.userIndex", value.userIndex)); + VerifyOrReturn(CheckValuePresent("lockOperation.credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("lockOperation.credentials.Value()", value.credentials.Value())); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperation.lockOperationType", value.lockOperationType, 1U)); + VerifyOrReturn(CheckValue("lockOperation.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValueNull("lockOperation.userIndex", value.userIndex)); + VerifyOrReturn(CheckValuePresent("lockOperation.credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("lockOperation.credentials.Value()", value.credentials.Value())); + } + mTestSubStepIndex++; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperation.lockOperationType", value.lockOperationType, 0U)); + VerifyOrReturn(CheckValue("lockOperation.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValueNull("lockOperation.userIndex", value.userIndex)); + VerifyOrReturn(CheckValuePresent("lockOperation.credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("lockOperation.credentials.Value()", value.credentials.Value())); + } + mTestSubStepIndex++; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperation.lockOperationType", value.lockOperationType, 1U)); + VerifyOrReturn(CheckValue("lockOperation.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValueNull("lockOperation.userIndex", value.userIndex)); + VerifyOrReturn(CheckValuePresent("lockOperation.credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("lockOperation.credentials.Value()", value.credentials.Value())); + } + mTestSubStepIndex++; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperation.lockOperationType", value.lockOperationType, 0U)); + VerifyOrReturn(CheckValue("lockOperation.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValueNull("lockOperation.userIndex", value.userIndex)); + VerifyOrReturn(CheckValuePresent("lockOperation.credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("lockOperation.credentials.Value()", value.credentials.Value())); + } + mTestSubStepIndex++; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperation.lockOperationType", value.lockOperationType, 4U)); + VerifyOrReturn(CheckValue("lockOperation.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValueNonNull("lockOperation.userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("lockOperation.userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("lockOperation.credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("lockOperation.credentials.Value()", value.credentials.Value())); + { + auto iter_3 = value.credentials.Value().Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "lockOperation.credentials.Value().Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("lockOperation.credentials.Value().Value()[0].credentialType", + iter_3.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("lockOperation.credentials.Value().Value()[0].credentialIndex", + iter_3.GetValue().credentialIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems( + "lockOperation.credentials.Value().Value()", iter_3, 1)); + } + } + mTestSubStepIndex++; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperation.lockOperationType", value.lockOperationType, 1U)); + VerifyOrReturn(CheckValue("lockOperation.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValueNonNull("lockOperation.userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("lockOperation.userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("lockOperation.credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("lockOperation.credentials.Value()", value.credentials.Value())); + { + auto iter_3 = value.credentials.Value().Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "lockOperation.credentials.Value().Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("lockOperation.credentials.Value().Value()[0].credentialType", + iter_3.GetValue().credentialType, 1U)); + VerifyOrReturn(CheckValue("lockOperation.credentials.Value().Value()[0].credentialIndex", + iter_3.GetValue().credentialIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems( + "lockOperation.credentials.Value().Value()", iter_3, 1)); + } + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 18: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperationError::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperationError.lockOperationType", value.lockOperationType, 1U)); + VerifyOrReturn(CheckValue("lockOperationError.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValue("lockOperationError.operationError", value.operationError, 1U)); + VerifyOrReturn(CheckValueNull("lockOperationError.userIndex", value.userIndex)); + VerifyOrReturn(CheckValuePresent("lockOperationError.credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("lockOperationError.credentials.Value()", value.credentials.Value())); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::LockOperationError::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lockOperationError.lockOperationType", value.lockOperationType, 0U)); + VerifyOrReturn(CheckValue("lockOperationError.operationSource", value.operationSource, 7U)); + VerifyOrReturn(CheckValue("lockOperationError.operationError", value.operationError, 1U)); + VerifyOrReturn(CheckValueNull("lockOperationError.userIndex", value.userIndex)); + VerifyOrReturn(CheckValuePresent("lockOperationError.credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("lockOperationError.credentials.Value()", value.credentials.Value())); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userCodeTemporaryDisableTime", value, 10U)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 43: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("doorLockAlarm.alarmCode", value.alarmCode, 4U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 2U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Try to unlock the door without PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Try to lock the door without a PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Try to unbolt the door without PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnboltDoor::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnboltDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Try to lock the door without a PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Create new lock/unlock user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Create new PIN credential and associate it with lock/unlock user, with userIndex != credentialIndex"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Set the WrongCodeEntryLimit to big value so that we can test incorrect PIN entry"); + ListFreer listFreer; + uint8_t value; + value = 20U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::WrongCodeEntryLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, "Try to unlock the door with invalid PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Try to unlock the door with valid PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Read the LockOperation event list"); + mTestSubStepCount = 7; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Events::LockOperation::Id, false, + chip::NullOptional); + } + case 16: { + LogStep(16, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Try to lock the door with invalid PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Read the LockOperationError event list; verify null UserIndex and Credentials"); + mTestSubStepCount = 2; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Events::LockOperationError::Id, false, + chip::NullOptional); + } + case 19: { + LogStep(19, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Try to lock the door with valid PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Set OperatingMode to NoRemoteLockUnlock"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::OperatingModeEnum value; + value = static_cast(3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::OperatingMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 23: { + LogStep(23, "Try to unlock the door when OperatingMode is NoRemoteLockUnlock"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Set OperatingMode to Normal"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::OperatingModeEnum value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::OperatingMode::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 25: { + LogStep(25, "Set the WrongCodeEntryLimit to small value so we can test lockout"); + ListFreer listFreer; + uint8_t value; + value = 3U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::WrongCodeEntryLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 26: { + LogStep(26, "Try to unlock the door with invalid PIN for the first time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Try to unlock the door with invalid PIN for the second time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Try to unlock the door with valid PIN for the third time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Lock the door back prior to next tests"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 31: { + LogStep(31, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Try to unlock the door with invalid PIN for the first time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 33: { + LogStep(33, "Try to unlock the door with invalid PIN for the second time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Try to unlock the door with valid PIN for the third time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 35: { + LogStep(35, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "Lock the door back prior to next tests"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Read the lockout timeout"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::UserCodeTemporaryDisableTime::Id, true, chip::NullOptional); + } + case 39: { + LogStep(39, "Try to unlock the door with invalid PIN for the first time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 40: { + LogStep(40, "Try to unlock the door with invalid PIN for the second time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 41: { + LogStep(41, "Try to unlock the door with invalid PIN for the third time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 42: { + LogStep(42, "Try to unlock the door with valid PIN and make sure it fails due to lockout"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Read the DoorLockAlarm event list; verify WrongEntryCodeLimit alarm has been generated"); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Events::DoorLockAlarm::Id, false, + chip::NullOptional); + } + case 44: { + LogStep(44, "Wait for the lockout to end"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 45: { + LogStep(45, "Try to unlock the door with valid PIN and make sure it succeeds"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 46: { + LogStep(46, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "Lock the door back prior to next tests"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 48: { + LogStep(48, "Create a disabled user and credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 3U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("654321garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(3); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 49: { + LogStep(49, "Try to unlock the door with disabled user PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("654321garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 51: { + LogStep(51, "Unlock the door with enabled user PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 52: { + LogStep(52, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 53: { + LogStep(53, "Try to lock the door with disabled user PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("654321garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 54: { + LogStep(54, "Verify that lock state attribute value stays Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 55: { + LogStep(55, "Lock the door with enabled user PIN"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 56: { + LogStep(56, "Verify that lock state attribute value is set to Locked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 57: { + LogStep(57, "Clean all the users and credentials"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 65534U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class DL_SchedulesSuite : public TestCommand +{ +public: + DL_SchedulesSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("DL_Schedules", 127, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~DL_SchedulesSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t NumberOfTotalUsersSupported; + uint8_t NumberOfWeekDaySchedulesSupportedPerUser; + uint8_t NumberOfYearDaySchedulesSupportedPerUser; + uint8_t NumberOfHolidaySchedulesSupported; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfTotalUsersSupported", value, 10U)); + NumberOfTotalUsersSupported = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfWeekDaySchedulesSupportedPerUser", value, 10U)); + NumberOfWeekDaySchedulesSupportedPerUser = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfYearDaySchedulesSupportedPerUser", value, 10U)); + NumberOfYearDaySchedulesSupportedPerUser = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfHolidaySchedulesSupported", value, 10U)); + NumberOfHolidaySchedulesSupported = value; + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 0U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, + static_cast(NumberOfWeekDaySchedulesSupportedPerUser + 1))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 0U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, static_cast(NumberOfTotalUsersSupported + 1))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 0U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, + static_cast(NumberOfYearDaySchedulesSupportedPerUser + 1))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 0U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, static_cast(NumberOfTotalUsersSupported + 1))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 0U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckValue("holidayIndex", value.holidayIndex, static_cast(NumberOfHolidaySchedulesSupported + 1))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 15U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 16U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 18U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 0U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 15U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 16U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 18U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 0U)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 15U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 16U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 18U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 0U)); + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 15U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 16U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 18U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 0U)); + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + } + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 2U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 2U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 23U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 59U)); + } + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 9000UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 888888888UL)); + } + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 123456UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 1234567UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 1U)); + } + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 2U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + } + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 9000UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 888888888UL)); + } + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 123456UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 1234567UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 1U)); + } + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 2U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 23U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 59U)); + } + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 23U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 59U)); + } + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 4U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 9000UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 888888888UL)); + } + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 4U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 64U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 23U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 23U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 59U)); + } + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 55555UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 7777777UL)); + } + break; + case 102: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 103: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 104: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 4U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 105: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 4U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 106: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); + } + break; + case 107: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 108: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 123456UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 1234567UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 1U)); + } + break; + case 109: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 110: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, NumberOfHolidaySchedulesSupported)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 1UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 100UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 4U)); + } + break; + case 111: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 112: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 113: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 114: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 115: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 12345UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 12345689UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 116: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 117: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, NumberOfHolidaySchedulesSupported)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 1UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 100UL)); + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 4U)); + } + break; + case 118: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 23U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 59U)); + } + break; + case 119: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 9000UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 888888888UL)); + } + break; + case 120: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 121: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 122: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 2U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 123: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, NumberOfHolidaySchedulesSupported)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 124: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 0U)); + VerifyOrReturn(CheckValuePresent("endHour", value.endHour)); + VerifyOrReturn(CheckValue("endHour.Value()", value.endHour.Value(), 23U)); + VerifyOrReturn(CheckValuePresent("endMinute", value.endMinute)); + VerifyOrReturn(CheckValue("endMinute.Value()", value.endMinute.Value(), 59U)); + } + break; + case 125: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 9000UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 888888888UL)); + } + break; + case 126: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Create new PIN credential and schedule user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Get number of supported users"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Get Max number of Week Day schedules for user and verify default value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Get Max number of Year Day schedules for user and verify default value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Get Max number of Holiday schedules and verify default value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfHolidaySchedulesSupported::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Create Week Day schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 0U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Create Week Day schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = static_cast(NumberOfWeekDaySchedulesSupportedPerUser + 1); + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Create Week Day schedule with 0 user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 0U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Create Week Day schedule with out-of-bounds user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Create Week Day schedule for non-existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 2U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Create Week Day schedule with 0 days mask"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(0U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Create Week Day schedule for Sunday and Monday"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(3U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Create Week Day schedule for Sunday Wednesday and Saturday"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(73U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Create Week Day schedule with invalid start hour"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 24U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Create Week Day schedule with invalid start minute"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 60U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Create Week Day schedule with invalid end hour"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 24U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Create Week Day schedule with invalid end minute"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 60U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Create Week Day schedule with start hour later that end hour"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 19U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Create Week Day schedule with start minute later that end minute when hours are equal"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 50U; + value.endHour = 15U; + value.endMinute = 49U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Make sure that previous operations did not create a schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Get Week Day schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 0U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Get Week Day schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = static_cast(NumberOfWeekDaySchedulesSupportedPerUser + 1); + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Get Week Day schedule with 0 user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Get Week Day schedule with out-of-bounds user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Get Week Day schedule with non-existing user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Create Year Day schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 0U; + value.userIndex = 1U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Create Year Day schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = static_cast(NumberOfYearDaySchedulesSupportedPerUser + 1); + value.userIndex = 1U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Create Year Day schedule with 0 user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 0U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Create Year Day schedule with out-of-bounds user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Create Year Day schedule for non-existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 2U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 31: { + LogStep(31, "Create Year Day schedule with start hour later that end hour"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + value.localStartTime = 12345689UL; + value.localEndTime = 12345688UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 32: { + LogStep(32, "Make sure that previous operations did not create a schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 33: { + LogStep(33, "Get Year Day schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 0U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 34: { + LogStep(34, "Get Year Day schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = static_cast(NumberOfYearDaySchedulesSupportedPerUser + 1); + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 35: { + LogStep(35, "Get Year Day schedule with 0 user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 36: { + LogStep(36, "Get Year Day schedule with out-of-bounds user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Get Year Day schedule with non-existing user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 38: { + LogStep(38, "Create Holiday schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 0U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + value.operatingMode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Create Holiday schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = static_cast(NumberOfHolidaySchedulesSupported + 1); + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + value.operatingMode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 40: { + LogStep(40, "Create Holiday schedule with start hour later that end hour"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 12345689UL; + value.localEndTime = 12345688UL; + value.operatingMode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 41: { + LogStep(41, "Create Holiday schedule with invalid operating mode"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + value.operatingMode = static_cast(5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 42: { + LogStep(42, "Make sure that previous operations did not create a schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Get Holiday schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 44: { + LogStep(44, "Get Holiday schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = static_cast(NumberOfHolidaySchedulesSupported + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 45: { + LogStep(45, "Create Holiday schedule with valid parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + value.operatingMode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 46: { + LogStep(46, "Verify created schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 47: { + LogStep(47, "Create Week Day schedule with valid parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 15U; + value.startMinute = 16U; + value.endHour = 18U; + value.endMinute = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 48: { + LogStep(48, "Verify created schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 49: { + LogStep(49, "Create Year Day schedule with valid parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + value.localStartTime = 12345UL; + value.localEndTime = 12345689UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Verify created schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 51: { + LogStep(51, "Clear Week Day schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 0U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 52: { + LogStep(52, "Clear Week Day schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = static_cast(NumberOfWeekDaySchedulesSupportedPerUser + 1); + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 53: { + LogStep(53, "Clear Week Day schedule with 0 user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 54: { + LogStep(54, "Clear Week Day schedule with out-of-bounds user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 55: { + LogStep(55, "Clear Week Day schedule with non-existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 56: { + LogStep(56, "Make sure that week day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 57: { + LogStep(57, "Make sure that year day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 58: { + LogStep(58, "Make sure that holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 59: { + LogStep(59, "Clear Year Day schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 0U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 60: { + LogStep(60, "Clear Year Day schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = static_cast(NumberOfYearDaySchedulesSupportedPerUser + 1); + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 61: { + LogStep(61, "Clear Year Day schedule with 0 user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 62: { + LogStep(62, "Clear Year Day schedule with out-of-bounds user index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 63: { + LogStep(63, "Clear Year Day schedule with non-existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 64: { + LogStep(64, "Make sure that week day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 65: { + LogStep(65, "Make sure that year day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 66: { + LogStep(66, "Make sure that holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 67: { + LogStep(67, "Clear Holiday schedule with 0 index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type value; + value.holidayIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 68: { + LogStep(68, "Clear Holiday schedule with out-of-bounds index"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type value; + value.holidayIndex = static_cast(NumberOfYearDaySchedulesSupportedPerUser + 1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 69: { + LogStep(69, "Make sure that week day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 70: { + LogStep(70, "Make sure that year day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 71: { + LogStep(71, "Make sure that holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 72: { + LogStep(72, "Create another Week Day schedule with valid parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 2U; + value.userIndex = 1U; + value.daysMask = static_cast>(2U); + value.startHour = 0U; + value.startMinute = 0U; + value.endHour = 23U; + value.endMinute = 59U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 73: { + LogStep(73, "Verify created week day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 2U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 74: { + LogStep(74, "Create another Year Day schedule with valid parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 2U; + value.userIndex = 1U; + value.localStartTime = 9000UL; + value.localEndTime = 888888888UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 75: { + LogStep(75, "Verify created year day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 2U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 76: { + LogStep(76, "Create another Holiday schedule with valid parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 2U; + value.localStartTime = 123456UL; + value.localEndTime = 1234567UL; + value.operatingMode = static_cast(1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 77: { + LogStep(77, "Verify created holiday schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 78: { + LogStep(78, "Clear a single week day schedule for the first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 79: { + LogStep(79, "Verify cleared week day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 80: { + LogStep(80, "Clear all remaining week day schedules for the first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 254U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 81: { + LogStep(81, "Verify cleared week schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 2U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 82: { + LogStep(82, "Make sure that first year day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 83: { + LogStep(83, "Make sure that second year day schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 2U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 84: { + LogStep(84, "Make sure that first holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 85: { + LogStep(85, "Make sure that second holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 86: { + LogStep(86, "Create another Week Day schedule with valid parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(2U); + value.startHour = 0U; + value.startMinute = 0U; + value.endHour = 23U; + value.endMinute = 59U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 87: { + LogStep(87, "Clear a single year day schedule for the first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 88: { + LogStep(88, "Verify cleared year day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 89: { + LogStep(89, "Clear all remaining year schedules for the first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 254U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 90: { + LogStep(90, "Verify that second year day schedule was cleared"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 2U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 91: { + LogStep(91, "Verify created week day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 92: { + LogStep(92, "Clear all remaining week day schedules for the first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 254U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 93: { + LogStep(93, "Create new user without credential so we can add more schedules to it"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 2U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 94: { + LogStep(94, "Create Week Day schedule with valid parameters for first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 0U; + value.startMinute = 0U; + value.endHour = 23U; + value.endMinute = 59U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 95: { + LogStep(95, "Verify created week day schedule for first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 96: { + LogStep(96, "Create Year Day schedule for first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 4U; + value.userIndex = 1U; + value.localStartTime = 9000UL; + value.localEndTime = 888888888UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 97: { + LogStep(97, "Verify created year day schedule for first"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 4U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 98: { + LogStep(98, "Create Week Day schedule with valid parameters for second user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 4U; + value.userIndex = 2U; + value.daysMask = static_cast>(64U); + value.startHour = 23U; + value.startMinute = 0U; + value.endHour = 23U; + value.endMinute = 59U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 99: { + LogStep(99, "Verify created week day schedule for first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 4U; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 100: { + LogStep(100, "Create Year Day schedule for second user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + value.localStartTime = 55555UL; + value.localEndTime = 7777777UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 101: { + LogStep(101, "Verify created year day schedule for first"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 102: { + LogStep(102, "Cleanup the user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 65534U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 103: { + LogStep(103, "Make sure clearing first user also cleared week day schedules"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 104: { + LogStep(104, "Make sure clearing first user also cleared year day schedules"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 4U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 105: { + LogStep(105, "Make sure clearing second user also cleared week day schedules"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 4U; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 106: { + LogStep(106, "Make sure clearing second user also cleared year day schedules"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 107: { + LogStep(107, "Make sure that first holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 108: { + LogStep(108, "Make sure that second holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 109: { + LogStep(109, "Create another Holiday schedule at the last slot"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = NumberOfHolidaySchedulesSupported; + value.localStartTime = 1UL; + value.localEndTime = 100UL; + value.operatingMode = static_cast(4); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 110: { + LogStep(110, "Verify Created Holiday Schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = NumberOfHolidaySchedulesSupported; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 111: { + LogStep(111, "Create new PIN credential and schedule user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 112: { + LogStep(112, "Create Week Day schedule for first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(1U); + value.startHour = 0U; + value.startMinute = 0U; + value.endHour = 23U; + value.endMinute = 59U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 113: { + LogStep(113, "Create Year Day schedule for first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + value.localStartTime = 9000UL; + value.localEndTime = 888888888UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 114: { + LogStep(114, "Clear a single holiday schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type value; + value.holidayIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 115: { + LogStep(115, "Make sure that first holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 116: { + LogStep(116, "Make sure that second holiday schedule was deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 117: { + LogStep(117, "Make sure that third holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = NumberOfHolidaySchedulesSupported; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 118: { + LogStep(118, "Make sure clearing holiday schedule did not clear week day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 119: { + LogStep(119, "Make sure clearing holiday schedule did not clear year day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 120: { + LogStep(120, "Clear all remaining holiday schedules"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type value; + value.holidayIndex = 254U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 121: { + LogStep(121, "Make sure that first holiday is still deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 122: { + LogStep(122, "Make sure that second holiday schedule was deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 123: { + LogStep(123, "Make sure that third holiday schedule was not deleted"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = NumberOfHolidaySchedulesSupported; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 124: { + LogStep(124, "Make sure clearing holiday schedule did not clear week day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 125: { + LogStep(125, "Make sure clearing holiday schedule did not clear year day schedule"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 126: { + LogStep(126, "Final Cleanup"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 65534U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_1_1Suite : public TestCommand +{ +public: + Test_TC_DRLK_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_1_1", 49, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 7U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 64UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 128UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 256UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1024UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2048UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4096UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 37UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 38UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 37UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 38UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 24UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 25UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 21UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 22UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 48UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 49UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 51UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 33UL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 34UL)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 35UL)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 36UL)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 39UL)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 40UL)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 42UL)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 43UL)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 44UL)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 39UL)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 29UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 34UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 36UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 38UL)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 35UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 37UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip(" !DRLK.S.F00 && !DRLK.S.F01 && !DRLK.S.F02 && !DRLK.S.F04 && !DRLK.S.F05 && !DRLK.S.F06 && " + "!DRLK.S.F07 && !DRLK.S.F08 && !DRLK.S.F0a && !DRLK.S.F0b && !DRLK.S.F0c "), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given DRLK.S.F00(PIN) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given DRLK.S.F01(RID) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given DRLK.S.F02(FGP) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 3e: Given DRLK.S.F04(WDSCH) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 3f: Given DRLK.S.F05(DPS) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 3g: Given DRLK.S.F06(FACE) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F06"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3h: Given DRLK.S.F07(COTA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F07"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 3i: Given DRLK.S.F08(USR) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 3j: Given DRLK.S.F0a(YDSCH) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 3k: Given DRLK.S.F0b(HDSCH) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 3l: Given DRLK.S.F0c(UBOLT) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Step 4a: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 4b: TH reads Feature dependent(DRLK.S.F05) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Step 4c: TH reads Feature dependent(DRLK.S.F08) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "Step 4d: TH reads Feature dependent(DRLK.S.F00) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Step 4e: TH reads Feature dependent(DRLK.S.F01) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "Step 4f: TH reads Feature dependent(DRLK.S.F04) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Step 4g: TH reads Feature dependent(DRLK.S.F0a) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Step 4h: TH reads Feature dependent(DRLK.S.F0b) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Step 4i: TH reads Feature dependent(DRLK.S.F00 or DRLK.S.F01) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00 || DRLK.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Step 4j: TH reads Feature dependent(DRLK.S.F07 or DRLK.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F07 || DRLK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Step 4k: TH reads optional attribute(Language) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Step 4l: TH reads optional attribute(LEDSettings) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4m: TH reads optional attribute(AutoRelockTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4n: TH reads optional attribute(SoundVolume) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "Step 4o: TH reads optional attribute(DefaultConfigurationRegister) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0027"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Step 4p: TH reads optional attribute(EnableLocalProgramming) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0028"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, "Step 4q: TH reads optional attribute(EnableOneTouchLocking) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Step 4r: TH reads optional attribute(EnableInsideStatusLED) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A002a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, "Step 4s: TH reads optional attribute(EnablePrivacyModeButton) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A002b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "Step 4t: TH reads optional attribute(LocalProgrammingFeatures) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A002c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Step 5a: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "Step 5b: TH reads optional event(Door position sensor) in EventList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F05 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 37: { + LogStep(37, "Step 5c: TH reads optional event(User commands and database) in EventList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Step 6a: TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 39: { + LogStep(39, "Step 6b: TH reads Feature dependent commands(DRLK.S.F04) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 40: { + LogStep(40, "Step 6c: TH reads Feature dependent commands(DRLK.S.F0a) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "Step 6d: TH reads Feature dependent commands(DRLK.S.F0b) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "Step 6e: TH reads Feature dependent commands(DRLK.S.F0c) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 43: { + LogStep(43, "Step 6f: TH reads Feature dependent commands(DRLK.S.F08) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Step 6g: TH reads optional commands(DRLK.S.C03.Rsp) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 45: { + LogStep(45, "Step 7a: TH reads Feature dependent command(DRLK.S.F04) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Step 7b: TH reads Feature dependent command(DRLK.S.F0a) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "Step 7c: TH reads Feature dependent command(DRLK.S.F0b) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 48: { + LogStep(48, "Step 7d: TH reads Feature dependent command(DRLK.S.F08) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_2_4Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_4", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Create new user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(1000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Create new PIN credential and lock/unlock user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(1000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify created PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 1a: TH writes AutoRelockTime attribute value as 10 seconds on the DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0023.Write && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 10UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 1b: TH writes AutoRelockTime attribute value as 60 seconds on the DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0023.Write && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 60UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 1c: TH writes AutoRelockTime attribute value as 10 seconds on the DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY && !DRLK.S.A0023.Write"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 10UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 1d: TH writes AutoRelockTime attribute value as 60 seconds on the DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && !DRLK.S.A0023.Write"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 60UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 2a: TH sends the Unlock with Timeout argument value as 10 seconds"); + VerifyOrDo(!ShouldSkip("DRLK.S.C03.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Type value; + value.timeout = 10U; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockWithTimeout::Id, value, + chip::Optional(1000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 2b: TH sends the Unlock with Timeout argument value as 60 seconds"); + VerifyOrDo(!ShouldSkip("DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Type value; + value.timeout = 60U; + value.PINCode.Emplace(); + value.PINCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockWithTimeout::Id, value, + chip::Optional(1000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Wait for AutoRelockTime Expires"); + VerifyOrDo(!ShouldSkip("DRLK.S.C03.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 11000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Wait for AutoRelockTime Expires"); + VerifyOrDo(!ShouldSkip("DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 70000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 2c: TH reads LockState attribute"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0000 && DRLK.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(1000), chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Clean the created credential"); + VerifyOrDo(!ShouldSkip("DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(1); + value.credential.Value().credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(1000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_2_5Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_5", 12, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t NumberOfWeekDaySchedulesSupportedPerUser; + uint16_t NumberOfTotalUsersSupported; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + NumberOfWeekDaySchedulesSupportedPerUser = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + NumberOfTotalUsersSupported = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 2U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 15U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 45U)); + VerifyOrReturn(CheckConstraintHasValue("value.endHour", value.endHour, true)); + VerifyOrReturn(CheckConstraintMinValue("value.endHour.Value()", value.endHour.Value(), 16U)); + VerifyOrReturn(CheckConstraintHasValue("value.endMinute", value.endMinute, true)); + VerifyOrReturn(CheckConstraintMinValue("value.endMinute.Value()", value.endMinute.Value(), 55U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 0U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckConstraintHasValue("value.daysMask", value.daysMask, false)); + VerifyOrReturn(CheckConstraintHasValue("value.startHour", value.startHour, false)); + VerifyOrReturn(CheckConstraintHasValue("value.startMinute", value.startMinute, false)); + VerifyOrReturn(CheckConstraintHasValue("value.endHour", value.endHour, false)); + VerifyOrReturn(CheckConstraintHasValue("value.endMinute", value.endMinute, false)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckConstraintHasValue("value.daysMask", value.daysMask, false)); + VerifyOrReturn(CheckConstraintHasValue("value.startHour", value.startHour, false)); + VerifyOrReturn(CheckConstraintHasValue("value.startMinute", value.startMinute, false)); + VerifyOrReturn(CheckConstraintHasValue("value.endHour", value.endHour, false)); + VerifyOrReturn(CheckConstraintHasValue("value.endMinute", value.endMinute, false)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Create new user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Precondition: Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1: TH reads NumberOfWeekDay SchedulesSupportedPerUser attribute"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2: TH reads NumberOfTotalUsers Supported attribute"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3: TH send Set Week Day Schedule Command"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + value.daysMask = static_cast>(2U); + value.startHour = 15U; + value.startMinute = 45U; + value.endHour = 16U; + value.endMinute = 55U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 4: TH send Get Week Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 5: TH send Set Week Day Schedule Command"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 0U; + value.userIndex = 1U; + value.daysMask = static_cast>(7U); + value.startHour = 15U; + value.startMinute = 45U; + value.endHour = 16U; + value.endMinute = 55U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 6: TH send Get Week Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 0U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 7: TH sends Clear Week Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0d.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 8: TH sends Get Week Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_2_6Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_6", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t NumberOfHolidaySchedulesSupported; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + NumberOfHolidaySchedulesSupported = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 20UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 30UL)); + if (value.localEndTime.HasValue()) + { + VerifyOrReturn(CheckConstraintMinValue("value.localEndTime.Value()", value.localEndTime.Value(), 21UL)); + } + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 15U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 10U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for commissionee"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads NumberOfHoliday SchedulesSupported and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfHolidaySchedulesSupported::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 2: Create Holiday schedule with 1 index"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C11.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 20UL; + value.localEndTime = 30UL; + value.operatingMode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3a: Get Holiday Schedule with HolidayIndex as 1"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 4: Create Holiday schedule with invalid operating mode"); + VerifyOrDo(!ShouldSkip("DRLK.S.C11.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 20UL; + value.localEndTime = 30UL; + value.operatingMode = static_cast(5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 5: Get Holiday Schedule with Invalid HolidayIndex 15."); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 15U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 6: Get Holiday Schedule with the Non-scheduled HolidayIndex"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 10U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 7: Clear Holiday schedule with 1 index"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C13.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 8: Make sure that holiday schedule was deleted"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_2_7Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_7", 19, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t NumberOfYearDaySchedulesSupportedPerUser; + uint16_t NumberOfTotalUsersSupported; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + NumberOfYearDaySchedulesSupportedPerUser = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + NumberOfTotalUsersSupported = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 960UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 1980UL)); + if (value.localEndTime.HasValue()) + { + VerifyOrReturn(CheckConstraintMinValue("value.localEndTime.Value()", value.localEndTime.Value(), 961UL)); + } + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 0U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 15U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckConstraintHasValue("value.localStartTime", value.localStartTime, false)); + VerifyOrReturn(CheckConstraintHasValue("value.localEndTime", value.localEndTime, false)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, NumberOfYearDaySchedulesSupportedPerUser)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 5U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckConstraintHasValue("value.localStartTime", value.localStartTime, false)); + VerifyOrReturn(CheckConstraintHasValue("value.localEndTime", value.localEndTime, false)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckConstraintHasValue("value.localStartTime", value.localStartTime, false)); + VerifyOrReturn(CheckConstraintHasValue("value.localEndTime", value.localEndTime, false)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 1080UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 2100UL)); + if (value.localEndTime.HasValue()) + { + VerifyOrReturn(CheckConstraintMinValue("value.localEndTime.Value()", value.localEndTime.Value(), 1081UL)); + } + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Create new user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Precondition: Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1: TH reads NumberOfYearDay SchedulesSupportedPerUser attribute"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2: TH reads NumberOfTotalUsers Supported attribute"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3: TH sends Set Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C0e.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + value.localStartTime = 960UL; + value.localEndTime = 1980UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 4a & 4b: TH sends Get Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 5: TH send Set Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.C0e.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 0U; + value.userIndex = 15U; + value.localStartTime = 1020UL; + value.localEndTime = 2040UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 6: TH sends Get Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 0U; + value.userIndex = 15U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 7a: Create a user with userIndex as 5"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 5U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 7b: TH sends Get Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = NumberOfYearDaySchedulesSupportedPerUser; + value.userIndex = 5U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Step 8: TH sends Clear Year Day Schedule to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 9: TH sends Get Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx && DRLK.S.C10.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Step 10: TH sends Set Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.C0e.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + value.localStartTime = 1080UL; + value.localEndTime = 2100UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Step 11: TH sends Get Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Step 12: TH sends Clear Year Day Schedule to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 0U; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Clear a year day schedule for the first user"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0a && DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Cleanup the created user with UserIndex 1"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Cleanup the created user with UserIndex 5"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 5U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_2_8Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_8", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t Current_NumberOfTotalUsersSupported; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + Current_NumberOfTotalUsersSupported = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), 3)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNonNull("nextUserIndex", value.nextUserIndex)); + VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValueNull("userName", value.userName)); + VerifyOrReturn(CheckValueNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValueNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValueNull("userType", value.userType)); + VerifyOrReturn(CheckValueNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1: TH reads NumberOfTotalUsers Supported attribute and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, + "Step 2: TH sends Set User Command to DUT with the following values: OperationType as 0 UserIndex as 1 " + "UserName as xxx UserUniqueID as 6452 UserStatus as 1 UserType as 0 CredentialRule as 0"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 3: TH sends Get User Command to DUT with UserIndex as 1"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1b.Rsp && DRLK.S.C1c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, + "Step 4: TH sends Set User Command to DUT with the following values: OperationType as 0 UserIndex as 2 " + "UserName as xxx UserUniqueID as 6452 UserStatus as 1 UserType as 10 (Invalid value) CredentialRule as 3"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 2U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(10); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(3); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, + "Step 5: TH sends Set User Command to DUT with the following values: OperationType as 0 UserIndex as 1 (Same " + "as step 2) UserName as xxx UserUniqueID as 8965 UserStatus as 1 UserType as 0 CredentialRule as 0"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 8965UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, + "Step 6a: TH sends Set User Command to DUT with the following values: OperationType as 0 UserIndex as 2 " + "UserName as NULL UserUniqueID as NULL UserStatus as NULL UserType as NULL CredentialRule as NULL"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 2U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 6b: TH sends Get User Command to DUT with UserIndex as 2"); + VerifyOrDo(!ShouldSkip("DRLK.S.C1a.Rsp && DRLK.S.C1b.Rsp && DRLK.S.C1c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, + "Step 7: TH sends Set User Command to DUT with the following values: OperationType as 2 UserIndex as 2 " + "UserName as NULL UserUniqueID as NULL UserStatus as NULL UserType as NULL CredentialRule as NULL"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(2); + value.userIndex = 2U; + value.userName.SetNull(); + value.userUniqueID.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + value.credentialRule.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 8: TH sends Get User Command to DUT with the UserIndex as 2"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1b.Rsp && DRLK.S.C1c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 9: TH sends Clear User Command to DUT with the UserIndex as 1"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1d.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Step 10: TH sends Get User Command to DUT with the UserIndex as 1"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1b.Rsp && DRLK.S.C1c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Test cleanup: TH sends Clear User Command to DUT with the UserIndex as 2"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1d.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Test cleanup: TH sends Get User Command to DUT with the UserIndex as 2"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C1b.Rsp && DRLK.S.C1c.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_2_11Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_11", 23, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("PINCredentialData", &mPINCredentialData); + AddArgument("RFIDCredentialData", &mRFIDCredentialData); + AddArgument("FingerVeinCredentialData", &mFingerVeinCredentialData); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mPINCredentialData; + chip::Optional mRFIDCredentialData; + chip::Optional mFingerVeinCredentialData; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueID", value.userUniqueID)); + VerifyOrReturn(CheckValue("userUniqueID.Value()", value.userUniqueID.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckConstraintType("value.credentialExists", "boolean", "boolean")); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckConstraintType("value.credentialExists", "boolean", "boolean")); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckConstraintType("value.credentialExists", "boolean", "boolean")); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckConstraintType("value.credentialExists", "boolean", "boolean")); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckConstraintType("value.credentialExists", "boolean", "boolean")); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckConstraintType("value.credentialExists", "boolean", "boolean")); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Create new user with default parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueID.SetNonNull(); + value.userUniqueID.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Precondition: Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Step 1a: TH reads NumberOfTotalUsersSupported and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 1b: TH reads MinPINCodeLength and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::MinPINCodeLength::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 1c: TH reads MaxPINCodeLength and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::MaxPINCodeLength::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 1d: TH reads MinRFIDCodeLength and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F01 && DRLK.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::MinRFIDCodeLength::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 1e: TH reads MaxRFIDCodeLength and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F01 && DRLK.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::MaxRFIDCodeLength::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2a: TH sends Set Credential Command to DUT with type PIN"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00 && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = mPINCredentialData.HasValue() ? mPINCredentialData.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("123456"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 2b: TH sends Set Credential Command to DUT with type RFID"); + VerifyOrDo(!ShouldSkip("DRLK.S.F01 && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + value.credentialData = mRFIDCredentialData.HasValue() ? mRFIDCredentialData.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("123456789A"), 10); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 2c: TH sends Set Credential Command to DUT with type FingerVein"); + VerifyOrDo(!ShouldSkip("DRLK.S.F02 && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(4); + value.credential.credentialIndex = 1U; + + value.credentialData = mFingerVeinCredentialData.HasValue() + ? mFingerVeinCredentialData.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("123456789A"), 10); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Step 3a: TH sends Get Credential Status Command with type PIN"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00 && DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 3b: TH sends Get Credential Status Command with type RFID"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F01 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Step 3c: TH sends Get Credential Status Command with type FingerVein"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F02 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(4); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Step 4a: TH sends Clear Credential Command to DUT with type PIN"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00 && DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(1); + value.credential.Value().credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Step 4b: TH sends Get Credential Status Command with type RFID"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F01 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Step 4c: TH sends Get Credential Status Command with type FingerVein"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F02 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(4); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Step 4d: TH sends Clear Credential Command to DUT with type RFID"); + VerifyOrDo(!ShouldSkip("DRLK.S.F01 && DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(2); + value.credential.Value().credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Step 4e: TH sends Get Credential Status Command with type FingerVein"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.F02 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(4); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Step 4f: TH sends Clear Credential Command to DUT with type FingerVein"); + VerifyOrDo(!ShouldSkip("DRLK.S.F02 && DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(4); + value.credential.Value().credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Step 5a: TH sends Get Credential Status Command to DUT with type PIN"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00 && DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Step 5b: TH sends Get Credential Status Command to DUT with type RFID"); + VerifyOrDo(!ShouldSkip("DRLK.S.F01 && DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Step 5c: TH sends Get Credential Status Command to DUT with type FingerVein"); + VerifyOrDo(!ShouldSkip("DRLK.S.F02 && DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(4); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestGroupMessagingSuite : public TestCommand +{ +public: + TestGroupMessagingSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestGroupMessaging", 41, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestGroupMessagingSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mNodeId2; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("xyzzy", 5))); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("xyzzy", 5))); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "KeySet Write 1"); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 417U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1110000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 1110001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1110002ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "KeySet Write 2"); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 418U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 2220000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 2220001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 2220002ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Write Group Keys"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].groupId = 257U; + listHolder_0->mList[0].groupKeySetID = 417U; + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].groupId = 258U; + listHolder_0->mList[1].groupKeySetID = 418U; + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Add Group 1 (endpoint 1)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 257U; + value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Add Group 2 (endpoint 0)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 258U; + value.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(0), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Install ACLs"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(4); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Read initial Attribute value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Group Write Attribute"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("xyzzygarbage: not in length on purpose", 5); + return WriteGroupAttribute(kIdentityAlpha, 258, BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional); + } + case 9: { + LogStep(9, "Wait for write 1"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Read back Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "Restore initial Attribute value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteGroupAttribute(kIdentityAlpha, 258, BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional); + } + case 12: { + LogStep(12, "Wait for write 2"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Read back Attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Check on/off attribute value is false for endpoint 1"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Turn On the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 16: { + LogStep(16, "Wait for command 3"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Check on/off attribute value is true after on command for endpoint 1"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Turn off the light to get ready for the next test"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Cleanup ACLs"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 20: { + LogStep(20, "Open Commissioning Window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Commission from gamma"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 1126240820ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + case 22: { + LogStep(22, "Wait for the commissioned device to be retrieved for gamma"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 1126240820ULL; + return WaitForCommissionee(kIdentityGamma, value); + } + case 23: { + LogStep(23, "KeySet Write 1 for gamma"); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 417U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1110000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 1110001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1110002ULL; + + return SendCommand(kIdentityGamma, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, "KeySet Write 2 for gamma"); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 418U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 2220000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 2220001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 2220002ULL; + + return SendCommand(kIdentityGamma, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Write Group Keys for gamma"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].groupId = 257U; + listHolder_0->mList[0].groupKeySetID = 417U; + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].groupId = 258U; + listHolder_0->mList[1].groupKeySetID = 418U; + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityGamma, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); + } + case 26: { + LogStep(26, "Add Group 1 (endpoint 1) for gamma"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 257U; + value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); + return SendCommand(kIdentityGamma, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 27: { + LogStep(27, "Add Group 2 (endpoint 0) for gamma"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 258U; + value.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); + return SendCommand(kIdentityGamma, GetEndpoint(0), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Install ACLs for gamma"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + listHolder_0->mList[1].privilege = + static_cast(4); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNull(); + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityGamma, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 29: { + LogStep(29, "Read initial Attribute value for gamma"); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 30: { + LogStep(30, "Group Write Attribute for gamma"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("xyzzygarbage: not in length on purpose", 5); + return WriteGroupAttribute(kIdentityGamma, 258, BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional); + } + case 31: { + LogStep(31, "Wait for write 1 for gamma"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityGamma, value); + } + case 32: { + LogStep(32, "Read back Attribute for gamma"); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, "Restore initial Attribute value for gamma"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteGroupAttribute(kIdentityGamma, 258, BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional); + } + case 34: { + LogStep(34, "Wait for write 2 for gamma"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityGamma, value); + } + case 35: { + LogStep(35, "Read back Attribute for gamma"); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 36: { + LogStep(36, "Check on/off attribute value is false for endpoint 1 for gamma"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 37: { + LogStep(37, "Turn On the light to see attribute change for gamma"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityGamma, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 38: { + LogStep(38, "Wait for command 3 for gamma"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityGamma, value); + } + case 39: { + LogStep(39, "Check on/off attribute value is true after on command for endpoint 1 for gamma"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 40: { + LogStep(40, "Cleanup ACLs for gamma"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityGamma, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestGroupsClusterSuite : public TestCommand +{ +public: + TestGroupsClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestGroupsCluster", 27, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestGroupsClusterSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 135U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 126U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("Group #1", 8))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("capacity", value.capacity)); + { + auto iter_0 = value.groupList.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupList", iter_0, 0)); + VerifyOrReturn(CheckValue("groupList[0]", iter_0.GetValue(), 257U)); + VerifyOrReturn(CheckNoMoreListItems("groupList", iter_0, 1)); + } + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("Group #2", 8))); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 32767U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("Group #1", 8))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("Group #2", 8))); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("capacity", value.capacity)); + { + auto iter_0 = value.groupList.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupList", iter_0, 0)); + VerifyOrReturn(CheckValue("groupList[0]", iter_0.GetValue(), 258U)); + VerifyOrReturn(CheckNoMoreListItems("groupList", iter_0, 1)); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 135U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 0U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 260U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("Group #1", 8))); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("capacity", value.capacity)); + { + auto iter_0 = value.groupList.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupList", iter_0, 0)); + VerifyOrReturn(CheckValue("groupList[0]", iter_0.GetValue(), 257U)); + VerifyOrReturn(CheckNoMoreListItems("groupList", iter_0, 1)); + } + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 32767U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("capacity", value.capacity)); + { + auto iter_0 = value.groupList.begin(); + VerifyOrReturn(CheckNoMoreListItems("groupList", iter_0, 0)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "View Group 0 (invalid)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "View First Group (not found)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 257U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Add First Group (no keys)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 257U; + value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Add KeySet"); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 417U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1110000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 1110001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1110002ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Write Group Keys"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].groupId = 257U; + listHolder_0->mList[0].groupKeySetID = 417U; + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].groupId = 258U; + listHolder_0->mList[1].groupKeySetID = 417U; + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "Add First Group (new)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 257U; + value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 7: { + LogStep(7, "View First Group (new)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 257U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "View Second Group (not found)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 258U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Get Group Membership 1 (all)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type value; + + value.groupList = chip::app::DataModel::List(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::GetGroupMembership::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Add Second Group (new)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 258U; + value.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "View Second Group (new)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 258U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "View Group 3 (not found)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 32767U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 13: { + LogStep(13, "View First Group (existing)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 257U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "View Second Group (existing)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 258U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Get Group Membership 2"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type value; + + { + auto * listHolder_0 = new ListHolder(3); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 258U; + listHolder_0->mList[1] = 259U; + listHolder_0->mList[2] = 32767U; + value.groupList = chip::app::DataModel::List(listHolder_0->mList, 3); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::GetGroupMembership::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Remove Group 0 (invalid)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::RemoveGroup::Type value; + value.groupID = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveGroup::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Remove Group 4 (not found)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::RemoveGroup::Type value; + value.groupID = 260U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveGroup::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Remove Second Group (existing)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::RemoveGroup::Type value; + value.groupID = 258U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveGroup::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "View First Group (not removed)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 257U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "View Second Group (removed)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 258U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Get Group Membership 3"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 1U; + listHolder_0->mList[1] = 257U; + listHolder_0->mList[2] = 258U; + listHolder_0->mList[3] = 3U; + value.groupList = chip::app::DataModel::List(listHolder_0->mList, 4); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::GetGroupMembership::Id, value, + chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Remove All"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveAllGroups::Id, value, + chip::NullOptional + + ); + } + case 23: { + LogStep(23, "View First Group (removed)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 257U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "View Second Group (still removed)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 258U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 25: { + LogStep(25, "View Group 3 (removed)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::ViewGroup::Type value; + value.groupID = 32767U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Get Group Membership 4"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type value; + + { + auto * listHolder_0 = new ListHolder(5); + listFreer.add(listHolder_0); + listHolder_0->mList[0] = 1U; + listHolder_0->mList[1] = 257U; + listHolder_0->mList[2] = 258U; + listHolder_0->mList[3] = 3U; + listHolder_0->mList[4] = 32767U; + value.groupList = chip::app::DataModel::List(listHolder_0->mList, 5); + } + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::GetGroupMembership::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_G_1_1Suite : public TestCommand +{ +public: + Test_TC_G_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_G_1_1", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_G_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip(" !G.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given G.S.F00 ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4: TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: TH reads EventList from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 6: TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 7: TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_G_2_1Suite : public TestCommand +{ +public: + Test_TC_G_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_G_2_1", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_G_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::BitMask NameSupportFeatureSupportedValue; + chip::BitMask NameSupportValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("nameSupport", value, 128U)); + NameSupportFeatureSupportedValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("nameSupport", value, 0U)); + NameSupportValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("nameSupport", value, NameSupportFeatureSupportedValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("nameSupport", value, NameSupportValue)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH reads NameSupport attribute from DUT"); + VerifyOrDo(!ShouldSkip("G.S.A0000 && G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::NameSupport::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: TH reads NameSupport attribute from DUT"); + VerifyOrDo(!ShouldSkip("G.S.A0000 && !G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::NameSupport::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 2a: TH writes NameSupport attribute as 0x80 EXOR the value as read in step 1"); + VerifyOrDo(!ShouldSkip("G.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(128U); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::NameSupport::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2b: TH reads NameSupport attribute from DUT"); + VerifyOrDo(!ShouldSkip("G.S.A0000 && G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::NameSupport::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3: TH reads NameSupport attribute from DUT"); + VerifyOrDo(!ShouldSkip("G.S.A0000 && !G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Attributes::NameSupport::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestActivatedCarbonFilterMonitoringSuite : public TestCommand +{ +public: + TestActivatedCarbonFilterMonitoringSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestActivatedCarbonFilterMonitoring", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestActivatedCarbonFilterMonitoringSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 0)); + VerifyOrReturn( + CheckValue("replacementProductList[0].productIdentifierType", iter_0.GetValue().productIdentifierType, 0U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[0].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("111112222233", 12))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 1)); + VerifyOrReturn( + CheckValue("replacementProductList[1].productIdentifierType", iter_0.GetValue().productIdentifierType, 1U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[1].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, chip::CharSpan("gtin8xxx", 8))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 2)); + VerifyOrReturn( + CheckValue("replacementProductList[2].productIdentifierType", iter_0.GetValue().productIdentifierType, 2U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[2].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("4444455555666", 13))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 3)); + VerifyOrReturn( + CheckValue("replacementProductList[3].productIdentifierType", iter_0.GetValue().productIdentifierType, 3U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[3].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("gtin14xxxxxxxx", 14))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 4)); + VerifyOrReturn( + CheckValue("replacementProductList[4].productIdentifierType", iter_0.GetValue().productIdentifierType, 4U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[4].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("oem20xxxxxxxxxxxxxxx", 20))); + VerifyOrReturn(CheckNoMoreListItems("replacementProductList", iter_0, 5)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read Replacement Product List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::ReplacementProductList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestHepaFilterMonitoringSuite : public TestCommand +{ +public: + TestHepaFilterMonitoringSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestHepaFilterMonitoring", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestHepaFilterMonitoringSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 0)); + VerifyOrReturn( + CheckValue("replacementProductList[0].productIdentifierType", iter_0.GetValue().productIdentifierType, 0U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[0].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("111112222233", 12))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 1)); + VerifyOrReturn( + CheckValue("replacementProductList[1].productIdentifierType", iter_0.GetValue().productIdentifierType, 1U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[1].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, chip::CharSpan("gtin8xxx", 8))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 2)); + VerifyOrReturn( + CheckValue("replacementProductList[2].productIdentifierType", iter_0.GetValue().productIdentifierType, 2U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[2].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("4444455555666", 13))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 3)); + VerifyOrReturn( + CheckValue("replacementProductList[3].productIdentifierType", iter_0.GetValue().productIdentifierType, 3U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[3].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("gtin14xxxxxxxx", 14))); + VerifyOrReturn(CheckNextListItemDecodes("replacementProductList", iter_0, 4)); + VerifyOrReturn( + CheckValue("replacementProductList[4].productIdentifierType", iter_0.GetValue().productIdentifierType, 4U)); + VerifyOrReturn(CheckValueAsString("replacementProductList[4].productIdentifierValue", + iter_0.GetValue().productIdentifierValue, + chip::CharSpan("oem20xxxxxxxxxxxxxxx", 20))); + VerifyOrReturn(CheckNoMoreListItems("replacementProductList", iter_0, 5)); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read Replacement Product List"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::ReplacementProductList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_ACFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ACFREMON_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 3UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("!ACFREMON.S.F00 && !ACFREMON.S.F01 && !ACFREMON.S.F02"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given ACFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given ACFREMON.S.F01(ReplacementProductList) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4a: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4b: Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4c: Read the optional attribute InPlaceIndicator (ACFREMON.S.A0003) in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4d: Read the optional attribute LastChangedTime (ACFREMON.S.A0004) in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4e: Read the optional attribute ReplacementProductList (ACFREMON.S.F02) in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 4f: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any additional values in the " + "standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY contain " + "values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX is the " + "allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values " + "in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - 0xXXXX_FFFF) " + "and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 5a: TH reads EventList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 6a: Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("!ACFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 6a: Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 17: { + LogStep( + 17, + "Step 6b: TH reads from the DUT the AcceptedCommandList attribute. 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list " + "MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep( + 19, + "Step 7b: TH reads from the DUT the GeneratedCommandList attribute. 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list " + "MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_ACFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ACFREMON_2_1", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ActivatedCarbonFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ActivatedCarbonFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "epoch_s", "epoch_s")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the LastChangedTime attribute"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::LastChangedTime::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the ReplacementProductList attribute"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::ReplacementProductList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_HEPAFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_HEPAFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_HEPAFREMON_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_HEPAFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 3UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01 && !HEPAFREMON.S.F02"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given HEPAFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3c: Given HEPAFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 3d: Given HEPAFREMON.S.F02(ReplacementProductList) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4: Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 4b: Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 4c: Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0003) in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Step 4d: Read the optional attribute LastChangedTime (HEPAFREMON.S.A0004) in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Step 4e: Read the optional attribute ReplacementProductList (HEPAFREMON.S.F02) in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, + "Step 4f: TH reads from the DUT the AttributeList attribute. The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE). 2.The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.TThe list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 5a: TH reads EventList attribute from DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Step 6a: Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, + "Step 6b: TH reads AcceptedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 7a: Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in the Manufacturer " + "Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range (0x0001 - " + "0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test Vendor or invalid " + "range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_HEPAFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_HEPAFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_HEPAFREMON_2_1", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_HEPAFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::HepaFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "epoch_s", "epoch_s")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the LastChangedTime attribute"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::LastChangedTime::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the ReplacementProductList attribute"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::ReplacementProductList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_5Suite : public TestCommand +{ +public: + Test_TC_DD_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_6Suite : public TestCommand +{ +public: + Test_TC_DD_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_7Suite : public TestCommand +{ +public: + Test_TC_DD_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_8Suite : public TestCommand +{ +public: + Test_TC_DD_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_9Suite : public TestCommand +{ +public: + Test_TC_DD_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_9", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_10Suite : public TestCommand +{ +public: + Test_TC_DD_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_10", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_11Suite : public TestCommand +{ +public: + Test_TC_DD_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_11", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_12Suite : public TestCommand +{ +public: + Test_TC_DD_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_12", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_13Suite : public TestCommand +{ +public: + Test_TC_DD_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_13", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_14Suite : public TestCommand +{ +public: + Test_TC_DD_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_14", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_14Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_1_15Suite : public TestCommand +{ +public: + Test_TC_DD_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_15", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_1_15Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_2_1Suite : public TestCommand +{ +public: + Test_TC_DD_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_2_2Suite : public TestCommand +{ +public: + Test_TC_DD_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_1Suite : public TestCommand +{ +public: + Test_TC_DD_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_2Suite : public TestCommand +{ +public: + Test_TC_DD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_3Suite : public TestCommand +{ +public: + Test_TC_DD_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_4Suite : public TestCommand +{ +public: + Test_TC_DD_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_5Suite : public TestCommand +{ +public: + Test_TC_DD_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_6Suite : public TestCommand +{ +public: + Test_TC_DD_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_7Suite : public TestCommand +{ +public: + Test_TC_DD_3_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_8Suite : public TestCommand +{ +public: + Test_TC_DD_3_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_9Suite : public TestCommand +{ +public: + Test_TC_DD_3_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_9", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_10Suite : public TestCommand +{ +public: + Test_TC_DD_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_10", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_11Suite : public TestCommand +{ +public: + Test_TC_DD_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_11", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_12Suite : public TestCommand +{ +public: + Test_TC_DD_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_12", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_13Suite : public TestCommand +{ +public: + Test_TC_DD_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_13", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_14Suite : public TestCommand +{ +public: + Test_TC_DD_3_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_14", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_14Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_15Suite : public TestCommand +{ +public: + Test_TC_DD_3_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_15", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_15Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_16Suite : public TestCommand +{ +public: + Test_TC_DD_3_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_16", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_16Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_17Suite : public TestCommand +{ +public: + Test_TC_DD_3_17Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_17", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_17Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_18Suite : public TestCommand +{ +public: + Test_TC_DD_3_18Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_18", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_18Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_19Suite : public TestCommand +{ +public: + Test_TC_DD_3_19Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_19", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_19Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_20Suite : public TestCommand +{ +public: + Test_TC_DD_3_20Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_20", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_20Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_21Suite : public TestCommand +{ +public: + Test_TC_DD_3_21Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_21", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_21Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class TestGroupDemoCommandSuite : public TestCommand +{ +public: + TestGroupDemoCommandSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestGroupDemoCommand", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestGroupDemoCommandSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Turn On the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 2: { + LogStep(2, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Turn Off the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 4: { + LogStep(4, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Turn On the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 6: { + LogStep(6, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Turn Off the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 8: { + LogStep(8, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Turn On the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 10: { + LogStep(10, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Turn Off the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 12: { + LogStep(12, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Turn On the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 14: { + LogStep(14, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Turn Off the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 16: { + LogStep(16, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Turn On the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 18: { + LogStep(18, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Turn Off the light to see attribute change"); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 20: { + LogStep(20, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestGroupDemoConfigSuite : public TestCommand +{ +public: + TestGroupDemoConfigSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestGroupDemoConfig", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestGroupDemoConfigSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "KeySet Write 1 (endpoint 0)"); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 417U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1110000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 1110001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1110002ULL; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Write Group Keys (endpoint 0)"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].groupId = 257U; + listHolder_0->mList[0].groupKeySetID = 417U; + listHolder_0->mList[0].fabricIndex = 0U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Add Group 1 (endpoint 1)"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 257U; + value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Install ACLs"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 257ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_G_2_2Suite : public TestCommand +{ +public: + Test_TC_G_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_G_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_G_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_G_2_3Suite : public TestCommand +{ +public: + Test_TC_G_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_G_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_G_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_G_2_4Suite : public TestCommand +{ +public: + Test_TC_G_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_G_2_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_G_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_G_3_2Suite : public TestCommand +{ +public: + Test_TC_G_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_G_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_G_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_1Suite : public TestCommand +{ +public: + Test_TC_BDX_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_2Suite : public TestCommand +{ +public: + Test_TC_BDX_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_3Suite : public TestCommand +{ +public: + Test_TC_BDX_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_4Suite : public TestCommand +{ +public: + Test_TC_BDX_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_5Suite : public TestCommand +{ +public: + Test_TC_BDX_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_6Suite : public TestCommand +{ +public: + Test_TC_BDX_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_1Suite : public TestCommand +{ +public: + Test_TC_BDX_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_2Suite : public TestCommand +{ +public: + Test_TC_BDX_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_3Suite : public TestCommand +{ +public: + Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_4Suite : public TestCommand +{ +public: + Test_TC_BDX_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_5Suite : public TestCommand +{ +public: + Test_TC_BDX_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BR_1Suite : public TestCommand +{ +public: + Test_TC_BR_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BR_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BR_2Suite : public TestCommand +{ +public: + Test_TC_BR_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BR_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BR_3Suite : public TestCommand +{ +public: + Test_TC_BR_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BR_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BR_4Suite : public TestCommand +{ +public: + Test_TC_BR_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BR_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DA_1_1Suite : public TestCommand +{ +public: + Test_TC_DA_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DA_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DA_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DA_1_3Suite : public TestCommand +{ +public: + Test_TC_DA_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DA_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DA_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DA_1_4Suite : public TestCommand +{ +public: + Test_TC_DA_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DA_1_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DA_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DA_1_6Suite : public TestCommand +{ +public: + Test_TC_DA_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DA_1_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DA_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DA_1_8Suite : public TestCommand +{ +public: + Test_TC_DA_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DA_1_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DA_1_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BINFO_3_1Suite : public TestCommand +{ +public: + Test_TC_BINFO_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BINFO_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPCREDS_3_1Suite : public TestCommand +{ +public: + Test_TC_OPCREDS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPCREDS_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPCREDS_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPCREDS_3_2Suite : public TestCommand +{ +public: + Test_TC_OPCREDS_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPCREDS_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPCREDS_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPCREDS_3_3Suite : public TestCommand +{ +public: + Test_TC_OPCREDS_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPCREDS_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPCREDS_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPCREDS_3_4Suite : public TestCommand +{ +public: + Test_TC_OPCREDS_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPCREDS_3_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPCREDS_3_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPCREDS_3_5Suite : public TestCommand +{ +public: + Test_TC_OPCREDS_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPCREDS_3_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPCREDS_3_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPCREDS_3_6Suite : public TestCommand +{ +public: + Test_TC_OPCREDS_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPCREDS_3_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPCREDS_3_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_1Suite : public TestCommand +{ +public: + Test_TC_CNET_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_2Suite : public TestCommand +{ +public: + Test_TC_CNET_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_3Suite : public TestCommand +{ +public: + Test_TC_CNET_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_4Suite : public TestCommand +{ +public: + Test_TC_CNET_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_5Suite : public TestCommand +{ +public: + Test_TC_CNET_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_6Suite : public TestCommand +{ +public: + Test_TC_CNET_4_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_9Suite : public TestCommand +{ +public: + Test_TC_CNET_4_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_9", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_10Suite : public TestCommand +{ +public: + Test_TC_CNET_4_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_10", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_11Suite : public TestCommand +{ +public: + Test_TC_CNET_4_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_11", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_12Suite : public TestCommand +{ +public: + Test_TC_CNET_4_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_12", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_13Suite : public TestCommand +{ +public: + Test_TC_CNET_4_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_13", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_14Suite : public TestCommand +{ +public: + Test_TC_CNET_4_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_14", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_14Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_15Suite : public TestCommand +{ +public: + Test_TC_CNET_4_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_15", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_15Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_16Suite : public TestCommand +{ +public: + Test_TC_CNET_4_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_16", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_16Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_20Suite : public TestCommand +{ +public: + Test_TC_CNET_4_20Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_20", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_20Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_21Suite : public TestCommand +{ +public: + Test_TC_CNET_4_21Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_21", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_21Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_4_22Suite : public TestCommand +{ +public: + Test_TC_CNET_4_22Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_4_22", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CNET_4_22Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DLOG_2_1Suite : public TestCommand +{ +public: + Test_TC_DLOG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DLOG_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DLOG_2_2Suite : public TestCommand +{ +public: + Test_TC_DLOG_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DLOG_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DLOG_3_1Suite : public TestCommand +{ +public: + Test_TC_DLOG_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DLOG_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_1_1Suite : public TestCommand +{ +public: + Test_TC_DISHALM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_2_1Suite : public TestCommand +{ +public: + Test_TC_DISHALM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_3_1Suite : public TestCommand +{ +public: + Test_TC_DISHALM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_3_2Suite : public TestCommand +{ +public: + Test_TC_DISHALM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_3_3Suite : public TestCommand +{ +public: + Test_TC_DISHALM_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_3_4Suite : public TestCommand +{ +public: + Test_TC_DISHALM_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_3_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_3_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_3_5Suite : public TestCommand +{ +public: + Test_TC_DISHALM_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_3_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_3_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHALM_3_6Suite : public TestCommand +{ +public: + Test_TC_DISHALM_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DISHALM_3_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHALM_3_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHM_1_1Suite : public TestCommand +{ +public: + Test_TC_DISHM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DISHM_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHM_1_2Suite : public TestCommand +{ +public: + Test_TC_DISHM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DISHM_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHM_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHM_2_1Suite : public TestCommand +{ +public: + Test_TC_DISHM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DISHM_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHM_3_1Suite : public TestCommand +{ +public: + Test_TC_DISHM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DISHM_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHM_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHM_3_2Suite : public TestCommand +{ +public: + Test_TC_DISHM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DISHM_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHM_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DISHM_3_3Suite : public TestCommand +{ +public: + Test_TC_DISHM_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DISHM_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DISHM_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DESC_2_1Suite : public TestCommand +{ +public: + Test_TC_DESC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DESC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CGEN_2_2Suite : public TestCommand +{ +public: + Test_TC_CGEN_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CGEN_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CGEN_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGGEN_2_2Suite : public TestCommand +{ +public: + Test_TC_DGGEN_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGGEN_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGGEN_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ICDM_2_2Suite : public TestCommand +{ +public: + Test_TC_ICDM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ICDM_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ICDM_2_3Suite : public TestCommand +{ +public: + Test_TC_ICDM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ICDM_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_3_2Suite : public TestCommand +{ +public: + Test_TC_I_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_1_1Suite : public TestCommand +{ +public: + Test_TC_IDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_2_1Suite : public TestCommand +{ +public: + Test_TC_IDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_2_2Suite : public TestCommand +{ +public: + Test_TC_IDM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_3_1Suite : public TestCommand +{ +public: + Test_TC_IDM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_3_2Suite : public TestCommand +{ +public: + Test_TC_IDM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_4_1Suite : public TestCommand +{ +public: + Test_TC_IDM_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_4_2Suite : public TestCommand +{ +public: + Test_TC_IDM_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_4_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_4_3Suite : public TestCommand +{ +public: + Test_TC_IDM_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_4_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_4_4Suite : public TestCommand +{ +public: + Test_TC_IDM_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_4_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_5_1Suite : public TestCommand +{ +public: + Test_TC_IDM_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_5_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_5_2Suite : public TestCommand +{ +public: + Test_TC_IDM_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_5_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_1Suite : public TestCommand +{ +public: + Test_TC_IDM_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_2Suite : public TestCommand +{ +public: + Test_TC_IDM_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_3Suite : public TestCommand +{ +public: + Test_TC_IDM_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_4Suite : public TestCommand +{ +public: + Test_TC_IDM_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_7_1Suite : public TestCommand +{ +public: + Test_TC_IDM_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_7_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_7_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_8_1Suite : public TestCommand +{ +public: + Test_TC_IDM_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_8_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_8_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_10_1Suite : public TestCommand +{ +public: + Test_TC_IDM_10_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_10_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_10_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_11_1Suite : public TestCommand +{ +public: + Test_TC_IDM_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_11_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_11_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LOWPOWER_2_2Suite : public TestCommand +{ +public: + Test_TC_LOWPOWER_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_LOWPOWER_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LOWPOWER_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_7_1Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_7_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_7_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_8_1Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_8_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_8_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_9_1Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_9_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_9_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_9_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_14Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_14Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_14", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_14Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_15Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_15Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_15", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_15Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_16Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_16Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_16", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_16Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_17Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_17Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_17", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_17Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CHANNEL_5_4Suite : public TestCommand +{ +public: + Test_TC_CHANNEL_5_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CHANNEL_5_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CHANNEL_5_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CHANNEL_5_5Suite : public TestCommand +{ +public: + Test_TC_CHANNEL_5_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CHANNEL_5_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CHANNEL_5_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CHANNEL_5_6Suite : public TestCommand +{ +public: + Test_TC_CHANNEL_5_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CHANNEL_5_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CHANNEL_5_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_KEYPADINPUT_3_1Suite : public TestCommand +{ +public: + Test_TC_KEYPADINPUT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_KEYPADINPUT_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_KEYPADINPUT_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAPLAYBACK_6_5Suite : public TestCommand +{ +public: + Test_TC_MEDIAPLAYBACK_6_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAPLAYBACK_6_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAPLAYBACK_6_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAPLAYBACK_6_7Suite : public TestCommand +{ +public: + Test_TC_MEDIAPLAYBACK_6_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAPLAYBACK_6_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAPLAYBACK_6_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_AUDIOOUTPUT_7_3Suite : public TestCommand +{ +public: + Test_TC_AUDIOOUTPUT_7_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_AUDIOOUTPUT_7_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_AUDIOOUTPUT_7_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_AUDIOOUTPUT_7_4Suite : public TestCommand +{ +public: + Test_TC_AUDIOOUTPUT_7_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_AUDIOOUTPUT_7_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_AUDIOOUTPUT_7_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_4Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_10_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_10_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_11_1Suite : public TestCommand +{ +public: + Test_TC_MC_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_11_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_11_2Suite : public TestCommand +{ +public: + Test_TC_MC_11_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_11_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ALOGIN_12_2Suite : public TestCommand +{ +public: + Test_TC_ALOGIN_12_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ALOGIN_12_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ALOGIN_12_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TGTNAV_8_2Suite : public TestCommand +{ +public: + Test_TC_TGTNAV_8_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TGTNAV_8_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TGTNAV_8_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_1Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_2Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_7Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_8Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_11Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_11", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_12Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_12", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_14Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_14", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_14Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_15Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_15", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_15Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_16Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_16Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_16", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_16Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mWaitAfterCommissioning; + chip::Optional mPayload; + chip::Optional mTimeout; + + uint8_t TH3FabricIndex; + uint8_t TH2FabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH3FabricIndex = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].nodeID", iter_0.GetValue().nodeID, + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValue("fabrics[1].nodeID", iter_0.GetValue().nodeID, + mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[1].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 2)); + VerifyOrReturn(CheckValue("fabrics[2].nodeID", iter_0.GetValue().nodeID, + mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[2].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[2].fabricIndex", iter_0.GetValue().fabricIndex, 3U)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 3)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].nodeID", iter_0.GetValue().nodeID, + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValue("fabrics[1].nodeID", iter_0.GetValue().nodeID, + mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[1].fabricIndex", iter_0.GetValue().fabricIndex, 3U)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 2)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2FabricIndex = value; + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].nodeID", iter_0.GetValue().nodeID, + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValue("fabrics[1].nodeID", iter_0.GetValue().nodeID, + mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[1].fabricIndex", iter_0.GetValue().fabricIndex, 4U)); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 2)); + VerifyOrReturn(CheckValue("fabrics[2].nodeID", iter_0.GetValue().nodeID, + mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[2].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[2].fabricIndex", iter_0.GetValue().fabricIndex, 3U)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 3)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH_CR1 opens a commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 2a: Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 3: TH_CR2 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 6: { + LogStep(6, "Step 3a: DUT_CE is commissioned to TH_CR2"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 7: { + LogStep(7, "Step 4: TH_CR1 opens a commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 4a: Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 5: TH_CR3 Commissions with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + case 10: { + LogStep(10, "Step 5a: DUT_CE is commissioned to TH_CR3"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + return WaitForCommissionee(kIdentityGamma, value); + } + case 11: { + LogStep(11, "Step 5b: TH3 reads CurrentFabricIndex attribute and save it for future use."); + return ReadAttribute(kIdentityGamma, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 6: TH_CR2 reads the list of Fabrics on DUT_CE"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 7: TH_CR2 sends RemoveFabric with FabricIndex = 2 command to DUT_CE"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = 2U; + return SendCommand(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Step 8a: TH_CR2 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityBeta, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 8b: TH_CR2 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 9: TH_CR1 reads the list of Fabrics on DUT_CE"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 11: TH_CR1 opens a commissioning window on DUT_CE using BCM"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Step 11a: Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Step 12: TH_CR2 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 20: { + LogStep(20, "Step 12a: DUT_CE is commissioned to TH_CR2"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 21: { + LogStep(21, "Step 12b: TH2 reads CurrentFabricIndex attribute and save it for future use."); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 13: TH_CR1 reads the list of Fabrics on DUT_CE"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false, chip::NullOptional); + } + case 23: { + LogStep(23, "Step 13a: Remove TH2 FabricIndex"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.C0a.Rsp && CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = TH2FabricIndex; + return SendCommand(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Step 13b: Remove TH3 FabricIndex"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.C0a.Rsp && CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = TH3FabricIndex; + return SendCommand(kIdentityGamma, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_17Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_17Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_17", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_17Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_18Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_18Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_18", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_18Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_19Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_19Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_19", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_19Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_20Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_20Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_20", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_20Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_21Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_21Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_21", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_CADMIN_1_21Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(950)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mEndpoint; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH_CR1 opens a commissioning window on DUT_CE using BCM with a value of 900 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 900U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3: Wait 901 seconds for commissioning Window to be closed"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 901000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: TH_CR1 opens a commissioning window on DUT_CE using BCM with a value of 901 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 901U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_22Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_22Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_22", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("PakeVerifier", &mPakeVerifier); + } + + ~Test_TC_CADMIN_1_22Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(950)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPakeVerifier; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 900 seconds"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 2a: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 900 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 900U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 3: Wait for commissioning Window to 901 seconds"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 901000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 901 seconds"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 5a: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 901 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 901U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_3Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_4Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_4", 27, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("payload", &mPayload); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + } + + ~Test_TC_CADMIN_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeId2; + chip::Optional mEndpoint; + chip::Optional mPayload; + chip::Optional mWaitAfterCommissioning; + + uint8_t TH1FabricIndex; + uint8_t TH2FabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH1FabricIndex = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2FabricIndex = value; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].nodeID", iter_0.GetValue().nodeID, + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValue("fabrics[1].nodeID", iter_0.GetValue().nodeID, + mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[1].fabricIndex", iter_0.GetValue().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 2)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].nodeID", iter_0.GetValue().nodeID, + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValue("fabrics[1].nodeID", iter_0.GetValue().nodeID, + mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("fabrics[1].fabricIndex", iter_0.GetValue().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 2)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), 9)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1a: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 1b: TH1 reads CurrentFabricIndex attribute and save it for future use."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 2a: TH_CR1 opens a commissioning window on DUT_CE using BCM"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 2a: Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 2b: Verify that the DNS-SD advertisement shows CM=1"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 2d: TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 3a: TH_CR2 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 10: { + LogStep(10, "Step 3b: DUT_CE is commissioned by TH_CR2 on Fabric ID2 "); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 11: { + LogStep(11, "Step 3c: TH2 reads CurrentFabricIndex attribute and save it for future use."); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 4: Verify DUT_CE is now discoverable over DNS-SD with two SRV Records"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 5: TH_CR1 reads the list of Fabrics on DUT_CE"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 6: TH_CR2 reads the list of Fabrics on DUT_CE"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 7a: TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "Step 7b: TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 17: { + LogStep(17, "Step 8a: TH_CR2 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityBeta, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 8b: TH_CR2 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Step 9: TH_CR2 opens a commissioning window on DUT_CE using BCM"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityBeta, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Step 10: Wait for the commissioning window in step 13 to timeout"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 180000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 11: TH_CR2 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 12a: TH_CR2 opens a commissioning window on DUT_CE using BCM"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityBeta, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Step 12b: Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Step 13a: TH_CR1 starts a commissioning process with DUT_CE before the timeout from step 12"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Step 13b: TH_CR2 revokes the commissioning window"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C02.Rsp && CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityBeta, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Step 13c: Remove TH2 FabricIndex"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.C0a.Rsp && CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = TH2FabricIndex; + return SendCommand(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_5Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_6Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_6", 23, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + AddArgument("payload", &mPayload); + } + + ~Test_TC_CADMIN_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mWaitAfterCommissioning; + chip::Optional mPayload; + + uint8_t TH2FabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), 2)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + TH2FabricIndex = value; + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), 4)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH_CR1 opens a commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3: Verify that the DNS-SD advertisement shows CM=1"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Wait for PIXIT.CADMIN.CwDuration + 10"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 190000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4: TH_CR2 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 7: { + LogStep(7, "Step 5: TH_CR1 opens a commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 6: TH_CR1 revokes the commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 7: TH_CR2 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 11: { + LogStep(11, "Step 8: TH_CR1 revokes the commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 9a: TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "Step 9b: TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::NodeLabel::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "Step 10: TH_CR1 opens a commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, "Step 11: TH_CR1 opens another commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Step 12: TH_CR2 starts a commissioning process on DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 18: { + LogStep(18, "DUT_CE is commissioned by TH_CR2"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 19: { + LogStep(19, "TH2 reads CurrentFabricIndex attribute and save it for future use."); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Step 13: TH_CR1 tries to revoke the commissioning window on DUT_CE using RevokeCommissioning command"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Step 14: TH_CR3 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + case 22: { + LogStep(22, "Remove TH2 FabricIndex"); + VerifyOrDo(!ShouldSkip("OPCREDS.S.C0a.Rsp && CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = TH2FabricIndex; + return SendCommand(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::Optional(10000), + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_9Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_9", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_10Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_10", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + AddArgument("correctPayload", &mCorrectPayload); + AddArgument("incorrectSetupCodePayload", &mIncorrectSetupCodePayload); + } + + ~Test_TC_CADMIN_1_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(700)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mWaitAfterCommissioning; + chip::Optional mCorrectPayload; + chip::Optional mIncorrectSetupCodePayload; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH_CR1 opens a commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 900U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 2a: Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 3: Verify that the DNS-SD advertisement shows CM=1"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4.1: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 7: { + LogStep(7, "Step 4.2: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 8: { + LogStep(8, "Step 4.3: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 9: { + LogStep(9, "Step 4.4: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 10: { + LogStep(10, "Step 4.5: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 11: { + LogStep(11, "Step 4.6: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 12: { + LogStep(12, "Step 4.7: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 13: { + LogStep(13, "Step 4.8: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 14: { + LogStep(14, "Step 4.9: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 15: { + LogStep(15, "Step 4.10: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 16: { + LogStep(16, "Step 4.11: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 17: { + LogStep(17, "Step 4.12: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 18: { + LogStep(18, "Step 4.13: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 19: { + LogStep(19, "Step 4.14: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 20: { + LogStep(20, "Step 4.15: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 21: { + LogStep(21, "Step 4.16: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 22: { + LogStep(22, "Step 4.17: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 23: { + LogStep(23, "Step 4.18: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 24: { + LogStep(24, "Step 4.19: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 25: { + LogStep(25, "Step 4.20: TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + value.discoverOnce.Emplace(); + value.discoverOnce.Value() = true; + return PairWithCode(kIdentityBeta, value); + } + case 26: { + LogStep(26, "Step 5a: TH_CR2 attempts to do PASE to DUT_CE using the correct onboarding payload"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = + mCorrectPayload.HasValue() ? mCorrectPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 27: { + LogStep(27, "Step 5b: TH_CR3 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = + mCorrectPayload.HasValue() ? mCorrectPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_13Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_13", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_23Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_23Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_23", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_CADMIN_1_23Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(200)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mEndpoint; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH_CR1 opens a commissioning window on DUT_CE using BCM with a value of 180 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Step 3: Wait for 181 seconds for commissioning Window to be closed"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 181000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 5: TH_CR1 opens a commissioning window on DUT_CE using BCM with a value of 179 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 179U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_24Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_24Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_24", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("PakeVerifier", &mPakeVerifier); + } + + ~Test_TC_CADMIN_1_24Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(200)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPakeVerifier; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::FactoryReset::Type value; + return FactoryReset(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Precondition: Reset Devices to factory defaults"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Factory Reset the DUT and enter 'y' after successgarbage: not in length on purpose", 49); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "Step 1: TH_CR1 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 2: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 180 seconds"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 2a: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 180 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Step 3: Wait for commissioning Window to 181 seconds"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 181000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 5: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 179 seconds"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 5a: TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 179 seconds"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 179U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is closed"); + VerifyOrDo(!ShouldSkip("CADMIN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_25Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_25Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_25", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_25Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CADMIN_1_26Suite : public TestCommand +{ +public: + Test_TC_CADMIN_1_26Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CADMIN_1_26", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CADMIN_1_26Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MOD_1_2Suite : public TestCommand +{ +public: + Test_TC_MOD_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MOD_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MOD_1_3Suite : public TestCommand +{ +public: + Test_TC_MOD_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MOD_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MOD_2_2Suite : public TestCommand +{ +public: + Test_TC_MOD_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MOD_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_1_1Suite : public TestCommand +{ +public: + Test_TC_SU_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_1Suite : public TestCommand +{ +public: + Test_TC_SU_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_2Suite : public TestCommand +{ +public: + Test_TC_SU_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_3Suite : public TestCommand +{ +public: + Test_TC_SU_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_4Suite : public TestCommand +{ +public: + Test_TC_SU_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_5Suite : public TestCommand +{ +public: + Test_TC_SU_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_6Suite : public TestCommand +{ +public: + Test_TC_SU_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_7Suite : public TestCommand +{ +public: + Test_TC_SU_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_2_8Suite : public TestCommand +{ +public: + Test_TC_SU_2_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_2_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_3_1Suite : public TestCommand +{ +public: + Test_TC_SU_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_3_2Suite : public TestCommand +{ +public: + Test_TC_SU_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_3_3Suite : public TestCommand +{ +public: + Test_TC_SU_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_3_4Suite : public TestCommand +{ +public: + Test_TC_SU_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_3_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_4_1Suite : public TestCommand +{ +public: + Test_TC_SU_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_4_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SU_4_2Suite : public TestCommand +{ +public: + Test_TC_SU_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_4_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SU_4_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PSCFG_2_2Suite : public TestCommand +{ +public: + Test_TC_PSCFG_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PSCFG_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_1_1Suite : public TestCommand +{ +public: + Test_TC_SC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_1_2Suite : public TestCommand +{ +public: + Test_TC_SC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_1_3Suite : public TestCommand +{ +public: + Test_TC_SC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_1_4Suite : public TestCommand +{ +public: + Test_TC_SC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_1_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_2_1Suite : public TestCommand +{ +public: + Test_TC_SC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_2_2Suite : public TestCommand +{ +public: + Test_TC_SC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_2_3Suite : public TestCommand +{ +public: + Test_TC_SC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_2_4Suite : public TestCommand +{ +public: + Test_TC_SC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_2_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_3_1Suite : public TestCommand +{ +public: + Test_TC_SC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_3_2Suite : public TestCommand +{ +public: + Test_TC_SC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_3_3Suite : public TestCommand +{ +public: + Test_TC_SC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_3_4Suite : public TestCommand +{ +public: + Test_TC_SC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_3_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_1Suite : public TestCommand +{ +public: + Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 99, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("shortDiscriminator", 0, UINT16_MAX, &mShortDiscriminator); + AddArgument("vendorId", 0, UINT16_MAX, &mVendorId); + AddArgument("productId", 0, UINT16_MAX, &mProductId); + AddArgument("deviceType", 0, UINT16_MAX, &mDeviceType); + AddArgument("PakeVerifier", &mPakeVerifier); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); + } + + ~Test_TC_SC_4_1Suite() + { + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + deviceInstanceNameBeforeRebootBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(900)); } + +private: + chip::Optional mNodeId; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mShortDiscriminator; + chip::Optional mVendorId; + chip::Optional mProductId; + chip::Optional mDeviceType; + chip::Optional mPakeVerifier; + chip::Optional mTimeout; + chip::Optional mWaitAfterCommissioning; + + char * deviceInstanceNameBeforeRebootBuffer = nullptr; + chip::CharSpan deviceInstanceNameBeforeReboot; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + } + deviceInstanceNameBeforeRebootBuffer = static_cast(chip::Platform::MemoryAlloc(value.instanceName.size())); + memcpy(deviceInstanceNameBeforeRebootBuffer, value.instanceName.data(), value.instanceName.size()); + deviceInstanceNameBeforeReboot = chip::CharSpan(deviceInstanceNameBeforeRebootBuffer, value.instanceName.size()); + } + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1U)); + } + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U)); + } + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintNotValue("value.instanceName", value.instanceName, deviceInstanceNameBeforeReboot)); + } + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1U)); + } + shouldContinue = true; + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U)); + } + shouldContinue = true; + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + } + shouldContinue = true; + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 2U)); + } + shouldContinue = true; + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U)); + } + shouldContinue = true; + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + } + shouldContinue = true; + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 0U)); + } + shouldContinue = true; + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: DUT is put in Commissioning Mode using Open Basic Commissioning Window command "); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, + "Step 2a: Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex " + "string with capital letters"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Step 2b: Service type must be _matterc._udp"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 2c: Check target hostname is derived from the 48bit or 64bit MAC address expressed as a twelve or " + "sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("( MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Step 2c: Check target hostname is derived from the 48bit or 64bit MAC address expressed as a twelve or " + "sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.WIFI) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2d: Check Long Discriminator _L"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Step 2d: Check Short Discriminator (_S)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "Step 2e: If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V is present must be 16-bit vendor id, encoded " + "as a variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 10: { + LogStep(10, + "Step 2f: If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type from " + "Data Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2g: Check Commissioning Mode (_CM) subtype _CM must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 12: { + LogStep(12, + "Step 2h: key D must be present and represents the discriminator which must be encoded as a variable-length " + "decimal value with up to 4 digits omitting any leading zeros"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 2i: If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Step 2j: If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 15: { + LogStep(15, + "Step 2k: If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 3600000"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 16: { + LogStep(16, + "Step 2l: If (MCORE.SC.SAI_OP_DISCOVERY_KEY ) present, SAI key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 17: { + LogStep(17, + "Step 2m: If (MCORE.SC.SAT_OP_DISCOVERY_KEY) present, SAT key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 65535."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 2n: TXT key for commissioning mode (CM) CM=1 must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 19: { + LogStep(19, + "Step 2o: If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device " + "Types and must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 20: { + LogStep(20, + "Step 2p: If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 21: { + LogStep(21, + "Step 2q: If (MCORE.SC.RI_KEY ) present, key RI must include the Rotating Device Identifier encoded as a " + "uppercase string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 22: { + LogStep(22, + "Step 2r: If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII " + "text, omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 23: { + LogStep(23, + "Step 2s: If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length " + "of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 24: { + LogStep(24, + "Step 2t: DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter " + "messages."); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Step 3: Reboot/restart the DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Step 3: Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 28: { + LogStep(28, + "Step 3a: DUT put in Commissioning Mode using Open Basic Commissioning Window command, starting advertising " + "Commissionable Node Discovery service using DNS-SD"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 30: { + LogStep(30, + "Step 4a: Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex " + "string with capital letters and must be different from the one at step 2"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 4b: service type must be _matterc._udp"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 32: { + LogStep(32, + "Step 4c: Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or " + "64bit MAC address expressed as a twelve or sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 33: { + LogStep(33, + "Step 4c: Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC address " + "expressed as a twelve or sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 34: { + LogStep(34, "Step 4d: Check Long Discriminator _L"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 35: { + LogStep(35, "Step 4e: Check Short Discriminator (_S)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 36: { + LogStep(36, + "Step 4f: If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V is present must be 16-bit vendor id, " + "encoded as a variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 37: { + LogStep(37, + "Step 4g: If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type from " + "Data Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 38: { + LogStep(38, "Step 4h: Check Commissioning Mode (_CM) subtype _CM is present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 39: { + LogStep(39, + "Step 4i: key D must be present and represents the discriminator which must be encoded as a variable-length " + "decimal value with up to 4 digits omitting any leading zeros"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 40: { + LogStep(40, "Step 4j: If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present."); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 41: { + LogStep(41, "Step 4k: If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present."); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 42: { + LogStep(42, + "Step 4l: If (MCORE.SC.SII_OP_DISCOVERY_KEY ) present, SII key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 3600000"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 43: { + LogStep(43, + "Step 4m: If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 44: { + LogStep(44, + "Step 4n: If (MCORE.SC.SAT_OP_DISCOVERY_KEY) present, SAT key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 65535."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 45: { + LogStep(45, "Step 4o: TXT key for commissioning mode (CM) key CM=1 must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 46: { + LogStep(46, + "Step 4p: If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device " + "Types and must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 47: { + LogStep(47, + "Step 4q: If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 48: { + LogStep(48, + "Step 4r: If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a " + "uppercase string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 49: { + LogStep(49, + "Step 4s: If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII " + "text, omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 50: { + LogStep(50, + "Step 4t: If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length " + "of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 51: { + LogStep(51, + "Step 4u: DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter " + "messages."); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 52: { + LogStep(52, "Step 5: Wait for OpenBasicCommissioningWindow timeout to expire"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 180000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 53: { + LogStep(53, + "Step 6: DUT is Commissioned and instructed to enter in commissioning mode using Open Commissioning Window " + "command"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 54: { + LogStep(54, + "Step 6: DUT is Commissioned and instructed to enter in commissioning mode using Open Commissioning Window " + "command"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 55: { + LogStep(55, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 56: { + LogStep(56, + "Step 7a: DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with " + "capital letters"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 57: { + LogStep(57, + "Step 7b: Check Hostname.If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or " + "64bit MAC address expressed as a twelve or sixteen capital letter hex string."); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 58: { + LogStep(58, + "Step 7b: Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC extended " + "address expressed as a twelve or sixteen capital letter hex string."); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 59: { + LogStep(59, "Step 7c: Check Long Discriminator _L"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 60: { + LogStep(60, "Step 7d: Check Short Discriminator (_S)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 61: { + LogStep(61, + "Step 7e: If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V is present must be 16-bit vendor id, encoded " + "as a variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 62: { + LogStep(62, + "Step 7f: If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type from " + "Data Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 63: { + LogStep(63, "Step 7g: Check Commissioning Mode (_CM) subtype _CM is present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 64: { + LogStep(64, "Step 7h: If (MCORE.SC.VP_KEY ) present, VP key must contain at least Vendor ID is present."); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 65: { + LogStep(65, "Step 7i: If (MCORE.SC.VP_KEY ) present, VP key must contain at least Product ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 66: { + LogStep(66, + "Step 7j: Optional TXT key for MRP Retry Interval Idle. if (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key " + "must be an unsigned integer with units of milliseconds and shall be encoded as a variable length decimal " + "number in ASCII, omitting leading zeros. Shall not exceed 3600000"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 67: { + LogStep(67, + "Step 7k: Optional TXT key for MRP Retry Interval Active. if (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key " + "must be an unsigned integer with units of milliseconds and shall be encoded as a variable length decimal " + "number in ASCII, omitting leading zeros. Shall not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 68: { + LogStep(68, + "Step 7l: Optional TXT key for MRP Retry Active Mode Threshold. If (MCORE.SC.SAT_OP_DISCOVERY_KEY) present, " + "SAT key must be an unsigned integer with units of milliseconds and shall be encoded as a variable length " + "decimal number in ASCII, omitting leading zeros. Shall not exceed 65535."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 69: { + LogStep(69, "Step 7m: TXT key for commissioning mode. CM=2 must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 70: { + LogStep(70, + "Step 7n: If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device " + "Types and must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 71: { + LogStep(71, + "Step 7o: If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 72: { + LogStep(72, + "Step 7p: If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a " + "uppercase string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 73: { + LogStep(73, + "Step 7q: If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII " + "text, omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 74: { + LogStep(74, + "Step 7r: If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length " + "of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 75: { + LogStep(75, + "Step 7s: DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter " + "messages"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 76: { + LogStep(76, "Step 8: Wait for OCW timeout to expire"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 180000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 77: { + LogStep(77, + "Step 9: If (MCORE.SC.EXTENDED_DISCOVERY ) enable Extended Discovery. DUT should start to send Commissionable " + "Node Discovery DNS-SD advertisements"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 78: { + LogStep(78, + "Step 10a: Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex " + "string with capital letters"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 79: { + LogStep(79, "Step 10b: service type must be _matterc._udp"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 80: { + LogStep(80, + "Step 10c: Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or " + "64bit MAC address expressed as a twelve or sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 81: { + LogStep(81, + "Step 10c: Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC extended " + "address expressed as a twelve or sixteen capital letter hex string."); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 82: { + LogStep(82, "Step 10d: Check Long Discriminator _L"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 83: { + LogStep(83, "Step 10e: Check Short Discriminator (_S)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 84: { + LogStep(84, + "Step 10f: If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V is present must be 16-bit vendor id, " + "encoded as a variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 85: { + LogStep(85, + "Step 10g: If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type " + "from Data Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 86: { + LogStep(86, "Step 10h: Check Commissioning Mode (_CM)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 87: { + LogStep(87, "Step 10i: TXT key for discriminator (D)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 88: { + LogStep(88, "Step 10j: If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 89: { + LogStep(89, "Step 10k: If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 90: { + LogStep(90, + "Step 10l: If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 91: { + LogStep(91, + "Step 10m: If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 92: { + LogStep(92, + "Step 10n: If (MCORE.SC.SAT_OP_DISCOVERY_KEY) present, SAT key must be an unsigned integer with units of " + "milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall " + "not exceed 65535."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 93: { + LogStep(93, "Step 10o: TXT key for commissioning mode (CM), CM=0 may be present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 94: { + LogStep(94, + "Step 10p: If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device " + "Types and must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 95: { + LogStep(95, + "Step 10q: If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 96: { + LogStep(96, + "Step 10r: If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a " + "uppercase string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 97: { + LogStep(97, + "Step 10s: If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII " + "text, omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 98: { + LogStep(98, + "Step 10t: If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length " + "of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_2Suite : public TestCommand +{ +public: + Test_TC_SC_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_3Suite : public TestCommand +{ +public: + Test_TC_SC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_4Suite : public TestCommand +{ +public: + Test_TC_SC_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_5Suite : public TestCommand +{ +public: + Test_TC_SC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_6Suite : public TestCommand +{ +public: + Test_TC_SC_4_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_7Suite : public TestCommand +{ +public: + Test_TC_SC_4_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_8Suite : public TestCommand +{ +public: + Test_TC_SC_4_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_9Suite : public TestCommand +{ +public: + Test_TC_SC_4_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_9", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_10Suite : public TestCommand +{ +public: + Test_TC_SC_4_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_10", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_5_3Suite : public TestCommand +{ +public: + Test_TC_SC_5_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_5_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_5_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_6_1Suite : public TestCommand +{ +public: + Test_TC_SC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_6_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_6_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGSW_2_1Suite : public TestCommand +{ +public: + Test_TC_DGSW_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGSW_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGSW_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGSW_2_2Suite : public TestCommand +{ +public: + Test_TC_DGSW_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGSW_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGSW_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGSW_2_3Suite : public TestCommand +{ +public: + Test_TC_DGSW_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGSW_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGSW_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGWIFI_2_2Suite : public TestCommand +{ +public: + Test_TC_DGWIFI_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGWIFI_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGWIFI_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLW_2_2Suite : public TestCommand +{ +public: + Test_TC_FLW_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_2_2", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLW_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable ValueBeforeChange; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + ValueBeforeChange = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + VerifyOrReturn(CheckConstraintNotValue("value", value, ValueBeforeChange)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute: MeasuredValue"); + VerifyOrDo(!ShouldSkip("FLW.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Operate on device to change the flow significantly"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && FLW.M.FlowChange"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 4: Read the mandatory attribute: MeasuredValue"); + VerifyOrDo(!ShouldSkip("FLW.S.A0000 && FLW.M.FlowChange"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OCC_3_1Suite : public TestCommand +{ +public: + Test_TC_OCC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_1", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OCC_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::BitMask OccupancyValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + OccupancyValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value", value, OccupancyValue)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Reads Occupancy attribute from DUT"); + VerifyOrDo(!ShouldSkip("OCC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::Occupancy::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Operate on DUT to change the occupancy status"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && OCC.M.OccupancyChange"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "Step 4: Reads back Occupancy attribute from DUT after few seconds"); + VerifyOrDo(!ShouldSkip("OCC.S.A0000 && OCC.M.OccupancyChange"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::Occupancy::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PS_2_2Suite : public TestCommand +{ +public: + Test_TC_PS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PS_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PS_3_1Suite : public TestCommand +{ +public: + Test_TC_PS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PS_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BOOL_2_2Suite : public TestCommand +{ +public: + Test_TC_BOOL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BOOL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_3_1Suite : public TestCommand +{ +public: + Test_TC_CC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_1", 51, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(200)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 68U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 92U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 85U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 102U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 138U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 102U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 138U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 115U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 155U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 68U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 92U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 85U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 102U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 138U)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 102U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 138U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 85U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 68U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 92U)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 51U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 69U)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 51U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 69U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 1a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 1b: H sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends MoveToHue command to DUT with Hue=60, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 60U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 2b: TH sends MoveToHue command to DUT with Hue=120, Direction=0x00 (shortest distance) and " + "TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 120U; + value.direction = static_cast(0); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 2f: H reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 3a: TH sends MoveToHue command to DUT with Hue=60, Direction=0x00 (Shortest distance) and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 60U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, + "Step 3b: TH sends MoveToHue command to DUT with Hue=135, Direction=0x01 (longest distance) and " + "TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 135U; + value.direction = static_cast(1); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 3c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000 && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 3d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000 && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 22: { + LogStep(22, "Step 3e: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000 && PICS_SKIP_SAMPLE_APP"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Step 3f: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, + "Step 4a: TH sends MoveToHue command to DUT with Hue=60, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 60U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "Step 4b: H sends MoveToHue command to DUT with Hue=120, Direction=0x02 (up) and TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 120U; + value.direction = static_cast(2); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 29: { + LogStep(29, "Step 4c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 4d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 32: { + LogStep(32, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 33: { + LogStep(33, "Step 4e: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 35: { + LogStep(35, "Step 4f: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, + "Step 5a: TH sends MoveToHue command to DUT with Hue=120, Direction=0x00 (shortest distance) and " + "TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 120U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 38: { + LogStep(38, + "Step 5b: TH sends MoveToHue command to DUT with Hue=60, Direction=0x03 (down) and TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; + value.hue = 60U; + value.direction = static_cast(3); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value, + chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 40: { + LogStep(40, "Step 5c: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 42: { + LogStep(42, "Step 5d: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 43: { + LogStep(43, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 44: { + LogStep(44, "Step 5e: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 45: { + LogStep(45, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 46: { + LogStep(46, "Step 5f: TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "Step 6a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 48: { + LogStep(48, "Step 6b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 49: { + LogStep(49, "Turn off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_7_1Suite : public TestCommand +{ +public: + Test_TC_CC_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_1", 51, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_7_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(200)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 6800U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9200U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11500U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 10200U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 13800U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 10200U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 13800U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 18700U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 25300U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 34700U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 41300U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 50700U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 62100U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 50700U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 62100U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 6800U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9200U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11500U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 10200U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 13800U)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 10200U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 13800U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 8500U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 11500U)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 6800U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9200U)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5100U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6900U)); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 5100U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 6900U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorMode", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedColorMode", value, 3U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 6000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 2b: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest distance) " + "and TransitionTime=300 (30s)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 12000U; + value.direction = static_cast(0); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Step 2c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Step 2d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Step 2e: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Step 2f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 3a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 6000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 16: { + LogStep(16, + "Step 3b: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=54000, Direction=0x01 (longest distance) " + "and TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 54000U; + value.direction = static_cast(1); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "Step 3c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 3d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 22: { + LogStep(22, "Step 3e: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Step 3f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "Step 4a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 6000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 27: { + LogStep(27, + "Step 4b: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x02 (up) and " + "TransitionTime=300 (30s)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 12000U; + value.direction = static_cast(2); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 29: { + LogStep(29, "Step 4c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 30: { + LogStep(30, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Step 4d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 32: { + LogStep(32, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 33: { + LogStep(33, "Step 4e: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 34: { + LogStep(34, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 35: { + LogStep(35, "Step 4f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 36: { + LogStep(36, + "Step 5a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest distance) " + "and TransitionTime=0 (immediately)"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 12000U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Wait 100ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 38: { + LogStep(38, + "Step 5b: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x03 (down) and " + "TransitionTime=300 (30s)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 6000U; + value.direction = static_cast(3); + value.transitionTime = 300U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 40: { + LogStep(40, "Step 5c: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 41: { + LogStep(41, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 42: { + LogStep(42, "Step 5d: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 43: { + LogStep(43, "Wait 10s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 44: { + LogStep(44, "Step 5e: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 45: { + LogStep(45, "Wait 5s"); + VerifyOrDo(!ShouldSkip("CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 46: { + LogStep(46, "Step 5f: TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 47: { + LogStep(47, "Step 6a: TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 48: { + LogStep(48, "Step 6b: TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, + true, chip::NullOptional); + } + case 49: { + LogStep(49, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_9_1Suite : public TestCommand +{ +public: + Test_TC_CC_9_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_9_1", 72, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_CC_9_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(400)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mCluster; + chip::Optional mEndpoint; + + uint16_t ColorLoopStartEnhancedHueStep5d; + uint16_t ColorLoopStoredEnhancedHueStep6c; + uint16_t ColorLoopStartEnhancedHueStep8d; + uint16_t ColorLoopStoredEnhancedHueStep9c; + uint16_t ColorLoopStartEnhancedHueStep12d; + uint16_t ColorLoopStoredEnhancedHueStep13c; + uint16_t ColorLoopStartEnhancedHueStep15d; + uint16_t ColorLoopStoredEnhancedHueStep16b; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopTime", value, 30U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 160U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep5d = value; + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep5d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep5d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep6c = value; + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep6c)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 1U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep8d = value; + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep8d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep8d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep9c = value; + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep9c)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, 16384U)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep12d = value; + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep12d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep12d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep13c = value; + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep13c)); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 1U)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueStep15d = value; + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep15d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueStep15d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueStep16b = value; + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueStep16b)); + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f && CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 0c: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=0x4000, Direction=0x00 (shortest " + "distance) and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 16384U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait for 1000ms"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 1a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x0 (De-activate) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 1b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 2a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction " + "attribute to 0x0 (decrement hue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Step 2b: Read ColorLoopDirection attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4003 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 3a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x4 (UpdateTime) and Time attribute to " + "30 (30s for one loop) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(4U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 30U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Step 3b: Read ColorLoopTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4004 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 4a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x8 (UpdateStartHue) and StartHue " + "attribute to 0x00A0 to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(8U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 160U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Step 4b: Read ColorLoopStartEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 5a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x1 (start from ColorLoopStartEnhancedHue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(1); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Step 5b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 5c: Read ColorLoopStoredEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C40.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Saving value for comparison in step 8d read ColorLoopStartEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Step 5d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Step 5e: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, + "Step 6a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x0 (De-activate) to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Step 6b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Saving value for comparison in step 6c read ColorLoopStoredEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Step 6c: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "Step 7a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction " + "attribute to 0x1 (increment hue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(1); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Step 7b: Read ColorLoopDirection attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4003 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, + "Step 8a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x1 (start from ColorLoopStartEnhancedHue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(1); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Step 8b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Step 8c: Read ColorLoopStoredEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C40.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "Saving value for comparision in step 8d read ColorLoopStartEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "Step 8d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 34: { + LogStep(34, "Step 8e: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 35: { + LogStep(35, + "Step 9a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x0 (De-activate) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 36: { + LogStep(36, "Step 9b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 37: { + LogStep(37, "Saving value for comparision in step 9c read ColorLoopStoredEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 38: { + LogStep(38, "Step 9c: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 39: { + LogStep(39, + "Step 10a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=0x4000, Direction=0x00 (shortest " + "distance) and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 16384U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 40: { + LogStep(40, "Wait 1000ms"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 41: { + LogStep(41, "Step 10b: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C40.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 42: { + LogStep(42, + "Step 11a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction " + "attribute to 0x0 (decrement hue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Step 11b: Read ColorLoopDirection attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4003 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 44: { + LogStep(44, + "Step 12a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x2 (start from EnhancedCurrentHue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(2); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 45: { + LogStep(45, "Step 12b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 46: { + LogStep(46, "Step 12c: Read ColorLoopStoredEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C40.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 47: { + LogStep(47, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 48: { + LogStep(48, "Saving value for comparision in step 12d read ColorLoopStartEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 49: { + LogStep(49, "Step 12d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 50: { + LogStep(50, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 51: { + LogStep(51, "Step 12e: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 52: { + LogStep(52, + "Step 13a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x0 (De-activate) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 53: { + LogStep(53, "Step 13b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 54: { + LogStep(54, "Saving value for comparision in step 13c read ColorLoopStoredEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 55: { + LogStep(55, "Step 13c: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 56: { + LogStep(56, + "Step 14a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction " + "attribute to 0x1 (increment hue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(1); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 57: { + LogStep(57, "Step 14b: Read ColorLoopDirection attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4003 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 58: { + LogStep(58, + "Step 15a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x2 (start from EnhancedCurrentHue) to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(2); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 59: { + LogStep(59, "Step 15b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 60: { + LogStep(60, "Step 15c: Read ColorLoopStoredEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C40.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 61: { + LogStep(61, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 62: { + LogStep(62, "Saving value for comparision in step 15d read ColorLoopStartEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 63: { + LogStep(63, "Step 15d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 64: { + LogStep(64, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 65: { + LogStep(65, "Step 15e: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 66: { + LogStep(66, + "Step 16a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x0 (De-activate) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 67: { + LogStep(67, "Step 16b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 68: { + LogStep(68, "Saving value for comparision in step 16b read ColorLoopStoredEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4006 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 69: { + LogStep(69, "Step 16c: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.F01 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 70: { + LogStep(70, "Turn Off light for color control tests"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 71: { + LogStep(71, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_9_2Suite : public TestCommand +{ +public: + Test_TC_CC_9_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_9_2", 31, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_9_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(400)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t ColorLoopStartEnhancedHueValue; + uint16_t ColorLoopStartEnhancedHue; + uint16_t ColorLoopStoredEnhancedHueValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopTime", value, 30U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 160U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 1U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHue = value; + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueValue = value; + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueValue)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f && CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 0c: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=0x4000, Direction=0x00 (shortest " + "distance) and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 16384U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait for 1000ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 1a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0xF, Action attribute to 0x0 " + "(De-activate), Direction attribute to 0x0 (decrement hue), Time attribute to 30, and StartHue attribute to " + "0x00A0 to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(15U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 30U; + value.startHue = 160U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 1b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 1c: Read ColorLoopDirection attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4003 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 1d: Read ColorLoopTime attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4004 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 1e: Read ColorLoopStartEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 2a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x1 (start from ColorLoopStartEnhancedHue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(1); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Step 2b: Read ColorLoopActive attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 2c: Read ColorLoopStoredEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4006 && CC.S.C40.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Saving value for comparision read ColorLoopStartEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 2d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 2e: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Step 3a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x2 (UpdateDirection) and Direction " + "attribute to 0x1 (increment hue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(2U); + value.action = static_cast(0); + value.direction = static_cast(1); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Step 3b: Read ColorLoopDirection attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4003 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Saving value for comparision read ColorLoopStartEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Step 3c: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 23: { + LogStep(23, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Step 3d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "Step 4a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x0 (De-activate) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Step 4b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Saving value for comparision read ColorLoopStoredEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4006 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "Step 4c: Read EnhancedCurrentHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "Turn off light for color control tests"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_9_3Suite : public TestCommand +{ +public: + Test_TC_CC_9_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_9_3", 30, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_9_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(400)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint16_t ColorLoopStartEnhancedHueValue; + uint16_t ColorLoopStoredEnhancedHueValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopTime", value, 30U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 160U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 1U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 16384U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStartEnhancedHueValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorLoopStartEnhancedHueValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopTime", value, 60U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + ColorLoopStoredEnhancedHueValue = value; + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("enhancedCurrentHue", value, ColorLoopStoredEnhancedHueValue)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 0a: TH writes 0 to the Options attribute"); + VerifyOrDo(!ShouldSkip("CC.S.A000f && CC.S.F02 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint8_t value; + value = 0U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 0b: TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 0c: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=0x4000, Direction=0x00 (shortest " + "distance) and TransitionTime=0 (immediately)."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; + value.enhancedHue = 16384U; + value.direction = static_cast(0); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait for 1000ms"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Step 1a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0xF, Action attribute to 0x0 " + "(De-activate), Direction attribute to 0x0 (decrement hue), Time attribute to 30, and StartHue attribute to " + "0x00A0 to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(15U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 30U; + value.startHue = 160U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 1b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Step 1c: Read ColorLoopDirection attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4003 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Step 1d: Read ColorLoopTime attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4004 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Step 1e: Read ColorLoopStartEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, + "Step 2a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x1 (start from ColorLoopStartEnhancedHue) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(1); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Step 2b: Read ColorLoopActive attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 2c: Read ColorLoopStoredEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4006 && CC.S.C40.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Saving value for comparision read ColorLoopStartEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4005 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Step 2d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Wait for 30S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "Step 2e: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Step 3a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x4 and Time attribute to 60 to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(4U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 60U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 19: { + LogStep(19, "Step 3b: Read ColorLoopTime attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4004 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait for 60S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 60000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Step 3c: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, "Wait for 60S"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 60000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "Step 3d: Read EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 24: { + LogStep(24, + "Step 4a: TH sends ColorLoopSet command to with UpdateFlag attribute to 0x1 (UpdateAction) and Action " + "attribute to 0x0 (De-activate) to DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.C44.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; + value.updateFlags = static_cast>(1U); + value.action = static_cast(0); + value.direction = static_cast(0); + value.time = 0U; + value.startHue = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value, + chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Step 4b: Read ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4002 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, + true, chip::NullOptional); + } + case 26: { + LogStep(26, "Saving value for comparision read ColorLoopStoredEnhancedHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4006 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Step 4c: Read EnhancedCurrentHue attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, + true, chip::NullOptional); + } + case 28: { + LogStep(28, "Turn off light for color control tests"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_2_10Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_10", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DRLK_3_2Suite : public TestCommand +{ +public: + Test_TC_DRLK_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LWM_1_2Suite : public TestCommand +{ +public: + Test_TC_LWM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LWM_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LWM_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LWM_3_2Suite : public TestCommand +{ +public: + Test_TC_LWM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LWM_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LWM_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OO_2_3Suite : public TestCommand +{ +public: + Test_TC_OO_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_2_3", 133, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_OO_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(400)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mTimeout; + chip::Optional mEndpoint; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 1)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 0)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 1)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 0)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 1)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 0)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 1)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("globalSceneControl", value, 1)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 300U)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 300U)); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 300U)); + } + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 300U)); + } + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 300U)); + } + break; + case 102: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 103: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 104: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 105: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 106: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 107: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 108: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 109: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 110: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 170U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 230U)); + } + break; + case 111: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 112: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 113: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 114: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + case 115: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 116: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 117: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 118: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 119: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 120: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 121: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 122: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 123: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 124: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + case 125: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 126: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 127: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 345U)); + } + break; + case 128: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 300U)); + } + break; + case 129: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 130: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; + case 131: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onTime", value, 0U)); + } + break; + case 132: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("offWaitTime", value, 0U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "2a: Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "2b: Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "2b:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "3a:Sends OffWithEffect command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type value; + value.effectIdentifier = static_cast(0); + value.effectVariant = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OffWithEffect::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "3b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "3b:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "4a:Sends OnWithRecallGlobalScene command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithRecallGlobalScene::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "4b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "4b:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000 && OO.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "5a:Sends OffWithEffect command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type value; + value.effectIdentifier = static_cast(0); + value.effectVariant = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OffWithEffect::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "5b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "5b:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "5c:Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "5d:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "5d:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "6a:Sends OffWithEffect command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type value; + value.effectIdentifier = static_cast(1); + value.effectVariant = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OffWithEffect::Id, value, + chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 23: { + LogStep(23, "6b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "6b:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "7a:Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "7b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 28: { + LogStep(28, "7b:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "7c:Sends OnWithRecallGlobalScene command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithRecallGlobalScene::Id, value, + chip::NullOptional + + ); + } + case 30: { + LogStep(30, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 31: { + LogStep(31, "7d:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 32: { + LogStep(32, "7d:Reads GlobalSceneControl attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4000 && OO.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GlobalSceneControl::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, "8:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "8:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "9a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 36: { + LogStep(36, "9b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 37: { + LogStep(37, "9b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "9b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 39: { + LogStep(39, "10a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 40: { + LogStep(40, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 41: { + LogStep(41, "10b:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 42: { + LogStep(42, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 43: { + LogStep(43, "10c:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 44: { + LogStep(44, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 45: { + LogStep(45, "10d:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 46: { + LogStep(46, "10e:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 47: { + LogStep(47, "10e:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 48: { + LogStep(48, "10e:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 50: { + LogStep(50, "11a:Sends OffWithEffect command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type value; + value.effectIdentifier = static_cast(0); + value.effectVariant = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OffWithEffect::Id, value, + chip::NullOptional + + ); + } + case 51: { + LogStep(51, "11b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 52: { + LogStep(52, "11b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 53: { + LogStep(53, "11b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 54: { + LogStep(54, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 55: { + LogStep(55, "12a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 56: { + LogStep(56, "12b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 57: { + LogStep(57, "12b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 58: { + LogStep(58, "12b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 59: { + LogStep(59, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 60: { + LogStep(60, "13a:Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 61: { + LogStep(61, "13b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 62: { + LogStep(62, "13b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 63: { + LogStep(63, "13b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 64: { + LogStep(64, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 65: { + LogStep(65, "14a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 66: { + LogStep(66, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 67: { + LogStep(67, "14b:Send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 68: { + LogStep(68, "14c:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 69: { + LogStep(69, "14c:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 70: { + LogStep(70, "14c:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 71: { + LogStep(71, "Wait 30000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 30000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 72: { + LogStep(72, "15:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 73: { + LogStep(73, "15:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 74: { + LogStep(74, "15:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 75: { + LogStep(75, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 76: { + LogStep(76, "16a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 77: { + LogStep(77, "16b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 78: { + LogStep(78, "16b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 79: { + LogStep(79, "16b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 80: { + LogStep(80, "17a:Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 81: { + LogStep(81, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 82: { + LogStep(82, "17b:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(1U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 83: { + LogStep(83, "17c:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 84: { + LogStep(84, "17c:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 85: { + LogStep(85, "17c:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 86: { + LogStep(86, "Wait 40000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 40000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 87: { + LogStep(87, "17d:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 88: { + LogStep(88, "17d:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 89: { + LogStep(89, "17d:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 90: { + LogStep(90, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 91: { + LogStep(91, "18a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(0U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 92: { + LogStep(92, "18b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 93: { + LogStep(93, "18b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 94: { + LogStep(94, "18b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 95: { + LogStep(95, "19a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(0U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 96: { + LogStep(96, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 97: { + LogStep(97, "19b:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(0U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 98: { + LogStep(98, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 99: { + LogStep(99, "19c:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 100: { + LogStep(100, "19c:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 101: { + LogStep(101, "19c:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 102: { + LogStep(102, "20a:Send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 103: { + LogStep(103, "20b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 104: { + LogStep(104, "20b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 105: { + LogStep(105, "20b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 106: { + LogStep(106, "21a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(0U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 107: { + LogStep(107, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 108: { + LogStep(108, "21b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 109: { + LogStep(109, "21b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 110: { + LogStep(110, "21b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && PICS_SKIP_SAMPLE_APP && OO.S.C42.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 111: { + LogStep(111, "22a:Send On Command"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 112: { + LogStep(112, "22b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 113: { + LogStep(113, "22b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 114: { + LogStep(114, "22b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 115: { + LogStep(115, "Wait 10000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 116: { + LogStep(116, "23a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(0U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 117: { + LogStep(117, "23b:Send Off Command"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 118: { + LogStep(118, "23c:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 119: { + LogStep(119, "23c:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 120: { + LogStep(120, "23c:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 121: { + LogStep(121, "Wait 40000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 40000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 122: { + LogStep(122, "23d:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 123: { + LogStep(123, "23d:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 124: { + LogStep(124, "23d:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 125: { + LogStep(125, "24a:Sends OnWithTimedOff command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type value; + value.onOffControl = static_cast>(0U); + value.onTime = 300U; + value.offWaitTime = 300U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::OnWithTimedOff::Id, value, + chip::NullOptional + + ); + } + case 126: { + LogStep(126, "24b:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 127: { + LogStep(127, "24b:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 128: { + LogStep(128, "24b:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002 && OO.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + case 129: { + LogStep(129, "Wait 40000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 40000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 130: { + LogStep(130, "24c:Reads OnOff attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } + case 131: { + LogStep(131, "24c:Reads OnTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnTime::Id, true, + chip::NullOptional); + } + case 132: { + LogStep(132, "24c:Reads OffWaitTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A4002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OffWaitTime::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPSTATE_2_1Suite : public TestCommand +{ +public: + Test_TC_OPSTATE_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPSTATE_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPSTATE_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPSTATE_2_2Suite : public TestCommand +{ +public: + Test_TC_OPSTATE_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPSTATE_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPSTATE_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OPSTATE_2_3Suite : public TestCommand +{ +public: + Test_TC_OPSTATE_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPSTATE_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPSTATE_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RH_2_2Suite : public TestCommand +{ +public: + Test_TC_RH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_2_2", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RH_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable ValueBeforeChange; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + ValueBeforeChange = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, ValueBeforeChange)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Reads constraints of attribute: MinMeasuredValue"); + VerifyOrDo(!ShouldSkip("RH.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Reads constraints of attribute: MaxMeasuredValue"); + VerifyOrDo(!ShouldSkip("RH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Reads MeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("RH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Operate on device to change the relative humidity significantly"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && RH.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 6: Read the mandatory attribute: MeasuredValue"); + VerifyOrDo(!ShouldSkip("RH.S.A0000 && RH.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_REFALM_2_1Suite : public TestCommand +{ +public: + Test_TC_REFALM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_REFALM_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_REFALM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_REFALM_2_2Suite : public TestCommand +{ +public: + Test_TC_REFALM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_REFALM_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_REFALM_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_REFALM_2_3Suite : public TestCommand +{ +public: + Test_TC_REFALM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_REFALM_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_REFALM_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RVCCLEANM_3_3Suite : public TestCommand +{ +public: + Test_TC_RVCCLEANM_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RVCCLEANM_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RVCCLEANM_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RVCOPSTATE_2_2Suite : public TestCommand +{ +public: + Test_TC_RVCOPSTATE_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RVCOPSTATE_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RVCOPSTATE_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RVCRUNM_1_1Suite : public TestCommand +{ +public: + Test_TC_RVCRUNM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RVCRUNM_1_1", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RVCRUNM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3a: TH reads the FeatureMap attribute from the DUT"); + VerifyOrDo(!ShouldSkip(" !RVCRUNM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3b: Given RVCRUNM.S.F00(DEPONOFF) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RVCRUNM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4a: TH reads the AttributeList attribute from the DUT"); + VerifyOrDo(!ShouldSkip("!PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4b: TH reads the optional attribute(StartUpMode) in AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("RVCRUNM.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "Step 4c: Read the Feature dependent(RVCRUNM.S.F00 - DEPONOFF) and optional attribute(OnMode) is in " + "AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("RVCRUNM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, + "Step 4d: Read the Feature dependent(RVCRUNM.S.F00 - DEPONOFF) and optional attribute(OnMode) is not in " + "AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip(" !RVCRUNM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, + "Step 4e: Check for mandatory attributes in AttributeList. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2.The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 10: { + LogStep(10, "Step 5a: Read the global attribute: EventList from the DUT"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, + "Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any additional values in " + "the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. The list MAY " + "contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), where XXXX " + "is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any " + "values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 12: { + LogStep(12, "Step 6a: Read the global attribute AcceptedCommandList. Check if it contains id 0x0 (ChangeToMode)"); + VerifyOrDo(!ShouldSkip("RVCRUNM.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::AcceptedCommandList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, + "Step 6b: Read the global attribute AcceptedCommandList. 1. The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, + "Step 7a: Read the global attribute: GeneratedCommandList. Check if it contains id 0x1 (ChangeToModeResponse)"); + VerifyOrDo(!ShouldSkip("RVCRUNM.S.C01.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RvcRunMode::Id, RvcRunMode::Attributes::GeneratedCommandList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 7b: Read the global attribute: GeneratedCommandList. 1.The list SHALL NOT contain any additional values " + "in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RVCRUNM_3_1Suite : public TestCommand +{ +public: + Test_TC_RVCRUNM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RVCRUNM_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RVCRUNM_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RVCRUNM_3_3Suite : public TestCommand +{ +public: + Test_TC_RVCRUNM_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RVCRUNM_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RVCRUNM_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SWTCH_2_2Suite : public TestCommand +{ +public: + Test_TC_SWTCH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SWTCH_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SWTCH_3_2Suite : public TestCommand +{ +public: + Test_TC_SWTCH_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SWTCH_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCCM_1_2Suite : public TestCommand +{ +public: + Test_TC_TCCM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCCM_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCCM_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCCM_2_1Suite : public TestCommand +{ +public: + Test_TC_TCCM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCCM_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCCM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCCM_3_1Suite : public TestCommand +{ +public: + Test_TC_TCCM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCCM_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCCM_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCCM_3_2Suite : public TestCommand +{ +public: + Test_TC_TCCM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCCM_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCCM_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCCM_3_3Suite : public TestCommand +{ +public: + Test_TC_TCCM_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCCM_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCCM_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_2_1Suite : public TestCommand +{ +public: + Test_TC_TCTL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCTL_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCTL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_2_2Suite : public TestCommand +{ +public: + Test_TC_TCTL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCTL_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCTL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_2_3Suite : public TestCommand +{ +public: + Test_TC_TCTL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCTL_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCTL_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_3_2Suite : public TestCommand +{ +public: + Test_TC_TCTL_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCTL_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCTL_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_3_3Suite : public TestCommand +{ +public: + Test_TC_TCTL_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TCTL_3_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCTL_3_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TMP_2_2Suite : public TestCommand +{ +public: + Test_TC_TMP_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TMP_2_2", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TMP_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable valueBeforeChange; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + valueBeforeChange = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintNotValue("value", value, valueBeforeChange)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read the mandatory attribute: MinMeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read the mandatory attribute: MaxMeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: Reads MeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("TMP.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: Operate on device to change the temperature significantly"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TMP.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Step 6: Read the mandatory attribute: MeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0000 && TMP.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TSTAT_3_2Suite : public TestCommand +{ +public: + Test_TC_TSTAT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TSTAT_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGTHREAD_2_5Suite : public TestCommand +{ +public: + Test_TC_DGTHREAD_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_2_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGTHREAD_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACT_2_1Suite : public TestCommand +{ +public: + Test_TC_ACT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACT_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACT_2_2Suite : public TestCommand +{ +public: + Test_TC_ACT_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACT_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACT_3_2Suite : public TestCommand +{ +public: + Test_TC_ACT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACT_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BIND_2_1Suite : public TestCommand +{ +public: + Test_TC_BIND_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BIND_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BIND_2_2Suite : public TestCommand +{ +public: + Test_TC_BIND_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BIND_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BIND_2_3Suite : public TestCommand +{ +public: + Test_TC_BIND_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BIND_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_S_1_1Suite : public TestCommand +{ +public: + Test_TC_S_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_1_1", 17, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_S_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 40UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 42UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 40UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 42UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 40UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 42UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: Read ClusterRevision (global attribute 65533)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: Read FeatureMap (global attribute 65532)"); + VerifyOrDo(!ShouldSkip("(!S.S.F00)"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 3: Read FeatureMap (global attribute 65532)"); + VerifyOrDo(!ShouldSkip("S.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is true"); + VerifyOrDo(!ShouldSkip("S.S.A0005 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is true"); + VerifyOrDo(!ShouldSkip("S.S.A0005 && !PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is false"); + VerifyOrDo(!ShouldSkip(" !S.S.A0005 && PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is false"); + VerifyOrDo(!ShouldSkip(" !S.S.A0005 && !PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 5: Read EventList (global attribute 65530)"); + VerifyOrDo(!ShouldSkip("PICS_EVENT_LIST_ENABLED"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 6a: Read AcceptedCommandList (global attribute 65529)"); + VerifyOrDo(!ShouldSkip("S.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Step 6b: Read AcceptedCommandList (global attribute 65529)"); + VerifyOrDo(!ShouldSkip("(!S.S.C40.Rsp)"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Step 6c: Read AcceptedCommandList (global attribute 65529)"); + VerifyOrDo(!ShouldSkip("S.C.C40.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Step 6d: Read AcceptedCommandList (global attribute 65529)"); + VerifyOrDo(!ShouldSkip("(!S.C.C40.Tx)"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Step 7a: Read GeneratedCommandList (global attribute 65528)"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, + "Step 7b: Read optional command(EnhancedAddSceneResponse) in GeneratedCommandList (global attribute 65528)"); + VerifyOrDo(!ShouldSkip("S.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, + "Step 7c: Read optional command(EnhancedViewSceneResponse) in GeneratedCommandList (global attribute 65528)"); + VerifyOrDo(!ShouldSkip("S.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Step 7d: Read optional command(CopySceneResponse) in GeneratedCommandList (global attribute 65528)"); + VerifyOrDo(!ShouldSkip("S.S.C42.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_S_2_1Suite : public TestCommand +{ +public: + Test_TC_S_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_S_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::GroupId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "group_id", "groupid")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "int8u")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("nameSupport", value, 128U)); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "int8u")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("nameSupport", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "bitmap8", "int8u")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "node_id", "nodeId")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "uint16")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int8u", "int8u")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 1: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Step 2: TH reads from the DUT the (0x0000) SceneCount attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::SceneCount::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Step 3: TH reads from the DUT the (0x0001) CurrentScene attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::CurrentScene::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Step 4: TH reads from the DUT the (0x0002) CurrentGroup attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::CurrentGroup::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Step 5: TH reads from the DUT the (0x0003) SceneValid attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::SceneValid::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the (0x0004) NameSupport attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0003 && S.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::NameSupport::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Step 6: TH reads from the DUT the (0x0004) NameSupport attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0004 && (!S.S.F00)"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::NameSupport::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Step 7: TH reads from the DUT the (0x0005) LastConfiguredBy attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::LastConfiguredBy::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Step 8: TH reads from the DUT the (0x0006) SceneTableSize attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::SceneTableSize::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Step 9: TH reads from the DUT the (0x0007) RemainingCapacity attribute"); + VerifyOrDo(!ShouldSkip("S.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Scenes::Id, Scenes::Attributes::RemainingCapacity::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_S_2_5Suite : public TestCommand +{ +public: + Test_TC_S_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_S_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_S_2_6Suite : public TestCommand +{ +public: + Test_TC_S_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_S_2_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRBINFO_2_2Suite : public TestCommand +{ +public: + Test_TC_BRBINFO_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRBINFO_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRBINFO_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRBINFO_3_1Suite : public TestCommand +{ +public: + Test_TC_BRBINFO_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRBINFO_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRBINFO_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WASHERCTRL_1_1Suite : public TestCommand +{ +public: + Test_TC_WASHERCTRL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WASHERCTRL_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WASHERCTRL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WASHERCTRL_2_1Suite : public TestCommand +{ +public: + Test_TC_WASHERCTRL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WASHERCTRL_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WASHERCTRL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WASHERCTRL_2_2Suite : public TestCommand +{ +public: + Test_TC_WASHERCTRL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WASHERCTRL_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WASHERCTRL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WASHERCTRL_3_1Suite : public TestCommand +{ +public: + Test_TC_WASHERCTRL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WASHERCTRL_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WASHERCTRL_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WASHERCTRL_3_2Suite : public TestCommand +{ +public: + Test_TC_WASHERCTRL_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WASHERCTRL_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WASHERCTRL_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + +#endif // CONFIG_ENABLE_YAML_TESTS + +void registerCommandsTests(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + const char * clusterName = "Tests"; + + commands_list clusterCommands = { +#if CONFIG_ENABLE_YAML_TESTS + make_unique(), + make_unique(), + make_unique(), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), +#endif // CONFIG_ENABLE_YAML_TESTS + }; + + commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for running YAML tests."); +} diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index a8187fa9090b1b..62ea532083258f 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -103,15 +103,14 @@ class TestList : public Command { printf("Test_TC_FAN_2_2\n"); printf("Test_TC_FAN_2_3\n"); printf("Test_TC_FAN_2_4\n"); - printf("Test_TC_FAN_2_5\n"); printf("Test_TC_FAN_3_1\n"); printf("Test_TC_FAN_3_2\n"); printf("Test_TC_FAN_3_6\n"); printf("Test_TC_CGEN_1_1\n"); printf("Test_TC_CGEN_2_1\n"); printf("Test_TC_DGGEN_1_1\n"); - printf("Test_TC_DGGEN_2_1\n"); printf("Test_TC_GRPKEY_1_1\n"); + printf("Test_TC_GRPKEY_2_2\n"); printf("Test_TC_ICDM_1_1\n"); printf("Test_TC_I_1_1\n"); printf("Test_TC_I_2_1\n"); @@ -132,6 +131,9 @@ class TestList : public Command { printf("Test_TC_LUNIT_1_2\n"); printf("Test_TC_LUNIT_3_1\n"); printf("Test_TC_LTIME_1_2\n"); + printf("Test_TC_LTIME_3_1\n"); + printf("Test_TC_LWM_1_1\n"); + printf("Test_TC_LWM_2_1\n"); printf("Test_TC_LOWPOWER_1_1\n"); printf("Test_TC_KEYPADINPUT_1_2\n"); printf("Test_TC_APPLAUNCHER_1_3\n"); @@ -190,12 +192,15 @@ class TestList : public Command { printf("Test_TC_PCC_2_2\n"); printf("Test_TC_PCC_2_3\n"); printf("Test_TC_PCC_2_4\n"); + printf("Test_TC_REFALM_1_1\n"); printf("Test_TC_RH_1_1\n"); printf("Test_TC_RH_2_1\n"); printf("Test_TC_SMOKECO_1_1\n"); printf("Test_TC_SMOKECO_2_1\n"); printf("Test_TC_SWTCH_1_1\n"); printf("Test_TC_RVCOPSTATE_1_1\n"); + printf("Test_TC_TCCM_1_1\n"); + printf("Test_TC_TCTL_1_1\n"); printf("Test_TC_TMP_1_1\n"); printf("Test_TC_TMP_2_1\n"); printf("Test_TC_TSTAT_1_1\n"); @@ -47638,7 +47643,7 @@ class Test_TC_DLOG_1_1 : public TestCommandBridge { break; case 5: ChipLogProgress(chipTool, - " ***** Test Step 5 : Step 4b: TTH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any " + " ***** Test Step 5 : Step 4b: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any " "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) " "2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT " @@ -47648,7 +47653,7 @@ class Test_TC_DLOG_1_1 : public TestCommandBridge { NextTest(); return; } - err = TestStep4bTthReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_5(); + err = TestStep4bThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_5(); break; case 6: ChipLogProgress(chipTool, @@ -47871,7 +47876,7 @@ class Test_TC_DLOG_1_1 : public TestCommandBridge { } CHIP_ERROR - TestStep4bTthReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_5() + TestStep4bThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_5() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -52485,121 +52490,6 @@ class Test_TC_FAN_2_4 : public TestCommandBridge { } }; -class Test_TC_FAN_2_5 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_FAN_2_5() - : TestCommandBridge("Test_TC_FAN_2_5") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_FAN_2_5() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FAN_2_5\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FAN_2_5\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the the AirflowDirection attribute\n"); - if (ShouldSkip("FAN.S.F05")) { - NextTest(); - return; - } - err = TestStep2ThReadsFromTheDutTheTheAirflowDirectionAttribute_1(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestStep2ThReadsFromTheDutTheTheAirflowDirectionAttribute_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterFanControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAirflowDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads from the DUT the the AirflowDirection attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("airflowDirection", "enum8", "enum8")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class Test_TC_FAN_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -54878,497 +54768,6 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { } }; -class Test_TC_DGGEN_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGGEN_2_1() - : TestCommandBridge("Test_TC_DGGEN_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_DGGEN_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads NetworkInterfaces structure attribute from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0000")) { - NextTest(); - return; - } - err = TestStep2ThReadsNetworkInterfacesStructureAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads a RebootCount attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0001")) { - NextTest(); - return; - } - err = TestStep3ThReadsARebootCountAttributeValueFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3a: Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep3aRebootTargetDevice_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 3b: Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep3bRebootTargetDeviceDUT_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 3c: Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep3cRebootTargetDevice_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 3d: Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep3dRebootTargetDeviceDUT_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Step 4: DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start " - "time of DUT rebooting.\n"); - if (ShouldSkip("DGGEN.S.A0002")) { - NextTest(); - return; - } - err = TestStep4DutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads a TotalOperationalHours attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0003")) { - NextTest(); - return; - } - err = TestThReadsATotalOperationalHoursAttributeValueFromDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6a: Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep6aRebootTargetDevice_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 6: TH reads BootReason attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0004")) { - NextTest(); - return; - } - err = TestStep6ThReadsBootReasonAttributeValueFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Step 7: TH reads ActiveHardwareFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0005")) { - NextTest(); - return; - } - err = TestStep7ThReadsActiveHardwareFaultsAttributeValueFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 8: TH reads ActiveRadioFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0006")) { - NextTest(); - return; - } - err = TestStep8ThReadsActiveRadioFaultsAttributeValueFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Step 9: TH reads ActiveNetworkFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0007")) { - NextTest(); - return; - } - err = TestStep9ThReadsActiveNetworkFaultsAttributeValueFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 10: TH reads TestEventTriggersEnabled attribute value\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0008")) { - NextTest(); - return; - } - err = TestStep10ThReadsTestEventTriggersEnabledAttributeValue_17(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestStep2ThReadsNetworkInterfacesStructureAttributeFromDut_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeNetworkInterfacesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads NetworkInterfaces structure attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("networkInterfaces", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3ThReadsARebootCountAttributeValueFromDut_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRebootCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads a RebootCount attribute value from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("rebootCount", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("rebootCount", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("rebootCount", [value unsignedShortValue], 65535U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3aRebootTargetDevice_3() - { - - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestStep3bRebootTargetDeviceDUT_4() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep3cRebootTargetDevice_5() - { - - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestStep3dRebootTargetDeviceDUT_6() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_7() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestStep4DutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeUpTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of DUT " - @"rebooting. Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("upTime", "int64u", "int64u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsATotalOperationalHoursAttributeValueFromDut_9() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTotalOperationalHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads a TotalOperationalHours attribute value from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("totalOperationalHours", "int32u", "int32u")); - VerifyOrReturn(CheckConstraintMinValue("totalOperationalHours", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("totalOperationalHours", [value unsignedIntValue], 4294967294UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6aRebootTargetDevice_10() - { - - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_11() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_12() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestStep6ThReadsBootReasonAttributeValueFromDut_13() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeBootReasonWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: TH reads BootReason attribute value from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintMinValue("bootReason", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("bootReason", [value unsignedCharValue], 6U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep7ThReadsActiveHardwareFaultsAttributeValueFromDut_14() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep8ThReadsActiveRadioFaultsAttributeValueFromDut_15() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep9ThReadsActiveNetworkFaultsAttributeValueFromDut_16() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep10ThReadsTestEventTriggersEnabledAttributeValue_17() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; - class Test_TC_GRPKEY_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -55855,11 +55254,11 @@ class Test_TC_GRPKEY_1_1 : public TestCommandBridge { } }; -class Test_TC_ICDM_1_1 : public TestCommandBridge { +class Test_TC_GRPKEY_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ICDM_1_1() - : TestCommandBridge("Test_TC_ICDM_1_1") + Test_TC_GRPKEY_2_2() + : TestCommandBridge("Test_TC_GRPKEY_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -55869,7 +55268,7 @@ class Test_TC_ICDM_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_ICDM_1_1() {} + ~Test_TC_GRPKEY_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -55877,11 +55276,11 @@ class Test_TC_ICDM_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ICDM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_GRPKEY_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ICDM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GRPKEY_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -55894,175 +55293,329 @@ class Test_TC_ICDM_1_1 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 0: Wait for the commissioned device to be retrieved\n"); + err = TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads ClusterRevision attribute from DUT\n"); - err = TestStep2ThReadsClusterRevisionAttributeFromDut_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : Step 1: TH reads MaxGroupKeysPerFabric attribute from GroupKeyManagement cluster on DUT " + "using a fabric-filtered read. Save the value as Max_GrpKey for future use.\n"); + if (ShouldSkip("GRPKEY.S.A0003")) { + NextTest(); + return; + } + err = TestStep1ThReadsMaxGroupKeysPerFabricAttributeFromGroupKeyManagementClusterOnDutUsingAFabricFilteredReadSaveTheValueAsMaxGrpKeyForFutureUse_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads FeatureMap attribute from DUT\n"); - if (ShouldSkip("ICDM.S.F00")) { + ChipLogProgress( + chipTool, " ***** Test Step 2 : Step 2: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep3ThReadsFeatureMapAttributeFromDut_2(); + err = TestStep2ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads FeatureMap attribute from DUT\n"); - if (ShouldSkip(" !ICDM.S.F00 ")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : Step 3: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as " + "0x01a\n"); + if (ShouldSkip("GRPKEY.S.C01.Rsp")) { NextTest(); return; } - err = TestStep3ThReadsFeatureMapAttributeFromDut_3(); + err = TestStep3ThSendsKeySetReadCommandToGroupKeyManagementClusterWithGroupKeySetIDAs0x01a_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads AttributeList attribute from DUT\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 4 : Step 4: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep4aThReadsAttributeListAttributeFromDut_4(); + err = TestStep4ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutOnEp0_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads AttributeList attribute from DUT\n"); - if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 5 : Step 5: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep4aThReadsAttributeListAttributeFromDut_5(); + err = TestStep5ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutOnEp0_5(); break; case 6: ChipLogProgress( - chipTool, " ***** Test Step 6 : Step 4b: Read the optional attribute(RegisteredClients) in AttributeList\n"); - if (ShouldSkip("ICDM.S.A0003")) { + chipTool, " ***** Test Step 6 : Step 6: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep4bReadTheOptionalAttributeRegisteredClientsInAttributeList_6(); + err = TestStep6ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4c: Read the optional attribute(IcdCounter) in AttributeList\n"); - if (ShouldSkip("ICDM.S.A0004")) { + ChipLogProgress( + chipTool, " ***** Test Step 7 : Step 7: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep4cReadTheOptionalAttributeIcdCounterInAttributeList_7(); + err = TestStep7ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Step 4d: Read the optional attribute(ClientsSupportedPerFabric) in AttributeList\n"); - if (ShouldSkip("ICDM.S.A0005")) { + ChipLogProgress( + chipTool, " ***** Test Step 8 : Step 8: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep4dReadTheOptionalAttributeClientsSupportedPerFabricInAttributeList_8(); + err = TestStep8ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_8(); break; case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : Step 4e: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any " - "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) " - "2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " - "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT " - "contain any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 " - "- 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress( + chipTool, " ***** Test Step 9 : Step 9: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep4eThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_9(); + err = TestStep9ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 5a: Read the global attribute: EventList\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 10 : Step 10: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - NextTest(); - return; + err = TestStep10ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_10(); + break; case 11: ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any " - "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. " - "The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " - "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT " - "contain any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 " - "- 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); - if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { + " ***** Test Step 11 : Step 11: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + "EpochStartTime1 is earlier than EpochStartTime0\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep5bThReadsFromTheDutTheEventListAttribute1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11(); + err = TestStep11ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochStartTime1IsEarlierThanEpochStartTime0_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Step 6a: TH reads AcceptedCommandList attribute from DUT\n"); - if (ShouldSkip(" !ICDM.S.F00 && !ICDM.S.C03.Rsp ")) { + ChipLogProgress(chipTool, + " ***** Test Step 12 : Step 12: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + "EpochKey1 and EpochStartTime1 are null when EpochKey2 and EpochStartTime2 are not null\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep6aThReadsAcceptedCommandListAttributeFromDut_12(); + err = TestStep12ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochKey1AndEpochStartTime1AreNullWhenEpochKey2AndEpochStartTime2AreNotNull_12(); break; case 13: - ChipLogProgress( - chipTool, " ***** Test Step 13 : Step 6b: TH reads AcceptedCommandList attribute from DUT if ICDM.S.F00 is true\n"); - if (ShouldSkip("ICDM.S.F00")) { + ChipLogProgress(chipTool, + " ***** Test Step 13 : Step 13: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + "EpochKey2 is set to null and EpochStartTime2 is not null\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep6bThReadsAcceptedCommandListAttributeFromDutIfIcdmsf00IsTrue_13(); + err = TestStep13ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochKey2IsSetToNullAndEpochStartTime2IsNotNull_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Step 6c: Read the optional command (StayActiveRequest) in AttributeList\n"); - if (ShouldSkip("ICDM.S.C03.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 14 : Step 14: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + "EpochKey2 is not null and EpochStartTime2 is null\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep6cReadTheOptionalCommandStayActiveRequestInAttributeList_14(); + err = TestStep14ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochKey2IsNotNullAndEpochStartTime2IsNull_14(); break; case 15: ChipLogProgress(chipTool, - " ***** Test Step 15 : Step 6d: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any " - "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in " - "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " - "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test Vendor " - "or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " - "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + " ***** Test Step 15 : Step 15: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + "EpochStartTime2 is earlier than EpochStartTime1\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep6dThReadsAcceptedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_15(); + err = TestStep15ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochStartTime2IsEarlierThanEpochStartTime1_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Step 7a: TH reads GeneratedCommandList attribute from DUT\n"); - if (ShouldSkip(" !ICDM.S.F00 ")) { + ChipLogProgress(chipTool, + " ***** Test Step 16 : Step 16: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep7aThReadsGeneratedCommandListAttributeFromDut_16(); + err = TestStep16ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 7a: TH reads GeneratedCommandList attribute from DUT\n"); - if (ShouldSkip("ICDM.S.F00")) { + ChipLogProgress( + chipTool, " ***** Test Step 17 : Step 16: Repeat the step by sending EpochKey1 with 1 byte value (< 16 bytes)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep7aThReadsGeneratedCommandListAttributeFromDut_17(); + err = TestStep16RepeatTheStepBySendingEpochKey1With1ByteValue16Bytes_17(); break; case 18: ChipLogProgress(chipTool, - " ***** Test Step 18 : Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in " - "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " - "range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test " - "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " - "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + " ***** Test Step 18 : Step 16: Note: Repeat the step by sending EpochKey2 with 1 byte value (< 16 bytes)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { NextTest(); return; } - err = TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_18(); + err = TestStep16NoteRepeatTheStepBySendingEpochKey2With1ByteValue16Bytes_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Step 16a: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + "Repeat step 16 by sending KeySetWrite Command with EpochKey0, EpochKey1 and EpochKey2 having 15 bytes value (< 16 " + "byte)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep16aThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteRepeatStep16BySendingKeySetWriteCommandWithEpochKey0EpochKey1AndEpochKey2Having15BytesValue16Byte_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Step 16a: Repeat step 16a by sending KeySetWrite Command with EpochKey1 having 15 bytes " + "value (< 16 byte)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep16aRepeatStep16aBySendingKeySetWriteCommandWithEpochKey1Having15BytesValue16Byte_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Step 16a: Repeat step 16a by sending KeySetWrite Command with EpochKey2 having 15 bytes " + "value (< 16 byte)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep16aRepeatStep16aBySendingKeySetWriteCommandWithEpochKey2Having15BytesValue16Byte_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Step 16b: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + "Repeat step 16 by sending KeySetWrite Command with EpochKey0, EpochKey1 and EpochKey2 having 17 bytes value (> 16 " + "bytes)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep16bThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteRepeatStep16BySendingKeySetWriteCommandWithEpochKey0EpochKey1AndEpochKey2Having17BytesValue16Bytes_22(); + break; + case 23: + ChipLogProgress(chipTool, + " ***** Test Step 23 : Step 16b: Repeat step 16 by sending KeySetWrite Command with EpochKey1 having 17 bytes " + "value (> 16 bytes)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep16bRepeatStep16BySendingKeySetWriteCommandWithEpochKey1Having17BytesValue16Bytes_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Step 16b: Repeat step 16 by sending KeySetWrite Command with EpochKey2 having 17 bytes " + "value (> 16 bytes)\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep16bRepeatStep16BySendingKeySetWriteCommandWithEpochKey2Having17BytesValue16Bytes_24(); + break; + case 25: + ChipLogProgress(chipTool, + " ***** Test Step 25 : Step 17: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0. " + "Note: KeySetWrite command is sent with different EpochKeys,EpochStartTime1 and EpochStartTime2 values\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep17ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutOnEp0NoteKeySetWriteCommandIsSentWithDifferentEpochKeysEpochStartTime1AndEpochStartTime2Values_25(); + break; + case 26: + ChipLogProgress(chipTool, + " ***** Test Step 26 : Step 18: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as " + "0x01a\n"); + if (ShouldSkip("GRPKEY.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestStep18ThSendsKeySetReadCommandToGroupKeyManagementClusterWithGroupKeySetIDAs0x01a_26(); + break; + case 27: + ChipLogProgress(chipTool, + " ***** Test Step 27 : Step 19: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as " + "0x01b that does not exist in the GroupKeyMap attribute list.\n"); + if (ShouldSkip("GRPKEY.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestStep19ThSendsKeySetReadCommandToGroupKeyManagementClusterWithGroupKeySetIDAs0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_27(); + break; + case 28: + ChipLogProgress(chipTool, + " ***** Test Step 28 : Step 20: TH removes the Group key set that was added by sending a KeySetRemove command to " + "the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a.\n"); + if (ShouldSkip("GRPKEY.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestStep20ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01a_28(); + break; + case 29: + ChipLogProgress(chipTool, + " ***** Test Step 29 : Step 21: TH sends KeySetWrite command to DUT until size of list for TH’s fabric in " + "GroupKeyMap attribute contains Max_GrpKey entries, starting with GroupKeySetID 1 and incrementing by 1 each " + "time.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestStep21ThSendsKeySetWriteCommandToDutUntilSizeOfListForTHsFabricInGroupKeyMapAttributeContainsMaxGrpKeyEntriesStartingWithGroupKeySetID1AndIncrementingBy1EachTime_29(); + break; + case 30: + ChipLogProgress(chipTool, + " ***** Test Step 30 : Step 23: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used " + "yet.\n"); + if (ShouldSkip("GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestStep23ThAgainSendsKeySetWriteCommandToDutWithAnyOtherGroupKeySetIDNotUsedYet_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Step 24: TH sends KeySetReadAllIndices command to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C05.Rsp && PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestStep24ThSendsKeySetReadAllIndicesCommandToDut_31(); + break; + case 32: + ChipLogProgress(chipTool, + " ***** Test Step 32 : Step 22: TH removes the Group key set that was added by sending a KeySetRemove command to " + "the GroupKeyManagement cluster with the GroupKeySetID field set to 0x0\n"); + if (ShouldSkip("GRPKEY.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestStep22ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x0_32(); + break; + case 33: + ChipLogProgress(chipTool, + " ***** Test Step 33 : Step 23: TH removes the Group key set that was added by sending a KeySetRemove command to " + "the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01b that does not exist in the GroupKeyMap " + "attribute list.\n"); + if (ShouldSkip("GRPKEY.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestStep23ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_33(); break; } @@ -56094,44 +55647,89 @@ class Test_TC_ICDM_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + break; + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; } // Go on to the next test. @@ -56145,865 +55743,1348 @@ class Test_TC_ICDM_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 34; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } + NSNumber * _Nonnull Max_GrpKey; - CHIP_ERROR TestStep2ThReadsClusterRevisionAttributeFromDut_1() + CHIP_ERROR + TestStep1ThReadsMaxGroupKeysPerFabricAttributeFromGroupKeyManagementClusterOnDutUsingAFabricFilteredReadSaveTheValueAsMaxGrpKeyForFutureUse_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads ClusterRevision attribute from DUT Error: %@", err); + [cluster readAttributeMaxGroupKeysPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1: TH reads MaxGroupKeysPerFabric attribute from GroupKeyManagement cluster on DUT using a " + @"fabric-filtered read. Save the value as Max_GrpKey for future use. Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + Max_GrpKey = value; } - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ThReadsFeatureMapAttributeFromDut_2() + CHIP_ERROR TestStep2ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads FeatureMap attribute from DUT Error: %@", err); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ThReadsFeatureMapAttributeFromDut_3() + CHIP_ERROR TestStep3ThSendsKeySetReadCommandToGroupKeyManagementClusterWithGroupKeySetIDAs0x01a_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads FeatureMap attribute from DUT Error: %@", err); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:26U]; + [cluster keySetReadWithParams:params + completion:^( + MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Step 3: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as " + @"0x01a Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } + { + id actualValue = values.groupKeySet; + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 26U)); + VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 0U)); + VerifyOrReturn(CheckValueNull( + "EpochKey0", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); + VerifyOrReturn(CheckValueNonNull("EpochStartTime0", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); + VerifyOrReturn(CheckValue("EpochStartTime0", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 1ULL)); + VerifyOrReturn(CheckValueNull( + "EpochKey1", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); + VerifyOrReturn(CheckValueNonNull("EpochStartTime1", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); + VerifyOrReturn(CheckValue("EpochStartTime1", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, + 18446744073709551613ULL)); + VerifyOrReturn(CheckValueNull( + "EpochKey2", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); + VerifyOrReturn(CheckValueNonNull("EpochStartTime2", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); + VerifyOrReturn(CheckValue("EpochStartTime2", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, + 18446744073709551614ULL)); + } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsAttributeListAttributeFromDut_4() + CHIP_ERROR TestStep4ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutOnEp0_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads AttributeList attribute from DUT Error: %@", err); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = nil; - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0. Error: %@", + err); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsAttributeListAttributeFromDut_5() + CHIP_ERROR TestStep5ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutOnEp0_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads AttributeList attribute from DUT Error: %@", err); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = nil; - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0. Error: %@", + err); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bReadTheOptionalAttributeRegisteredClientsInAttributeList_6() + CHIP_ERROR TestStep6ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: Read the optional attribute(RegisteredClients) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4cReadTheOptionalAttributeIcdCounterInAttributeList_7() + CHIP_ERROR TestStep7ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4c: Read the optional attribute(IcdCounter) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 7: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4dReadTheOptionalAttributeClientsSupportedPerFabricInAttributeList_8() + CHIP_ERROR TestStep8ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4d: Read the optional attribute(ClientsSupportedPerFabric) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 8: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep4eThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_9() + CHIP_ERROR TestStep9ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_9() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR - TestStep5bThReadsFromTheDutTheEventListAttribute1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11() - { + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 9: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6aThReadsAcceptedCommandListAttributeFromDut_12() + CHIP_ERROR TestStep10ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_10() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6a: TH reads AcceptedCommandList attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 10: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Error: %@", err); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6bThReadsAcceptedCommandListAttributeFromDutIfIcdmsf00IsTrue_13() + CHIP_ERROR + TestStep11ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochStartTime1IsEarlierThanEpochStartTime0_11() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6b: TH reads AcceptedCommandList attribute from DUT if ICDM.S.F00 is true Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 11: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + @"EpochStartTime1 is earlier than EpochStartTime0 Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6cReadTheOptionalCommandStayActiveRequestInAttributeList_14() + CHIP_ERROR + TestStep12ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochKey1AndEpochStartTime1AreNullWhenEpochKey2AndEpochStartTime2AreNotNull_12() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6c: Read the optional command (StayActiveRequest) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 12: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochKey1 " + @"and EpochStartTime1 are null when EpochKey2 and EpochStartTime2 are not null Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } CHIP_ERROR - TestStep6dThReadsAcceptedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_15() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep7aThReadsGeneratedCommandListAttributeFromDut_16() + TestStep13ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochKey2IsSetToNullAndEpochStartTime2IsNotNull_13() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7a: TH reads GeneratedCommandList attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = nil; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 13: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochKey2 " + @"is set to null and EpochStartTime2 is not null Error: %@", + err); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7aThReadsGeneratedCommandListAttributeFromDut_17() + CHIP_ERROR + TestStep14ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochKey2IsNotNullAndEpochStartTime2IsNull_14() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7a: TH reads GeneratedCommandList attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = nil; - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 14: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: EpochKey2 " + @"is not null and EpochStartTime2 is null Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } CHIP_ERROR - TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_18() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; - -class Test_TC_I_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_1_1() - : TestCommandBridge("Test_TC_I_1_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override + TestStep15ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteEpochStartTime2IsEarlierThanEpochStartTime1_15() { - CHIP_ERROR err = CHIP_NO_ERROR; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - Wait(); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 15: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: " + @"EpochStartTime2 is earlier than EpochStartTime1 Error: %@", + err); - // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the ClusterRevision attribute from the DUT\n"); - err = TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the FeatureMap attribute from the DUT\n"); - err = TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads AttributeList from DUT\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { - NextTest(); - return; - } - err = TestStep4ThReadsAttributeListFromDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH reads AttributeList from DUT\n"); - if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { - NextTest(); - return; - } - err = TestStep4ThReadsAttributeListFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: Read the global attribute: AcceptedCommandList\n"); - err = TestStep5ReadTheGlobalAttributeAcceptedCommandList_5(); - break; - case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Step 6: Read the optional command(TriggerEffect) in AcceptedCommandList\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestStep6ReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6: Read the global attribute: GeneratedCommandList\n"); - err = TestStep6ReadTheGlobalAttributeGeneratedCommandList_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Step 7: Read EventList attribute from the DUT. For this cluster the list is usually empty " - "but it can contain manufacturer specific event IDs.\n"); - if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { - NextTest(); - return; - } - err = TestStep7ReadEventListAttributeFromTheDutForThisClusterTheListIsUsuallyEmptyButItCanContainManufacturerSpecificEventIDs_8(); - break; - } + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestStep16ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDut_16() { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = [[NSData alloc] initWithBytes:"\xd0" + length:1]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Error: %@", err); - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() - { + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1() + CHIP_ERROR TestStep16RepeatTheStepBySendingEpochKey1With1ByteValue16Bytes_17() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = [[NSData alloc] initWithBytes:"\xd1" + length:1]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); - } + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16: Repeat the step by sending EpochKey1 with 1 byte value (< 16 bytes) Error: %@", err); - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2() + CHIP_ERROR TestStep16NoteRepeatTheStepBySendingEpochKey2With1ByteValue16Bytes_18() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads the FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = [[NSData alloc] initWithBytes:"\xd2" + length:1]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16: Note: Repeat the step by sending EpochKey2 with 1 byte value (< 16 bytes) Error: %@", + err); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ThReadsAttributeListFromDut_3() + CHIP_ERROR + TestStep16aThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteRepeatStep16BySendingKeySetWriteCommandWithEpochKey0EpochKey1AndEpochKey2Having15BytesValue16Byte_19() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde" length:15]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16a: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: Repeat " + @"step 16 by sending KeySetWrite Command with EpochKey0, EpochKey1 and EpochKey2 having 15 bytes " + @"value (< 16 byte) Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ThReadsAttributeListFromDut_4() + CHIP_ERROR TestStep16aRepeatStep16aBySendingKeySetWriteCommandWithEpochKey1Having15BytesValue16Byte_20() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde" length:15]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - NextTest(); - }]; + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16a: Repeat step 16a by sending KeySetWrite Command with EpochKey1 having 15 bytes value " + @"(< 16 byte) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5ReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestStep16aRepeatStep16aBySendingKeySetWriteCommandWithEpochKey2Having15BytesValue16Byte_21() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5: Read the global attribute: AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde" length:15]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16a: Repeat step 16a by sending KeySetWrite Command with EpochKey2 having 15 bytes value " + @"(< 16 byte) Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6ReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6() + CHIP_ERROR + TestStep16bThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutNoteRepeatStep16BySendingKeySetWriteCommandWithEpochKey0EpochKey1AndEpochKey2Having17BytesValue16Bytes_22() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: Read the optional command(TriggerEffect) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xde" length:17]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16b: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT. Note: Repeat " + @"step 16 by sending KeySetWrite Command with EpochKey0, EpochKey1 and EpochKey2 having 17 bytes " + @"value (> 16 bytes) Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6ReadTheGlobalAttributeGeneratedCommandList_7() + CHIP_ERROR TestStep16bRepeatStep16BySendingKeySetWriteCommandWithEpochKey1Having17BytesValue16Bytes_23() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: Read the global attribute: GeneratedCommandList Error: %@", err); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xde" length:17]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16b: Repeat step 16 by sending KeySetWrite Command with EpochKey1 having 17 bytes value (> " + @"16 bytes) Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep16bRepeatStep16BySendingKeySetWriteCommandWithEpochKey2Having17BytesValue16Bytes_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xde" length:17]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 16b: Repeat step 16 by sending KeySetWrite Command with EpochKey2 having 17 bytes value (> " + @"16 bytes) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } CHIP_ERROR - TestStep7ReadEventListAttributeFromTheDutForThisClusterTheListIsUsuallyEmptyButItCanContainManufacturerSpecificEventIDs_8() + TestStep17ThSendsKeySetWriteCommandInTheGroupKeyManagementClusterToDutOnEp0NoteKeySetWriteCommandIsSentWithDifferentEpochKeysEpochStartTime1AndEpochStartTime2Values_25() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:26U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd3\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd4\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:17446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd5\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:17446744073709551614ULL]; + + [cluster keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 17: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT on EP0. " + @"Note: KeySetWrite command is sent with different EpochKeys,EpochStartTime1 and " + @"EpochStartTime2 values Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } -}; -class Test_TC_I_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_1() - : TestCommandBridge("Test_TC_I_2_1") - , mTestIndex(0) + CHIP_ERROR TestStep18ThSendsKeySetReadCommandToGroupKeyManagementClusterWithGroupKeySetIDAs0x01a_26() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:26U]; + [cluster keySetReadWithParams:params + completion:^( + MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Step 18: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as " + @"0x01a Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.groupKeySet; + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 26U)); + VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 0U)); + VerifyOrReturn(CheckValueNull( + "EpochKey0", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); + VerifyOrReturn(CheckValueNonNull("EpochStartTime0", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); + VerifyOrReturn(CheckValue("EpochStartTime0", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 1ULL)); + VerifyOrReturn(CheckValueNull( + "EpochKey1", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); + VerifyOrReturn(CheckValueNonNull("EpochStartTime1", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); + VerifyOrReturn(CheckValue("EpochStartTime1", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, + 17446744073709551613ULL)); + VerifyOrReturn(CheckValueNull( + "EpochKey2", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); + VerifyOrReturn(CheckValueNonNull("EpochStartTime2", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); + VerifyOrReturn(CheckValue("EpochStartTime2", + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, + 17446744073709551614ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_2_1() {} + CHIP_ERROR + TestStep19ThSendsKeySetReadCommandToGroupKeyManagementClusterWithGroupKeySetIDAs0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_27() + { - /////////// TestCommand Interface ///////// - void NextTest() override + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:27U]; + [cluster + keySetReadWithParams:params + completion:^( + MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Step 19: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as 0x01b " + @"that does not exist in the GroupKeyMap attribute list. Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep20ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01a_28() { - CHIP_ERROR err = CHIP_NO_ERROR; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:26U]; + [cluster keySetRemoveWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 20: TH removes the Group key set that was added by sending a KeySetRemove command to " + @"the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a. Error: %@", + err); - Wait(); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 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 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the IdentifyTime attribute from the DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestStep2ThReadsTheIdentifyTimeAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the IdentifyType attribute from the DUT\n"); - if (ShouldSkip("I.S.A0001")) { - NextTest(); - return; - } - err = TestStep3ThReadsTheIdentifyTypeAttributeFromTheDut_2(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR + TestStep21ThSendsKeySetWriteCommandToDutUntilSizeOfListForTHsFabricInGroupKeyMapAttributeContainsMaxGrpKeyEntriesStartingWithGroupKeySetID1AndIncrementingBy1EachTime_29() { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestStep23ThAgainSendsKeySetWriteCommandToDutWithAnyOtherGroupKeySetIDNotUsedYet_30() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:3U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xd1\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:18446744073709551613ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xd2\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 23: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used yet. " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep24ThSendsKeySetReadAllIndicesCommandToDut_31() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestStep2ThReadsTheIdentifyTimeAttributeFromTheDut_1() + CHIP_ERROR + TestStep22ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x0_32() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("identifyTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 65535U)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; + [cluster + keySetRemoveWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 22: TH removes the Group key set that was added by sending a KeySetRemove command to the " + @"GroupKeyManagement cluster with the GroupKeySetID field set to 0x0 Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ThReadsTheIdentifyTypeAttributeFromTheDut_2() + CHIP_ERROR + TestStep23ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_33() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads the IdentifyType attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("identifyType", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5U)); + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:27U]; + [cluster + keySetRemoveWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 23: TH removes the Group key set that was added by sending a KeySetRemove command to the " + @"GroupKeyManagement cluster with the GroupKeySetID field set to 0x01b that does not exist in " + @"the GroupKeyMap attribute list. Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_I_2_2 : public TestCommandBridge { +class Test_TC_ICDM_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_2() - : TestCommandBridge("Test_TC_I_2_2") + Test_TC_ICDM_1_1() + : TestCommandBridge("Test_TC_ICDM_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -57013,7 +57094,7 @@ class Test_TC_I_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_2_2() {} + ~Test_TC_ICDM_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -57021,11 +57102,11 @@ class Test_TC_I_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ICDM_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ICDM_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -57042,85 +57123,171 @@ class Test_TC_I_2_2 : public TestCommandBridge { err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : Step 2a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x003c " - "(60s).\n"); - if (ShouldSkip("I.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep2aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads ClusterRevision attribute from DUT\n"); + err = TestStep2ThReadsClusterRevisionAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2b: TH reads immediately IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads FeatureMap attribute from DUT\n"); + if (ShouldSkip("ICDM.S.F00")) { NextTest(); return; } - err = TestStep2bThReadsImmediatelyIdentifyTimeAttributeFromDut_2(); + err = TestStep3ThReadsFeatureMapAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 10000ms\n"); - err = TestWait10000ms_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads FeatureMap attribute from DUT\n"); + if (ShouldSkip(" !ICDM.S.F00 ")) { + NextTest(); + return; + } + err = TestStep3ThReadsFeatureMapAttributeFromDut_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Step 2c: After 10 seconds, the TH reads IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads AttributeList attribute from DUT\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep2cAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4(); + err = TestStep4aThReadsAttributeListAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Step 3: TH sends IdentifyQuery command to DUT and Verify IdentifyQueryResponse command to " - "TH,with the Timeout field set to a value in the range 0x0000 to 0x0032\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads AttributeList attribute from DUT\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep3ThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5(); + err = TestStep4aThReadsAttributeListAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Step 4a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x0000 (stop " - "identifying).\n"); - if (ShouldSkip("I.S.C00.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 6 : Step 4b: Read the optional attribute(RegisteredClients) in AttributeList\n"); + if (ShouldSkip("ICDM.S.A0003")) { NextTest(); return; } - err = TestStep4aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6(); + err = TestStep4bReadTheOptionalAttributeRegisteredClientsInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4b: TH reads immediately IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4c: Read the optional attribute(IcdCounter) in AttributeList\n"); + if (ShouldSkip("ICDM.S.A0004")) { NextTest(); return; } - err = TestStep4bThReadsImmediatelyIdentifyTimeAttributeFromDut_7(); + err = TestStep4cReadTheOptionalAttributeIcdCounterInAttributeList_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : Step 6a: TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT\n"); - if (ShouldSkip("I.S.A0000")) { + ChipLogProgress(chipTool, + " ***** Test Step 8 : Step 4d: Read the optional attribute(ClientsSupportedPerFabric) in AttributeList\n"); + if (ShouldSkip("ICDM.S.A0005")) { NextTest(); return; } - err = TestStep6aThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_8(); + err = TestStep4dReadTheOptionalAttributeClientsSupportedPerFabricInAttributeList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 5000ms\n"); - err = TestWait5000ms_9(); + ChipLogProgress(chipTool, + " ***** Test Step 9 : Step 4e: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) " + "2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " + "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT " + "contain any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 " + "- 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep4eThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_9(); break; case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 5a: Read the global attribute: EventList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 5b: TH reads from the DUT the EventList attribute. 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) 2. " + "The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " + "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3. The list SHALL NOT " + "contain any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 " + "- 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep5bThReadsFromTheDutTheEventListAttribute1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 6a: TH reads AcceptedCommandList attribute from DUT\n"); + if (ShouldSkip(" !ICDM.S.F00 && !ICDM.S.C03.Rsp ")) { + NextTest(); + return; + } + err = TestStep6aThReadsAcceptedCommandListAttributeFromDut_12(); + break; + case 13: ChipLogProgress( - chipTool, " ***** Test Step 10 : Step 6b: After 5 seconds, the TH reads IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { + chipTool, " ***** Test Step 13 : Step 6b: TH reads AcceptedCommandList attribute from DUT if ICDM.S.F00 is true\n"); + if (ShouldSkip("ICDM.S.F00")) { + NextTest(); + return; + } + err = TestStep6bThReadsAcceptedCommandListAttributeFromDutIfIcdmsf00IsTrue_13(); + break; + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : Step 6c: Read the optional command (StayActiveRequest) in AttributeList\n"); + if (ShouldSkip("ICDM.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestStep6cReadTheOptionalCommandStayActiveRequestInAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : Step 6d: TH reads AcceptedCommandList attribute from DUT. 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored.3.The list SHALL NOT contain any values in the Test Vendor " + "or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep6dThReadsAcceptedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Step 7a: TH reads GeneratedCommandList attribute from DUT\n"); + if (ShouldSkip(" !ICDM.S.F00 ")) { + NextTest(); + return; + } + err = TestStep7aThReadsGeneratedCommandListAttributeFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Step 7a: TH reads GeneratedCommandList attribute from DUT\n"); + if (ShouldSkip("ICDM.S.F00")) { + NextTest(); + return; + } + err = TestStep7aThReadsGeneratedCommandListAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestStep6bAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_10(); + err = TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_18(); break; } @@ -57166,6 +57333,30 @@ class Test_TC_I_2_2 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -57179,7 +57370,7 @@ class Test_TC_I_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 19; chip::Optional mNodeId; chip::Optional mCluster; @@ -57194,72 +57385,191 @@ class Test_TC_I_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep2aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1() + CHIP_ERROR TestStep2ThReadsClusterRevisionAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:60U]; - [cluster identifyWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x003c (60s). " - @"Error: %@", - err); + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads ClusterRevision attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2bThReadsImmediatelyIdentifyTimeAttributeFromDut_2() + CHIP_ERROR TestStep3ThReadsFeatureMapAttributeFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2b: TH reads immediately IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads FeatureMap attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 51U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 69U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); + } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_3() + CHIP_ERROR TestStep3ThReadsFeatureMapAttributeFromDut_3() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads FeatureMap attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2cAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4() + CHIP_ERROR TestStep4aThReadsAttributeListAttributeFromDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2c: After 10 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads AttributeList attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 42U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 58U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsAttributeListAttributeFromDut_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads AttributeList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4bReadTheOptionalAttributeRegisteredClientsInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: Read the optional attribute(RegisteredClients) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4cReadTheOptionalAttributeIcdCounterInAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: Read the optional attribute(IcdCounter) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4dReadTheOptionalAttributeClientsSupportedPerFabricInAttributeList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4d: Read the optional attribute(ClientsSupportedPerFabric) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); NextTest(); }]; @@ -57268,7 +57578,18 @@ class Test_TC_I_2_2 : public TestCommandBridge { } CHIP_ERROR - TestStep3ThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5() + TestStep4eThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_9() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestStep5bThReadsFromTheDutTheEventListAttribute1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -57278,45 +57599,45 @@ class Test_TC_I_2_2 : public TestCommandBridge { return UserPrompt("alpha", value); } - CHIP_ERROR TestStep4aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6() + CHIP_ERROR TestStep6aThReadsAcceptedCommandListAttributeFromDut_12() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; - [cluster identifyWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 4a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x0000 (stop " - @"identifying). Error: %@", - err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6a: TH reads AcceptedCommandList attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bThReadsImmediatelyIdentifyTimeAttributeFromDut_7() + CHIP_ERROR TestStep6bThReadsAcceptedCommandListAttributeFromDutIfIcdmsf00IsTrue_13() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: TH reads immediately IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6b: TH reads AcceptedCommandList attribute from DUT if ICDM.S.F00 is true Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("IdentifyTime", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); NextTest(); }]; @@ -57324,64 +57645,100 @@ class Test_TC_I_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6aThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_8() + CHIP_ERROR TestStep6cReadTheOptionalCommandStayActiveRequestInAttributeList_14() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id identifyTimeArgument; - identifyTimeArgument = [NSNumber numberWithUnsignedShort:15U]; - [cluster writeAttributeIdentifyTimeWithValue:identifyTimeArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6a: TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT " - @"Error: %@", - err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6c: Read the optional command (StayActiveRequest) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait5000ms_9() + CHIP_ERROR + TestStep6dThReadsAcceptedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_15() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestStep6bAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_10() + CHIP_ERROR TestStep7aThReadsGeneratedCommandListAttributeFromDut_16() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6b: After 5 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7a: TH reads GeneratedCommandList attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 5U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 15U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7aThReadsGeneratedCommandListAttributeFromDut_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7a: TH reads GeneratedCommandList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR + TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_18() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_I_2_3 : public TestCommandBridge { +class Test_TC_I_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_3() - : TestCommandBridge("Test_TC_I_2_3") + Test_TC_I_1_1() + : TestCommandBridge("Test_TC_I_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -57391,7 +57748,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_2_3() {} + ~Test_TC_I_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -57399,11 +57756,11 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -57420,122 +57777,1051 @@ class Test_TC_I_2_3 : public TestCommandBridge { err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : Step 2a: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 " - "blink and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestStep2aThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the ClusterRevision attribute from the DUT\n"); + err = TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : DUT executes a blink effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutExecutesABlinkEffect_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the FeatureMap attribute from the DUT\n"); + err = TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Step 2b: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " - "breathe and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads AttributeList from DUT\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep2bThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); + err = TestStep4ThReadsAttributeListFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : DUT executes a breathe effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH reads AttributeList from DUT\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestDutExecutesABreatheEffect_4(); + err = TestStep4ThReadsAttributeListFromDut_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Step 2c: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 " - "okay and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestStep2cThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: Read the global attribute: AcceptedCommandList\n"); + err = TestStep5ReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : DUT executes an okay effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 6 : Step 6: Read the optional command(TriggerEffect) in AcceptedCommandList\n"); + if (ShouldSkip("I.S.C40.Rsp")) { NextTest(); return; } - err = TestDutExecutesAnOkayEffect_6(); + err = TestStep6ReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Step 2d: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b " - "channel change and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestStep2dThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6: Read the global attribute: GeneratedCommandList\n"); + err = TestStep6ReadTheGlobalAttributeGeneratedCommandList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : DUT executes a channel change effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutExecutesAChannelChangeEffect_8(); - break; - case 9: ChipLogProgress(chipTool, - " ***** Test Step 9 : Step 2e: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " - "breathe and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { + " ***** Test Step 8 : Step 7: Read EventList attribute from the DUT. For this cluster the list is usually empty " + "but it can contain manufacturer specific event IDs.\n"); + if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep2eThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_9(); + err = TestStep7ReadEventListAttributeFromTheDutForThisClusterTheListIsUsuallyEmptyButItCanContainManufacturerSpecificEventIDs_8(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : DUT executes a breathe effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutExecutesABreatheEffect_10(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 2f: TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe " - "finish effect and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestStep2fThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xfeFinishEffectAndTheEffectVariantFieldSetTo0x00Default_11(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : DUT stops the breathe effect after the current effect sequence\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutStopsTheBreatheEffectAfterTheCurrentEffectSequence_12(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : Step 2g: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " - "breathe and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestStep2gThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_13(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads the ClusterRevision attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads the FeatureMap attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4ThReadsAttributeListFromDut_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4ThReadsAttributeListFromDut_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5ReadTheGlobalAttributeAcceptedCommandList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6ReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: Read the optional command(TriggerEffect) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6ReadTheGlobalAttributeGeneratedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep7ReadEventListAttributeFromTheDutForThisClusterTheListIsUsuallyEmptyButItCanContainManufacturerSpecificEventIDs_8() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + +class Test_TC_I_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_I_2_1() + : TestCommandBridge("Test_TC_I_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_I_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the IdentifyTime attribute from the DUT\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestStep2ThReadsTheIdentifyTimeAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the IdentifyType attribute from the DUT\n"); + if (ShouldSkip("I.S.A0001")) { + NextTest(); + return; + } + err = TestStep3ThReadsTheIdentifyTypeAttributeFromTheDut_2(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsTheIdentifyTimeAttributeFromTheDut_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads the IdentifyTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("identifyTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsTheIdentifyTypeAttributeFromTheDut_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeIdentifyTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads the IdentifyType attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("identifyType", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_I_2_2() + : TestCommandBridge("Test_TC_I_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_I_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Step 1a: Wait for the commissioned device to be retrieved\n"); + err = TestStep1aWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1b: TH reads the IdentifyType attribute from the DUT.\n"); + if (ShouldSkip("I.S.A0001")) { + NextTest(); + return; + } + err = TestStep1bThReadsTheIdentifyTypeAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : Step 2a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x003c " + "(60s).\n"); + if (ShouldSkip("I.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep2aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Verify that the device enters its identification state using the IdentifyType from Step 1b, " + "in order to indicate to an observer which of several nodes and/or endpoints it is.\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.A0001")) { + NextTest(); + return; + } + err = TestVerifyThatTheDeviceEntersItsIdentificationStateUsingTheIdentifyTypeFromStep1bInOrderToIndicateToAnObserverWhichOfSeveralNodesAndOrEndpointsItIs_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 2b: TH reads immediately IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestStep2bThReadsImmediatelyIdentifyTimeAttributeFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10000ms\n"); + err = TestWait10000ms_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Step 2c: After 10 seconds, the TH reads IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestStep2cAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 4a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x0000 (stop " + "identifying).\n"); + if (ShouldSkip("I.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep4aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 4b: TH reads immediately IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestStep4bThReadsImmediatelyIdentifyTimeAttributeFromDut_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Step 6a: TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestStep6aThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Verify that the device enters its identification state using the IdentifyType from Step 1b, " + "in order to indicate to an observer which of several nodes and/or endpoints it is.\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.A0001")) { + NextTest(); + return; + } + err = TestVerifyThatTheDeviceEntersItsIdentificationStateUsingTheIdentifyTypeFromStep1bInOrderToIndicateToAnObserverWhichOfSeveralNodesAndOrEndpointsItIs_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Wait 5000ms\n"); + err = TestWait5000ms_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Step 6b: After 5 seconds, the TH reads IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestStep6bAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_12(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 13; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1aWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nonnull IdentifyTypeValue; + + CHIP_ERROR TestStep1bThReadsTheIdentifyTypeAttributeFromTheDut_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeIdentifyTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1b: TH reads the IdentifyType attribute from the DUT. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("identifyType", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5U)); + { + IdentifyTypeValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:60U]; + [cluster identifyWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x003c (60s). " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestVerifyThatTheDeviceEntersItsIdentificationStateUsingTheIdentifyTypeFromStep1bInOrderToIndicateToAnObserverWhichOfSeveralNodesAndOrEndpointsItIs_3() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep2bThReadsImmediatelyIdentifyTimeAttributeFromDut_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2b: TH reads immediately IdentifyTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 51U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 69U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait10000ms_5() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep2cAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2c: After 10 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 42U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 58U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; + [cluster identifyWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4a: TH sends Identify command to DUT, with the IdentifyTime field set to 0x0000 (stop " + @"identifying). Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4bThReadsImmediatelyIdentifyTimeAttributeFromDut_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads immediately IdentifyTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("IdentifyTime", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6aThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id identifyTimeArgument; + identifyTimeArgument = [NSNumber numberWithUnsignedShort:15U]; + [cluster writeAttributeIdentifyTimeWithValue:identifyTimeArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6a: TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestVerifyThatTheDeviceEntersItsIdentificationStateUsingTheIdentifyTypeFromStep1bInOrderToIndicateToAnObserverWhichOfSeveralNodesAndOrEndpointsItIs_10() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestWait5000ms_11() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep6bAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6b: After 5 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 5U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 15U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_I_2_3() + : TestCommandBridge("Test_TC_I_2_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_I_2_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : Step 2a: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 " + "blink and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestStep2aThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : DUT executes a blink effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesABlinkEffect_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Step 2b: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " + "breathe and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestStep2bThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : DUT executes a breathe effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesABreatheEffect_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Step 2c: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 " + "okay and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestStep2cThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : DUT executes an okay effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesAnOkayEffect_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 2d: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b " + "channel change and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestStep2dThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : DUT executes a channel change effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesAChannelChangeEffect_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Step 2e: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " + "breathe and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestStep2eThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : DUT executes a breathe effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesABreatheEffect_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 2f: TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe " + "finish effect and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestStep2fThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xfeFinishEffectAndTheEffectVariantFieldSetTo0x00Default_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : DUT stops the breathe effect after the current effect sequence\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutStopsTheBreatheEffectAfterTheCurrentEffectSequence_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Step 2g: TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " + "breathe and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestStep2gThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_13(); break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : DUT executes a breathe effect\n"); @@ -59308,14 +60594,2631 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; + const uint16_t mTestCount = 20; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep1ReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1: Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2aReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2a: Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2bGivenLvlsf00ooEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2b: Given LVL.S.F00(OO) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2cGivenLvlsf01ltEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2c: Given LVL.S.F01(LT) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2dGivenLvlsf02fqEnsureFeaturemapHasTheCorrectBitSet_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2d: Given LVL.S.F02(FQ) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3aReadTheGlobalAttributeAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3aReadTheGlobalAttributeAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3bReadTheOptionalAttributeStartUpCurrentLevelAndRemainingTimeInAttributeList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3b: Read the optional attribute(StartUpCurrentLevel and RemainingTime) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16384UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3cReadTheOptionalAttributeCurrentFrequencyMinFrequencyAndMinFrequencyInAttributeList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Step 3c: Read the optional attribute(CurrentFrequency, MinFrequency and MinFrequency) in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3dReadTheOptionalAttributeMinLevelInAttributeList_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3d: Read the optional attribute(MinLevel) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3eReadTheOptionalAttributeMaxLevelInAttributeList_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3e: Read the optional attribute(MaxLevel) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3fReadTheOptionalAttributeOnOffTransitionTimeInAttributeList_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3f: Read the optional attribute(OnOffTransitionTime) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3gReadTheOptionalAttributeOnTransitionTimeInAttributeList_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3g: Read the optional attribute(OnTransitionTime) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3hReadTheOptionalAttributeOffTransitionTimeInAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3h: Read the optional attribute(OffTransitionTime) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3iReadTheOptionalAttributeDefaultMoveRateInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3i: Read the optional attribute(DefaultMoveRate) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 20UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aReadTheGlobalAttributeAcceptedCommandList_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4a1ReadTheFeatureDependentLVLSF02CommandInAcceptedCommandList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a.1: Read the Feature-dependent(LVL.S.F02) command in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4bReadTheGlobalAttributeGeneratedCommandList_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_2_1() + : TestCommandBridge("Test_TC_LVL_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_LVL_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: Reads the CurrentLevel attribute\n"); + if (ShouldSkip("LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep1ReadsTheCurrentLevelAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: Reads the RemainingTime attribute\n"); + if (ShouldSkip("LVL.S.A0001")) { + NextTest(); + return; + } + err = TestStep2ReadsTheRemainingTimeAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3a: Reads the MinLevel attribute\n"); + if (ShouldSkip("LVL.S.A0002 && LVL.S.F01")) { + NextTest(); + return; + } + err = TestStep3aReadsTheMinLevelAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 3b: Reads the MinLevel attribute\n"); + if (ShouldSkip("LVL.S.A0002 && !LVL.S.F01")) { + NextTest(); + return; + } + err = TestStep3bReadsTheMinLevelAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4: Reads the MaxLevel attribute\n"); + if (ShouldSkip("LVL.S.A0003 && LVL.S.F01")) { + NextTest(); + return; + } + err = TestStep4ReadsTheMaxLevelAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4a: Reads the MaxLevel attribute\n"); + if (ShouldSkip("LVL.S.A0003 && !LVL.S.F01")) { + NextTest(); + return; + } + err = TestStep4aReadsTheMaxLevelAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4b & 4C Reads the CurrentLevel attribute\n"); + if (ShouldSkip("LVL.S.F01 && LVL.S.A0002 && LVL.S.A0003")) { + NextTest(); + return; + } + err = TestStep4b4cReadsTheCurrentLevelAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 4b & 4C Reads the CurrentLevel attribute\n"); + if (ShouldSkip("LVL.S.A0002 && LVL.S.A0003 && !LVL.S.F01")) { + NextTest(); + return; + } + err = TestStep4b4cReadsTheCurrentLevelAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5: Reads the CurrentFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0004")) { + NextTest(); + return; + } + err = TestStep5ReadsTheCurrentFrequencyAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6: Reads the MinFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0005")) { + NextTest(); + return; + } + err = TestStep6ReadsTheMinFrequencyAttribute_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 7: Reads the MaxFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0006")) { + NextTest(); + return; + } + err = TestStep7ReadsTheMaxFrequencyAttribute_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 7b & 7C Reads the CurrentFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006")) { + NextTest(); + return; + } + err = TestStep7b7cReadsTheCurrentFrequencyAttribute_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 8: Reads the OnOffTransitionTime attribute\n"); + if (ShouldSkip("LVL.S.A0010")) { + NextTest(); + return; + } + err = TestStep8ReadsTheOnOffTransitionTimeAttribute_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Step 9a: Reads the OnLevel attribute \n"); + if (ShouldSkip("LVL.S.F01 && LVL.S.A0011")) { + NextTest(); + return; + } + err = TestStep9aReadsTheOnLevelAttribute_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Step 9b: Reads the OnLevel attribute \n"); + if (ShouldSkip("LVL.S.A0011 && !LVL.S.F01")) { + NextTest(); + return; + } + err = TestStep9bReadsTheOnLevelAttribute_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Step 10: Reads the OnTransitionTime attribute \n"); + if (ShouldSkip("LVL.S.A0012")) { + NextTest(); + return; + } + err = TestStep10ReadsTheOnTransitionTimeAttribute_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Step 11: Reads the OffTransitionTime attribute \n"); + if (ShouldSkip("LVL.S.A0013")) { + NextTest(); + return; + } + err = TestStep11ReadsTheOffTransitionTimeAttribute_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Step 12: Reads the DefaultMoveRate attribute \n"); + if (ShouldSkip("LVL.S.A0014")) { + NextTest(); + return; + } + err = TestStep12ReadsTheDefaultMoveRateAttribute_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Step 13: Reads the Options attribute \n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestStep13ReadsTheOptionsAttribute_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Step 14: Reads the StartUpCurrentLevel attribute \n"); + if (ShouldSkip("LVL.S.A4000")) { + NextTest(); + return; + } + err = TestStep14ReadsTheStartUpCurrentLevelAttribute_20(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 21; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable CurrentLevelValue; + + CHIP_ERROR TestStep1ReadsTheCurrentLevelAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1: Reads the CurrentLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); + } + { + CurrentLevelValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2ReadsTheRemainingTimeAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRemainingTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: Reads the RemainingTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("remainingTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("remainingTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("remainingTime", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull MinLevelValue; + + CHIP_ERROR TestStep3aReadsTheMinLevelAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: Reads the MinLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MinLevel", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); + { + MinLevelValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull MinLevelFeatureMapNotSupportedValue; + + CHIP_ERROR TestStep3bReadsTheMinLevelAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3b: Reads the MinLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 254U)); + { + MinLevelFeatureMapNotSupportedValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull MaxLevelValue; + + CHIP_ERROR TestStep4ReadsTheMaxLevelAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: Reads the MaxLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxLevel", actualValue, 254U)); + } + + VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelValue)); + { + MaxLevelValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull MaxLevelFeatureMapNotSupportedValue; + + CHIP_ERROR TestStep4aReadsTheMaxLevelAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: Reads the MaxLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); + VerifyOrReturn( + CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); + { + MaxLevelFeatureMapNotSupportedValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], MinLevelValue)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], MaxLevelValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue( + "currentLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintMaxValue( + "currentLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5ReadsTheCurrentFrequencyAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: Reads the CurrentFrequency attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull MinFrequencyValue; + + CHIP_ERROR TestStep6ReadsTheMinFrequencyAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: Reads the MinFrequency attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("minFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minFrequency", [value unsignedShortValue], 65535U)); + { + MinFrequencyValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull MaxFrequencyValue; + + CHIP_ERROR TestStep7ReadsTheMaxFrequencyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: Reads the MaxFrequency attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("maxFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("maxFrequency", [value unsignedShortValue], 65535U)); + { + MaxFrequencyValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7b7cReadsTheCurrentFrequencyAttribute_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7b & 7C Reads the CurrentFrequency attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], MinFrequencyValue)); + VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], MaxFrequencyValue)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep8ReadsTheOnOffTransitionTimeAttribute_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 8: Reads the OnOffTransitionTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep9aReadsTheOnLevelAttribute_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 9a: Reads the OnLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelValue)); + VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep9bReadsTheOnLevelAttribute_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 9b: Reads the OnLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn( + CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn( + CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep10ReadsTheOnTransitionTimeAttribute_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 10: Reads the OnTransitionTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep11ReadsTheOffTransitionTimeAttribute_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 11: Reads the OffTransitionTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep12ReadsTheDefaultMoveRateAttribute_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 12: Reads the DefaultMoveRate attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep13ReadsTheOptionsAttribute_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 13: Reads the Options attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("options", "bitmap8", "bitmap8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep14ReadsTheStartUpCurrentLevelAttribute_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 14: Reads the StartUpCurrentLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_2_2() + : TestCommandBridge("Test_TC_LVL_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("OnOffTransitionTimeConfigValue", 0, UINT16_MAX, &mOnOffTransitionTimeConfigValue); + AddArgument("OnLevelConfigValue", 0, UINT8_MAX, &mOnLevelConfigValue); + AddArgument("OnTransitionTimeConfigValue", 0, UINT16_MAX, &mOnTransitionTimeConfigValue); + AddArgument("OffTransitionTimeConfigValue", 0, UINT16_MAX, &mOffTransitionTimeConfigValue); + AddArgument("DefaultMoveRateConfigValue", 0, UINT8_MAX, &mDefaultMoveRateConfigValue); + AddArgument("StartUpCurrentLevelConfigValue", 0, UINT8_MAX, &mStartUpCurrentLevelConfigValue); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_LVL_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1a: Reads the OnOffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0010")) { + NextTest(); + return; + } + err = TestStep1aReadsTheOnOffTransitionTimeAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1b: writes the OnOffTransitionTime attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0010")) { + NextTest(); + return; + } + err = TestStep1bWritesTheOnOffTransitionTimeAttributeOnTheDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 1c: Reads the OnOffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0010")) { + NextTest(); + return; + } + err = TestStep1cReadsTheOnOffTransitionTimeAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 2a: Reads the OnLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0011")) { + NextTest(); + return; + } + err = TestStep2aReadsTheOnLevelAttributeFromTheDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 2b: writes the OnLevel attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0011")) { + NextTest(); + return; + } + err = TestStep2bWritesTheOnLevelAttributeOnTheDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 2c: Reads the OnLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0011")) { + NextTest(); + return; + } + err = TestStep2cReadsTheOnLevelAttributeFromTheDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 3a: Reads the OnTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0012")) { + NextTest(); + return; + } + err = TestStep3aReadsTheOnTransitionTimeAttributeFromTheDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 3b: Writes the OnTransitionTime attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0012")) { + NextTest(); + return; + } + err = TestStep3bWritesTheOnTransitionTimeAttributeOnTheDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 3c: Reads the OnTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0012")) { + NextTest(); + return; + } + err = TestStep3cReadsTheOnTransitionTimeAttributeFromTheDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 4a: Reads the OffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0013")) { + NextTest(); + return; + } + err = TestStep4aReadsTheOffTransitionTimeAttributeFromTheDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 4b: Writes the OffTransitionTime attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0013")) { + NextTest(); + return; + } + err = TestStep4bWritesTheOffTransitionTimeAttributeOnTheDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 4c: Reads the OffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0013")) { + NextTest(); + return; + } + err = TestStep4cReadsTheOffTransitionTimeAttributeFromTheDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 5a: Reads the DefaultMoveRate attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0014")) { + NextTest(); + return; + } + err = TestStep5aReadsTheDefaultMoveRateAttributeFromTheDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Step 5b: Writes the DefaultMoveRate attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0014")) { + NextTest(); + return; + } + err = TestStep5bWritesTheDefaultMoveRateAttributeOnTheDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Step 5c: Reads the DefaultMoveRate attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0014")) { + NextTest(); + return; + } + err = TestStep5cReadsTheDefaultMoveRateAttributeFromTheDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Step 6a: Reads the StartUpCurrentLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A4000")) { + NextTest(); + return; + } + err = TestStep6aReadsTheStartUpCurrentLevelAttributeFromTheDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Step 6b: Rwrites the StartUpCurrentLevel attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A4000")) { + NextTest(); + return; + } + err = TestStep6bRwritesTheStartUpCurrentLevelAttributeOnTheDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Step 6c: Rreads the StartUpCurrentLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A4000")) { + NextTest(); + return; + } + err = TestStep6cRreadsTheStartUpCurrentLevelAttributeFromTheDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : writes back default value of OnOffTransitionTime attribute\n"); + if (ShouldSkip("LVL.S.A0010")) { + NextTest(); + return; + } + err = TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 20; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mOnOffTransitionTimeConfigValue; + chip::Optional mOnLevelConfigValue; + chip::Optional mOnTransitionTimeConfigValue; + chip::Optional mOffTransitionTimeConfigValue; + chip::Optional mDefaultMoveRateConfigValue; + chip::Optional mStartUpCurrentLevelConfigValue; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nonnull OnOffTransitionTimeValue; + + CHIP_ERROR TestStep1aReadsTheOnOffTransitionTimeAttributeFromTheDut_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1a: Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); + { + OnOffTransitionTimeValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep1bWritesTheOnOffTransitionTimeAttributeOnTheDut_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id onOffTransitionTimeArgument; + onOffTransitionTimeArgument = mOnOffTransitionTimeConfigValue.HasValue() + ? [NSNumber numberWithUnsignedShort:mOnOffTransitionTimeConfigValue.Value()] + : [NSNumber numberWithUnsignedShort:10U]; + [cluster + writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"Step 1b: writes the OnOffTransitionTime attribute on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep1cReadsTheOnOffTransitionTimeAttributeFromTheDut_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1c: Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOffTransitionTime", actualValue, + mOnOffTransitionTimeConfigValue.HasValue() ? mOnOffTransitionTimeConfigValue.Value() : 10U)); + } + + VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintNotValue("onOffTransitionTime", value, OnOffTransitionTimeValue)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable OnLevelValue; + + CHIP_ERROR TestStep2aReadsTheOnLevelAttributeFromTheDut_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2a: Reads the OnLevel attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], 254U)); + } + { + OnLevelValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2bWritesTheOnLevelAttributeOnTheDut_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id onLevelArgument; + onLevelArgument = mOnLevelConfigValue.HasValue() ? [NSNumber numberWithUnsignedChar:mOnLevelConfigValue.Value()] + : [NSNumber numberWithUnsignedChar:5U]; + [cluster writeAttributeOnLevelWithValue:onLevelArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2b: writes the OnLevel attribute on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2cReadsTheOnLevelAttributeFromTheDut_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2c: Reads the OnLevel attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OnLevel", actualValue)); + VerifyOrReturn( + CheckValue("OnLevel", actualValue, mOnLevelConfigValue.HasValue() ? mOnLevelConfigValue.Value() : 5U)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + } + VerifyOrReturn(CheckConstraintNotValue("onLevel", value, OnLevelValue)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable OnTransitionTimeValue; + + CHIP_ERROR TestStep3aReadsTheOnTransitionTimeAttributeFromTheDut_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: Reads the OnTransitionTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); + } + { + OnTransitionTimeValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3bWritesTheOnTransitionTimeAttributeOnTheDut_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id onTransitionTimeArgument; + onTransitionTimeArgument = mOnTransitionTimeConfigValue.HasValue() + ? [NSNumber numberWithUnsignedShort:mOnTransitionTimeConfigValue.Value()] + : [NSNumber numberWithUnsignedShort:5U]; + [cluster + writeAttributeOnTransitionTimeWithValue:onTransitionTimeArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 3b: Writes the OnTransitionTime attribute on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3cReadsTheOnTransitionTimeAttributeFromTheDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3c: Reads the OnTransitionTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OnTransitionTime", actualValue)); + VerifyOrReturn(CheckValue("OnTransitionTime", actualValue, + mOnTransitionTimeConfigValue.HasValue() ? mOnTransitionTimeConfigValue.Value() : 5U)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); + } + VerifyOrReturn(CheckConstraintNotValue("onTransitionTime", value, OnTransitionTimeValue)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable OffTransitionTimeValue; + + CHIP_ERROR TestStep4aReadsTheOffTransitionTimeAttributeFromTheDut_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: Reads the OffTransitionTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); + } + { + OffTransitionTimeValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4bWritesTheOffTransitionTimeAttributeOnTheDut_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id offTransitionTimeArgument; + offTransitionTimeArgument = mOffTransitionTimeConfigValue.HasValue() + ? [NSNumber numberWithUnsignedShort:mOffTransitionTimeConfigValue.Value()] + : [NSNumber numberWithUnsignedShort:10U]; + [cluster + writeAttributeOffTransitionTimeWithValue:offTransitionTimeArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4b: Writes the OffTransitionTime attribute on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4cReadsTheOffTransitionTimeAttributeFromTheDut_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: Reads the OffTransitionTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OffTransitionTime", actualValue)); + VerifyOrReturn(CheckValue("OffTransitionTime", actualValue, + mOffTransitionTimeConfigValue.HasValue() ? mOffTransitionTimeConfigValue.Value() : 10U)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + } + VerifyOrReturn(CheckConstraintNotValue("offTransitionTime", value, OffTransitionTimeValue)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable DefaultMoveRatevalue; + + CHIP_ERROR TestStep5aReadsTheDefaultMoveRateAttributeFromTheDut_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5a: Reads the DefaultMoveRate attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); + } + { + DefaultMoveRatevalue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5bWritesTheDefaultMoveRateAttributeOnTheDut_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id defaultMoveRateArgument; + defaultMoveRateArgument = mDefaultMoveRateConfigValue.HasValue() + ? [NSNumber numberWithUnsignedChar:mDefaultMoveRateConfigValue.Value()] + : [NSNumber numberWithUnsignedChar:111U]; + [cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5b: Writes the DefaultMoveRate attribute on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5cReadsTheDefaultMoveRateAttributeFromTheDut_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5c: Reads the DefaultMoveRate attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("DefaultMoveRate", actualValue)); + VerifyOrReturn(CheckValue("DefaultMoveRate", actualValue, + mDefaultMoveRateConfigValue.HasValue() ? mDefaultMoveRateConfigValue.Value() : 111U)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); + } + VerifyOrReturn(CheckConstraintNotValue("defaultMoveRate", value, DefaultMoveRatevalue)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable StartUpCurrentLevelValue; + + CHIP_ERROR TestStep6aReadsTheStartUpCurrentLevelAttributeFromTheDut_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6a: Reads the StartUpCurrentLevel attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); + } + { + StartUpCurrentLevelValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6bRwritesTheStartUpCurrentLevelAttributeOnTheDut_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpCurrentLevelArgument; + startUpCurrentLevelArgument = mStartUpCurrentLevelConfigValue.HasValue() + ? [NSNumber numberWithUnsignedChar:mStartUpCurrentLevelConfigValue.Value()] + : [NSNumber numberWithUnsignedChar:5U]; + [cluster + writeAttributeStartUpCurrentLevelWithValue:startUpCurrentLevelArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6b: Rwrites the StartUpCurrentLevel attribute on the DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6cRreadsTheStartUpCurrentLevelAttributeFromTheDut_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6c: Rreads the StartUpCurrentLevel attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartUpCurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("StartUpCurrentLevel", actualValue, + mStartUpCurrentLevelConfigValue.HasValue() ? mStartUpCurrentLevelConfigValue.Value() : 5U)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); + } + VerifyOrReturn(CheckConstraintNotValue("startUpCurrentLevel", value, StartUpCurrentLevelValue)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id onOffTransitionTimeArgument; + onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster + writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument + completion:^(NSError * _Nullable err) { + NSLog(@"writes back default value of OnOffTransitionTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_3_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_3_1() + : TestCommandBridge("Test_TC_LVL_3_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_LVL_3_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_3_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestPreconditionSendOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Precondition: write default value of OnOffTransitionTime attribute\n"); + if (ShouldSkip("LVL.S.A0010")) { + NextTest(); + return; + } + err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 1: TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestStep1ThWrites0ToTheOptionsAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 1a: TH writes NULL to the OnLevel attribute\n"); + if (ShouldSkip("LVL.S.A0011")) { + NextTest(); + return; + } + err = TestStep1aThWritesNullToTheOnLevelAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 2a: TH sends Off command to DUT\n"); + if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep2aThSendsOffCommandToDut_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 2b: TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and TransitionTime " + "=0 (immediate)\n"); + if (ShouldSkip("LVL.S.C04.Rsp")) { + NextTest(); + return; + } + err = TestStep2bThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT\n"); + if (ShouldSkip("OO.S.A0000 && LVL.S.C04.Rsp")) { + NextTest(); + return; + } + err = TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2d: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C04.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep2dThReadsCurrentLevelAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 3a: TH sends On command to DUT\n"); + if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestStep3aThSendsOnCommandToDut_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " + "(immediate)\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3c: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep3cThReadsCurrentLevelAttributeFromDut_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Step 4a: TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = " + "300 (30 s). This means the level should increase by 150 units in 30s, so 5 units/s\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep4aThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10000ms\n"); + err = TestWait10000ms_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Step 4b: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestStep4bThReadsCurrentLevelAttributeFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10000ms\n"); + err = TestWait10000ms_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4c: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestStep4cThReadsCurrentLevelAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 10000ms\n"); + err = TestWait10000ms_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Step 4d: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestStep4dThReadsCurrentLevelAttributeFromDut_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait 5000ms\n"); + err = TestWait5000ms_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Step 4e: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestStep4eThReadsCurrentLevelAttributeFromDut_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Step 4f: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestStep4fThReadsCurrentLevelAttributeFromDut_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Step 5a: TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestStep5aThWrites0ToTheOptionsAttribute_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Step 5b: TH reads Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestStep5bThReadsOptionsAttribute_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Step 5c: TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestStep5cThSendsOnCommandToDut_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Step 5d: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep5dThSendsAMoveToLevelCommandToTheDutWith_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Step 5e: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep5eThReadsCurrentLevelAttributeFromDut_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Step 5f: TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep5fThSendsOffCommandToDut_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Step 5g: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep5gThSendsAMoveToLevelCommandToTheDutWith_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Step 5h: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep5hThReadsCurrentLevelAttributeFromDut_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Step 5i: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep5iThSendsAMoveToLevelCommandToTheDutWith_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Step 5j: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep5jThReadsCurrentLevelAttributeFromDut_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Step 5k: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep5kThSendsAMoveToLevelCommandToTheDutWith_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Step 5l: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep5lThReadsCurrentLevelAttributeFromDut_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Step 6a: TH writes 1 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestStep6aThWrites1ToTheOptionsAttribute_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Step 6b: TH reads Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestStep6bThReadsOptionsAttribute_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Step 6c: TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestStep6cThSendsOnCommandToDut_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Step 6d: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep6dThSendsAMoveToLevelCommandToTheDutWith_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Step 6e: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep6eThReadsCurrentLevelAttributeFromDut_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Step 6f: TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep6fThSendsOffCommandToDut_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Step 6g: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep6gThSendsAMoveToLevelCommandToTheDutWith_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Step 6h: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep6hThReadsCurrentLevelAttributeFromDut_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Step 6i: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep6iThSendsAMoveToLevelCommandToTheDutWith_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Step 6j: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep6jThReadsCurrentLevelAttributeFromDut_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Step 6k: TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep6kThSendsAMoveToLevelCommandToTheDutWith_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Step 6l: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestStep6lThReadsCurrentLevelAttributeFromDut_46(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 47; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -59323,183 +63226,173 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep1ReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestPreconditionSendOnCommand_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1: Read the global attribute: ClusterRevision Error: %@", err); + [cluster onWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Precondition Send On Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2aReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2a: Read the global attribute: FeatureMap Error: %@", err); + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2bGivenLvlsf00ooEnsureFeaturemapHasTheCorrectBitSet_3() + CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2b: Given LVL.S.F00(OO) ensure featuremap has the correct bit set Error: %@", err); + id onOffTransitionTimeArgument; + onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster + writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"Precondition: write default value of OnOffTransitionTime attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2cGivenLvlsf01ltEnsureFeaturemapHasTheCorrectBitSet_4() + CHIP_ERROR TestStep1ThWrites0ToTheOptionsAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2c: Given LVL.S.F01(LT) ensure featuremap has the correct bit set Error: %@", err); + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 1: TH writes 0 to the Options attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2dGivenLvlsf02fqEnsureFeaturemapHasTheCorrectBitSet_5() + CHIP_ERROR TestStep1aThWritesNullToTheOnLevelAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2d: Given LVL.S.F02(FQ) ensure featuremap has the correct bit set Error: %@", err); + id onLevelArgument; + onLevelArgument = nil; + [cluster writeAttributeOnLevelWithValue:onLevelArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 1a: TH writes NULL to the OnLevel attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aReadTheGlobalAttributeAttributeList_6() + CHIP_ERROR TestStep2aThSendsOffCommandToDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: Read the global attribute: AttributeList Error: %@", err); + [cluster offWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 2a: TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aReadTheGlobalAttributeAttributeList_7() + CHIP_ERROR TestStep2bThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_7() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: Read the global attribute: AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:50U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithOnOffWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2b: TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and " + @"TransitionTime =0 (immediate) Error: %@", + err); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3bReadTheOptionalAttributeStartUpCurrentLevelAndRemainingTimeInAttributeList_8() + CHIP_ERROR TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3b: Read the optional attribute(StartUpCurrentLevel and RemainingTime) in AttributeList Error: %@", err); + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16384UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } NextTest(); }]; @@ -59507,24 +63400,23 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3cReadTheOptionalAttributeCurrentFrequencyMinFrequencyAndMinFrequencyInAttributeList_9() + CHIP_ERROR TestStep2dThReadsCurrentLevelAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Step 3c: Read the optional attribute(CurrentFrequency, MinFrequency and MinFrequency) in AttributeList Error: %@", - err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2d: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); + } NextTest(); }]; @@ -59532,62 +63424,67 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3dReadTheOptionalAttributeMinLevelInAttributeList_10() + CHIP_ERROR TestStep3aThSendsOnCommandToDut_10() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3d: Read the optional attribute(MinLevel) in AttributeList Error: %@", err); + [cluster onWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 3a: TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3eReadTheOptionalAttributeMaxLevelInAttributeList_11() + CHIP_ERROR TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_11() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3e: Read the optional attribute(MaxLevel) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:50U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " + @"(immediate) Error: %@", + err); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3fReadTheOptionalAttributeOnOffTransitionTimeInAttributeList_12() + CHIP_ERROR TestStep3cThReadsCurrentLevelAttributeFromDut_12() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3f: Read the optional attribute(OnOffTransitionTime) in AttributeList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3c: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); + } NextTest(); }]; @@ -59595,41 +63492,59 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3gReadTheOptionalAttributeOnTransitionTimeInAttributeList_13() + CHIP_ERROR + TestStep4aThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_13() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3g: Read the optional attribute(OnTransitionTime) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:200U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster + moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4a: TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 " + @"(30 s). This means the level should increase by 150 units in 30s, so 5 units/s Error: %@", + err); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3hReadTheOptionalAttributeOffTransitionTimeInAttributeList_14() + CHIP_ERROR TestWait10000ms_14() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep4bThReadsCurrentLevelAttributeFromDut_15() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3h: Read the optional attribute(OffTransitionTime) in AttributeList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); + } NextTest(); }]; @@ -59637,20 +63552,31 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3iReadTheOptionalAttributeDefaultMoveRateInAttributeList_15() + CHIP_ERROR TestWait10000ms_16() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep4cThReadsCurrentLevelAttributeFromDut_17() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3i: Read the optional attribute(DefaultMoveRate) in AttributeList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 20UL)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); + } NextTest(); }]; @@ -59658,27 +63584,31 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aReadTheGlobalAttributeAcceptedCommandList_16() + CHIP_ERROR TestWait10000ms_18() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep4dThReadsCurrentLevelAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4d: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 7UL)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 200U)); + } NextTest(); }]; @@ -59686,20 +63616,31 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4a1ReadTheFeatureDependentLVLSF02CommandInAcceptedCommandList_17() + CHIP_ERROR TestWait5000ms_20() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep4eThReadsCurrentLevelAttributeFromDut_21() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a.1: Read the Feature-dependent(LVL.S.F02) command in AcceptedCommandList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4e: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); + } NextTest(); }]; @@ -59707,337 +63648,117 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bReadTheGlobalAttributeGeneratedCommandList_18() + CHIP_ERROR TestStep4fThReadsCurrentLevelAttributeFromDut_22() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4f: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_LVL_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_2_1() - : TestCommandBridge("Test_TC_LVL_2_1") - , mTestIndex(0) + CHIP_ERROR TestStep5aThWrites0ToTheOptionsAttribute_23() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_2_1() {} + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5a: TH writes 0 to the Options attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5bThReadsOptionsAttribute_24() { - CHIP_ERROR err = CHIP_NO_ERROR; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5b: TH reads Options attribute Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: Reads the CurrentLevel attribute\n"); - if (ShouldSkip("LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep1ReadsTheCurrentLevelAttribute_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: Reads the RemainingTime attribute\n"); - if (ShouldSkip("LVL.S.A0001")) { - NextTest(); - return; - } - err = TestStep2ReadsTheRemainingTimeAttribute_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3a: Reads the MinLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002 && LVL.S.F01")) { - NextTest(); - return; - } - err = TestStep3aReadsTheMinLevelAttribute_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 3b: Reads the MinLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002 && !LVL.S.F01")) { - NextTest(); - return; - } - err = TestStep3bReadsTheMinLevelAttribute_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4: Reads the MaxLevel attribute\n"); - if (ShouldSkip("LVL.S.A0003 && LVL.S.F01")) { - NextTest(); - return; - } - err = TestStep4ReadsTheMaxLevelAttribute_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4a: Reads the MaxLevel attribute\n"); - if (ShouldSkip("LVL.S.A0003 && !LVL.S.F01")) { - NextTest(); - return; - } - err = TestStep4aReadsTheMaxLevelAttribute_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4b & 4C Reads the CurrentLevel attribute\n"); - if (ShouldSkip("LVL.S.F01 && LVL.S.A0002 && LVL.S.A0003")) { - NextTest(); - return; - } - err = TestStep4b4cReadsTheCurrentLevelAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 4b & 4C Reads the CurrentLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002 && LVL.S.A0003 && !LVL.S.F01")) { - NextTest(); - return; - } - err = TestStep4b4cReadsTheCurrentLevelAttribute_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5: Reads the CurrentFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0004")) { - NextTest(); - return; - } - err = TestStep5ReadsTheCurrentFrequencyAttribute_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6: Reads the MinFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0005")) { - NextTest(); - return; - } - err = TestStep6ReadsTheMinFrequencyAttribute_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 7: Reads the MaxFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0006")) { - NextTest(); - return; - } - err = TestStep7ReadsTheMaxFrequencyAttribute_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Step 7b & 7C Reads the CurrentFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006")) { - NextTest(); - return; - } - err = TestStep7b7cReadsTheCurrentFrequencyAttribute_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 8: Reads the OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { - NextTest(); - return; - } - err = TestStep8ReadsTheOnOffTransitionTimeAttribute_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Step 9a: Reads the OnLevel attribute \n"); - if (ShouldSkip("LVL.S.F01 && LVL.S.A0011")) { - NextTest(); - return; - } - err = TestStep9aReadsTheOnLevelAttribute_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 9b: Reads the OnLevel attribute \n"); - if (ShouldSkip("LVL.S.A0011 && !LVL.S.F01")) { - NextTest(); - return; - } - err = TestStep9bReadsTheOnLevelAttribute_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Step 10: Reads the OnTransitionTime attribute \n"); - if (ShouldSkip("LVL.S.A0012")) { - NextTest(); - return; - } - err = TestStep10ReadsTheOnTransitionTimeAttribute_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 11: Reads the OffTransitionTime attribute \n"); - if (ShouldSkip("LVL.S.A0013")) { - NextTest(); - return; - } - err = TestStep11ReadsTheOffTransitionTimeAttribute_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Step 12: Reads the DefaultMoveRate attribute \n"); - if (ShouldSkip("LVL.S.A0014")) { - NextTest(); - return; - } - err = TestStep12ReadsTheDefaultMoveRateAttribute_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 13: Reads the Options attribute \n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestStep13ReadsTheOptionsAttribute_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Step 14: Reads the StartUpCurrentLevel attribute \n"); - if (ShouldSkip("LVL.S.A4000")) { - NextTest(); - return; + { + id actualValue = value; + VerifyOrReturn(CheckValue("Options", actualValue, 0U)); } - err = TestStep14ReadsTheStartUpCurrentLevelAttribute_20(); - break; - } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestStep5cThSendsOnCommandToDut_25() { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 5c: TH sends On command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestStep5dThSendsAMoveToLevelCommandToTheDutWith_26() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 21; + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5d: TH sends a MoveToLevel command to the DUT with Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - NSNumber * _Nullable CurrentLevelValue; - CHIP_ERROR TestStep1ReadsTheCurrentLevelAttribute_1() + CHIP_ERROR TestStep5eThReadsCurrentLevelAttributeFromDut_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -60045,18 +63766,14 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1: Reads the CurrentLevel attribute Error: %@", err); + NSLog(@"Step 5e: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); - } { - CurrentLevelValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); } NextTest(); @@ -60065,75 +63782,64 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2ReadsTheRemainingTimeAttribute_2() + CHIP_ERROR TestStep5fThSendsOffCommandToDut_28() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRemainingTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: Reads the RemainingTime attribute Error: %@", err); + [cluster offWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 5f: TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("remainingTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("remainingTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("remainingTime", [value unsignedShortValue], 65535U)); - NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MinLevelValue; - CHIP_ERROR TestStep3aReadsTheMinLevelAttribute_3() + CHIP_ERROR TestStep5gThSendsAMoveToLevelCommandToTheDutWith_29() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: Reads the MinLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("MinLevel", actualValue, 1U)); - } + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:120U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5g: TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); - { - MinLevelValue = value; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MinLevelFeatureMapNotSupportedValue; - CHIP_ERROR TestStep3bReadsTheMinLevelAttribute_4() + CHIP_ERROR TestStep5hThReadsCurrentLevelAttributeFromDut_30() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3b: Reads the MinLevel attribute Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5h: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 254U)); { - MinLevelFeatureMapNotSupportedValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); } NextTest(); @@ -60141,56 +63847,47 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull MaxLevelValue; - CHIP_ERROR TestStep4ReadsTheMaxLevelAttribute_5() + CHIP_ERROR TestStep5iThSendsAMoveToLevelCommandToTheDutWith_31() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: Reads the MaxLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("MaxLevel", actualValue, 254U)); - } + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:140U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5i: TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelValue)); - { - MaxLevelValue = value; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MaxLevelFeatureMapNotSupportedValue; - CHIP_ERROR TestStep4aReadsTheMaxLevelAttribute_6() + CHIP_ERROR TestStep5jThReadsCurrentLevelAttributeFromDut_32() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: Reads the MaxLevel attribute Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5j: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); - VerifyOrReturn( - CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); - VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); { - MaxLevelFeatureMapNotSupportedValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); } NextTest(); @@ -60199,32 +63896,31 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_7() + CHIP_ERROR TestStep5kThSendsAMoveToLevelCommandToTheDutWith_33() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:160U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5k: TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], MinLevelValue)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], MaxLevelValue)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_8() + CHIP_ERROR TestStep5lThReadsCurrentLevelAttributeFromDut_34() { MTRBaseDevice * device = GetDevice("alpha"); @@ -60232,17 +63928,14 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); + NSLog(@"Step 5l: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue( - "currentLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); - VerifyOrReturn(CheckConstraintMaxValue( - "currentLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); } NextTest(); @@ -60251,46 +63944,42 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5ReadsTheCurrentFrequencyAttribute_9() + CHIP_ERROR TestStep6aThWrites1ToTheOptionsAttribute_35() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5: Reads the CurrentFrequency attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:1U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6a: TH writes 1 to the Options attribute Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MinFrequencyValue; - CHIP_ERROR TestStep6ReadsTheMinFrequencyAttribute_10() + CHIP_ERROR TestStep6bThReadsOptionsAttribute_36() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: Reads the MinFrequency attribute Error: %@", err); + [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6b: TH reads Options attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("minFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minFrequency", [value unsignedShortValue], 65535U)); { - MinFrequencyValue = value; + id actualValue = value; + VerifyOrReturn(CheckValue("Options", actualValue, 1U)); } NextTest(); @@ -60298,70 +63987,66 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull MaxFrequencyValue; - CHIP_ERROR TestStep7ReadsTheMaxFrequencyAttribute_11() + CHIP_ERROR TestStep6cThSendsOnCommandToDut_37() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: Reads the MaxFrequency attribute Error: %@", err); + [cluster onWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 6c: TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("maxFrequency", [value unsignedShortValue], 65535U)); - { - MaxFrequencyValue = value; - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7b7cReadsTheCurrentFrequencyAttribute_12() + CHIP_ERROR TestStep6dThSendsAMoveToLevelCommandToTheDutWith_38() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7b & 7C Reads the CurrentFrequency attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6d: TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], MinFrequencyValue)); - VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], MaxFrequencyValue)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep8ReadsTheOnOffTransitionTimeAttribute_13() + CHIP_ERROR TestStep6eThReadsCurrentLevelAttributeFromDut_39() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 8: Reads the OnOffTransitionTime attribute Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6e: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); + } NextTest(); }]; @@ -60369,75 +64054,64 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep9aReadsTheOnLevelAttribute_14() + CHIP_ERROR TestStep6fThSendsOffCommandToDut_40() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 9a: Reads the OnLevel attribute Error: %@", err); + [cluster offWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 6f: TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelValue)); - VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelValue)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep9bReadsTheOnLevelAttribute_15() + CHIP_ERROR TestStep6gThSendsAMoveToLevelCommandToTheDutWith_41() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 9b: Reads the OnLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:120U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6g: TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); - VerifyOrReturn( - CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); - VerifyOrReturn( - CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep10ReadsTheOnTransitionTimeAttribute_16() + CHIP_ERROR TestStep6hThReadsCurrentLevelAttributeFromDut_42() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 10: Reads the OnTransitionTime attribute Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6h: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); } NextTest(); @@ -60446,48 +64120,46 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep11ReadsTheOffTransitionTimeAttribute_17() + CHIP_ERROR TestStep6iThSendsAMoveToLevelCommandToTheDutWith_43() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 11: Reads the OffTransitionTime attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:140U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6i: TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep12ReadsTheDefaultMoveRateAttribute_18() + CHIP_ERROR TestStep6jThReadsCurrentLevelAttributeFromDut_44() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 12: Reads the DefaultMoveRate attribute Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6j: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); } NextTest(); @@ -60496,42 +64168,46 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep13ReadsTheOptionsAttribute_19() + CHIP_ERROR TestStep6kThSendsAMoveToLevelCommandToTheDutWith_45() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 13: Reads the Options attribute Error: %@", err); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:160U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6k: TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("options", "bitmap8", "bitmap8")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep14ReadsTheStartUpCurrentLevelAttribute_20() + CHIP_ERROR TestStep6lThReadsCurrentLevelAttributeFromDut_46() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 14: Reads the StartUpCurrentLevel attribute Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6l: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); } NextTest(); @@ -60541,27 +64217,21 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { } }; -class Test_TC_LVL_2_2 : public TestCommandBridge { +class Test_TC_LVL_4_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_2_2() - : TestCommandBridge("Test_TC_LVL_2_2") + Test_TC_LVL_4_1() + : TestCommandBridge("Test_TC_LVL_4_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("OnOffTransitionTimeConfigValue", 0, UINT16_MAX, &mOnOffTransitionTimeConfigValue); - AddArgument("OnLevelConfigValue", 0, UINT8_MAX, &mOnLevelConfigValue); - AddArgument("OnTransitionTimeConfigValue", 0, UINT16_MAX, &mOnTransitionTimeConfigValue); - AddArgument("OffTransitionTimeConfigValue", 0, UINT16_MAX, &mOffTransitionTimeConfigValue); - AddArgument("DefaultMoveRateConfigValue", 0, UINT8_MAX, &mDefaultMoveRateConfigValue); - AddArgument("StartUpCurrentLevelConfigValue", 0, UINT8_MAX, &mStartUpCurrentLevelConfigValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_2_2() {} + ~Test_TC_LVL_4_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -60569,11 +64239,11 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_4_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_4_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -60590,156 +64260,190 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1a: Reads the OnOffTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestStep1aReadsTheOnOffTransitionTimeAttributeFromTheDut_1(); + err = TestPreconditionSendOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1b: writes the OnOffTransitionTime attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestStep1bWritesTheOnOffTransitionTimeAttributeOnTheDut_2(); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 1c: Reads the OnOffTransitionTime attribute from the DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : Precondition: write default value of OnOffTransitionTime attribute\n"); if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestStep1cReadsTheOnOffTransitionTimeAttributeFromTheDut_3(); + err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 2a: Reads the OnLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 1a: TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { NextTest(); return; } - err = TestStep2aReadsTheOnLevelAttributeFromTheDut_4(); + err = TestStep1aThWrites0ToTheOptionsAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 2b: writes the OnLevel attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 1b: TH reads the MaxLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0003")) { NextTest(); return; } - err = TestStep2bWritesTheOnLevelAttributeOnTheDut_5(); + err = TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 2c: Reads the OnLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 2a: TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C05.Rsp")) { NextTest(); return; } - err = TestStep2cReadsTheOnLevelAttributeFromTheDut_6(); + err = TestStep2aThSendsOffCommandToDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 3a: Reads the OnTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 2b: TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 " + "(units/s)\n"); + if (ShouldSkip("LVL.S.C05.Rsp")) { NextTest(); return; } - err = TestStep3aReadsTheOnTransitionTimeAttributeFromTheDut_7(); + err = TestStep2bThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 3b: Writes the OnTransitionTime attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT\n"); + if (ShouldSkip("OO.S.A0000 && LVL.S.C05.Rsp")) { NextTest(); return; } - err = TestStep3bWritesTheOnTransitionTimeAttributeOnTheDut_8(); + err = TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 3c: Reads the OnTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2d: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep3cReadsTheOnTransitionTimeAttributeFromTheDut_9(); + err = TestStep2dThReadsCurrentLevelAttributeFromDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 4a: Reads the OffTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0013")) { - NextTest(); - return; - } - err = TestStep4aReadsTheOffTransitionTimeAttributeFromTheDut_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 5000ms\n"); + err = TestWait5000ms_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 4b: Writes the OffTransitionTime attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0013")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 2e: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep4bWritesTheOffTransitionTimeAttributeOnTheDut_11(); + err = TestStep2eThReadsCurrentLevelAttributeFromDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Step 4c: Reads the OffTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0013")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3a: TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestStep4cReadsTheOffTransitionTimeAttributeFromTheDut_12(); + err = TestStep3aThSendsOnCommandToDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 5a: Reads the DefaultMoveRate attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0014")) { + ChipLogProgress(chipTool, + " ***** Test Step 13 : Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " + "(immediate)\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestStep5aReadsTheDefaultMoveRateAttributeFromTheDut_13(); + err = TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Step 5b: Writes the DefaultMoveRate attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0014")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : Step 3c: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep5bWritesTheDefaultMoveRateAttributeOnTheDut_14(); + err = TestStep3cThReadsCurrentLevelAttributeFromDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 5c: Reads the DefaultMoveRate attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0014")) { + ChipLogProgress(chipTool, + " ***** Test Step 15 : Step 4a: TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 " + "(units/s)\n"); + if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestStep5cReadsTheDefaultMoveRateAttributeFromTheDut_15(); + err = TestStep4aThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Step 6a: Reads the StartUpCurrentLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A4000")) { + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10s\n"); + err = TestWait10s_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4b: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep6aReadsTheStartUpCurrentLevelAttributeFromTheDut_16(); + err = TestStep4bThReadsCurrentLevelAttributeFromDut_17(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 6b: Rwrites the StartUpCurrentLevel attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A4000")) { + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 10s\n"); + err = TestWait10s_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Step 4c: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep6bRwritesTheStartUpCurrentLevelAttributeOnTheDut_17(); + err = TestStep4cThReadsCurrentLevelAttributeFromDut_19(); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Step 6c: Rreads the StartUpCurrentLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A4000")) { + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait 10s\n"); + err = TestWait10s_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Step 4d: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep6cRreadsTheStartUpCurrentLevelAttributeFromTheDut_18(); + err = TestStep4dThReadsCurrentLevelAttributeFromDut_21(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : writes back default value of OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 19s\n"); + err = TestWait19s_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Step 4e: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19(); + err = TestStep4eThReadsCurrentLevelAttributeFromDut_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Precondition send Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestPreconditionSendOffCommand_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_25(); break; } @@ -60812,6 +64516,24 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -60825,17 +64547,11 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; + const uint16_t mTestCount = 26; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mOnOffTransitionTimeConfigValue; - chip::Optional mOnLevelConfigValue; - chip::Optional mOnTransitionTimeConfigValue; - chip::Optional mOffTransitionTimeConfigValue; - chip::Optional mDefaultMoveRateConfigValue; - chip::Optional mStartUpCurrentLevelConfigValue; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -60845,25 +64561,40 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nonnull OnOffTransitionTimeValue; - CHIP_ERROR TestStep1aReadsTheOnOffTransitionTimeAttributeFromTheDut_1() + CHIP_ERROR TestPreconditionSendOnCommand_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1a: Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); + [cluster onWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Precondition Send On Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); { - OnOffTransitionTimeValue = value; + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -60872,7 +64603,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep1bWritesTheOnOffTransitionTimeAttributeOnTheDut_2() + CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); @@ -60880,14 +64611,13 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = mOnOffTransitionTimeConfigValue.HasValue() - ? [NSNumber numberWithUnsignedShort:mOnOffTransitionTimeConfigValue.Value()] - : [NSNumber numberWithUnsignedShort:10U]; + onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; [cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument completion:^(NSError * _Nullable err) { NSLog( - @"Step 1b: writes the OnOffTransitionTime attribute on the DUT Error: %@", err); + @"Precondition: write default value of OnOffTransitionTime attribute Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -60897,135 +64627,135 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep1cReadsTheOnOffTransitionTimeAttributeFromTheDut_3() + CHIP_ERROR TestStep1aThWrites0ToTheOptionsAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1c: Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 1a: TH writes 0 to the Options attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOffTransitionTime", actualValue, - mOnOffTransitionTimeConfigValue.HasValue() ? mOnOffTransitionTimeConfigValue.Value() : 10U)); - } + NextTest(); + }]; - VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintNotValue("onOffTransitionTime", value, OnOffTransitionTimeValue)); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1b: TH reads the MaxLevel attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable OnLevelValue; - CHIP_ERROR TestStep2aReadsTheOnLevelAttributeFromTheDut_4() + CHIP_ERROR TestStep2aThSendsOffCommandToDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2a: Reads the OnLevel attribute from the DUT Error: %@", err); + [cluster offWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 2a: TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], 254U)); - } - { - OnLevelValue = value; - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2bWritesTheOnLevelAttributeOnTheDut_5() + CHIP_ERROR TestStep2bThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_7() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onLevelArgument; - onLevelArgument = mOnLevelConfigValue.HasValue() ? [NSNumber numberWithUnsignedChar:mOnLevelConfigValue.Value()] - : [NSNumber numberWithUnsignedChar:5U]; - [cluster writeAttributeOnLevelWithValue:onLevelArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2b: writes the OnLevel attribute on the DUT Error: %@", err); + __auto_type * params = [[MTRLevelControlClusterMoveWithOnOffParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0U]; + params.rate = [NSNumber numberWithUnsignedChar:10U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveWithOnOffWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2b: TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 " + @"(units/s) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2cReadsTheOnLevelAttributeFromTheDut_6() + CHIP_ERROR TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2c: Reads the OnLevel attribute from the DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("OnLevel", actualValue)); - VerifyOrReturn( - CheckValue("OnLevel", actualValue, mOnLevelConfigValue.HasValue() ? mOnLevelConfigValue.Value() : 5U)); - } - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } - VerifyOrReturn(CheckConstraintNotValue("onLevel", value, OnLevelValue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable OnTransitionTimeValue; + NSNumber * _Nullable CurrentLevelValue; - CHIP_ERROR TestStep3aReadsTheOnTransitionTimeAttributeFromTheDut_7() + CHIP_ERROR TestStep2dThReadsCurrentLevelAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: Reads the OnTransitionTime attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2d: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); } { - OnTransitionTimeValue = value; + CurrentLevelValue = value; } NextTest(); @@ -61034,246 +64764,220 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3bWritesTheOnTransitionTimeAttributeOnTheDut_8() + CHIP_ERROR TestWait5000ms_10() { - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id onTransitionTimeArgument; - onTransitionTimeArgument = mOnTransitionTimeConfigValue.HasValue() - ? [NSNumber numberWithUnsignedShort:mOnTransitionTimeConfigValue.Value()] - : [NSNumber numberWithUnsignedShort:5U]; - [cluster - writeAttributeOnTransitionTimeWithValue:onTransitionTimeArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 3b: Writes the OnTransitionTime attribute on the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestStep3cReadsTheOnTransitionTimeAttributeFromTheDut_9() + CHIP_ERROR TestStep2eThReadsCurrentLevelAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3c: Reads the OnTransitionTime attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2e: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("OnTransitionTime", actualValue)); - VerifyOrReturn(CheckValue("OnTransitionTime", actualValue, - mOnTransitionTimeConfigValue.HasValue() ? mOnTransitionTimeConfigValue.Value() : 5U)); - } if (value != nil) { - VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); } - VerifyOrReturn(CheckConstraintNotValue("onTransitionTime", value, OnTransitionTimeValue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable OffTransitionTimeValue; - CHIP_ERROR TestStep4aReadsTheOffTransitionTimeAttributeFromTheDut_10() + CHIP_ERROR TestStep3aThSendsOnCommandToDut_12() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: Reads the OffTransitionTime attribute from the DUT Error: %@", err); + [cluster onWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 3a: TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); - } - { - OffTransitionTimeValue = value; - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bWritesTheOffTransitionTimeAttributeOnTheDut_11() + CHIP_ERROR TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_13() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id offTransitionTimeArgument; - offTransitionTimeArgument = mOffTransitionTimeConfigValue.HasValue() - ? [NSNumber numberWithUnsignedShort:mOffTransitionTimeConfigValue.Value()] - : [NSNumber numberWithUnsignedShort:10U]; - [cluster - writeAttributeOffTransitionTimeWithValue:offTransitionTimeArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 4b: Writes the OffTransitionTime attribute on the DUT Error: %@", err); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:50U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " + @"(immediate) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4cReadsTheOffTransitionTimeAttributeFromTheDut_12() + CHIP_ERROR TestStep3cThReadsCurrentLevelAttributeFromDut_14() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4c: Reads the OffTransitionTime attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3c: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("OffTransitionTime", actualValue)); - VerifyOrReturn(CheckValue("OffTransitionTime", actualValue, - mOffTransitionTimeConfigValue.HasValue() ? mOffTransitionTimeConfigValue.Value() : 10U)); - } - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); } - VerifyOrReturn(CheckConstraintNotValue("offTransitionTime", value, OffTransitionTimeValue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable DefaultMoveRatevalue; - CHIP_ERROR TestStep5aReadsTheDefaultMoveRateAttributeFromTheDut_13() + CHIP_ERROR TestStep4aThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_15() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5a: Reads the DefaultMoveRate attribute from the DUT Error: %@", err); + __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0U]; + params.rate = [NSNumber numberWithUnsignedChar:5U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster + moveWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4a: TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 (units/s) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { + NextTest(); + }]; - VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); - } - { - DefaultMoveRatevalue = value; - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWait10s_16() + { - return CHIP_NO_ERROR; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestStep5bWritesTheDefaultMoveRateAttributeOnTheDut_14() + CHIP_ERROR TestStep4bThReadsCurrentLevelAttributeFromDut_17() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id defaultMoveRateArgument; - defaultMoveRateArgument = mDefaultMoveRateConfigValue.HasValue() - ? [NSNumber numberWithUnsignedChar:mDefaultMoveRateConfigValue.Value()] - : [NSNumber numberWithUnsignedChar:111U]; - [cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 5b: Writes the DefaultMoveRate attribute on the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads CurrentLevel attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5cReadsTheDefaultMoveRateAttributeFromTheDut_15() + CHIP_ERROR TestWait10s_18() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep4cThReadsCurrentLevelAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5c: Reads the DefaultMoveRate attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("DefaultMoveRate", actualValue)); - VerifyOrReturn(CheckValue("DefaultMoveRate", actualValue, - mDefaultMoveRateConfigValue.HasValue() ? mDefaultMoveRateConfigValue.Value() : 111U)); - } if (value != nil) { - VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); } - VerifyOrReturn(CheckConstraintNotValue("defaultMoveRate", value, DefaultMoveRatevalue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable StartUpCurrentLevelValue; - CHIP_ERROR TestStep6aReadsTheStartUpCurrentLevelAttributeFromTheDut_16() + CHIP_ERROR TestWait10s_20() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep4dThReadsCurrentLevelAttributeFromDut_21() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6a: Reads the StartUpCurrentLevel attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4d: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); - } - { - StartUpCurrentLevelValue = value; + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 230U)); } NextTest(); @@ -61282,89 +64986,85 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6bRwritesTheStartUpCurrentLevelAttributeOnTheDut_17() + CHIP_ERROR TestWait19s_22() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 19000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep4eThReadsCurrentLevelAttributeFromDut_23() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id startUpCurrentLevelArgument; - startUpCurrentLevelArgument = mStartUpCurrentLevelConfigValue.HasValue() - ? [NSNumber numberWithUnsignedChar:mStartUpCurrentLevelConfigValue.Value()] - : [NSNumber numberWithUnsignedChar:5U]; - [cluster - writeAttributeStartUpCurrentLevelWithValue:startUpCurrentLevelArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6b: Rwrites the StartUpCurrentLevel attribute on the DUT Error: %@", - err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4e: TH reads CurrentLevel attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 254U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6cRreadsTheStartUpCurrentLevelAttributeFromTheDut_18() + CHIP_ERROR TestPreconditionSendOffCommand_24() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6c: Rreads the StartUpCurrentLevel attribute from the DUT Error: %@", err); + [cluster offWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Precondition send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("StartUpCurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("StartUpCurrentLevel", actualValue, - mStartUpCurrentLevelConfigValue.HasValue() ? mStartUpCurrentLevelConfigValue.Value() : 5U)); - } - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); - } - VerifyOrReturn(CheckConstraintNotValue("startUpCurrentLevel", value, StartUpCurrentLevelValue)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_25() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completion:^(NSError * _Nullable err) { - NSLog(@"writes back default value of OnOffTransitionTime attribute Error: %@", err); + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_LVL_3_1 : public TestCommandBridge { +class Test_TC_LVL_5_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_3_1() - : TestCommandBridge("Test_TC_LVL_3_1") + Test_TC_LVL_5_1() + : TestCommandBridge("Test_TC_LVL_5_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -61374,7 +65074,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_3_1() {} + ~Test_TC_LVL_5_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -61382,11 +65082,11 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_3_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_5_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_3_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_5_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -61435,330 +65135,140 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { err = TestStep1ThWrites0ToTheOptionsAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 1a: TH writes NULL to the OnLevel attribute\n"); - if (ShouldSkip("LVL.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 2a: TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C06.Rsp")) { NextTest(); return; } - err = TestStep1aThWritesNullToTheOnLevelAttribute_5(); + err = TestStep2aThSendsOffCommandToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 2a: TH sends Off command to DUT\n"); - if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C00.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : Step 2b: TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 and " + "TransitionTime =0 (immediate)\n"); + if (ShouldSkip("LVL.S.C06.Rsp")) { NextTest(); return; } - err = TestStep2aThSendsOffCommandToDut_6(); + err = TestStep2bThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Step 2b: TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and TransitionTime " - "=0 (immediate)\n"); - if (ShouldSkip("LVL.S.C04.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT\n"); + if (ShouldSkip("OO.S.A0000 && LVL.S.C06.Rsp")) { NextTest(); return; } - err = TestStep2bThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_7(); + err = TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT\n"); - if (ShouldSkip("OO.S.A0000 && LVL.S.C04.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 3a: TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8(); + err = TestStep3aThSendsOnCommandToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2d: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C04.Rsp && LVL.S.A0000")) { + ChipLogProgress(chipTool, + " ***** Test Step 9 : Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " + "(immediate)\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestStep2dThReadsCurrentLevelAttributeFromDut_9(); + err = TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 3a: TH sends On command to DUT\n"); - if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 3c: Reads current level attribute from DUT\n"); + if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestStep3aThSendsOnCommandToDut_10(); + err = TestStep3cReadsCurrentLevelAttributeFromDut_10(); break; case 11: ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " - "(immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + " ***** Test Step 11 : Step 4a: TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and " + "TransitionTime =300\n"); + if (ShouldSkip("LVL.S.C02.Rsp")) { NextTest(); return; } - err = TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_11(); + err = TestStep4aThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3c: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep3cThReadsCurrentLevelAttributeFromDut_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 10s\n"); + err = TestWait10s_12(); break; case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : Step 4a: TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = " - "300 (30 s). This means the level should increase by 150 units in 30s, so 5 units/s\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 4b: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestStep4aThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_13(); + err = TestStep4bThReadsCurrentLevelAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10000ms\n"); - err = TestWait10000ms_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 4b: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestStep4bThReadsCurrentLevelAttributeFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10000ms\n"); - err = TestWait10000ms_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4c: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestStep4cThReadsCurrentLevelAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 10000ms\n"); - err = TestWait10000ms_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 4d: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestStep4dThReadsCurrentLevelAttributeFromDut_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Wait 5000ms\n"); - err = TestWait5000ms_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Step 4e: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestStep4eThReadsCurrentLevelAttributeFromDut_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Step 4f: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestStep4fThReadsCurrentLevelAttributeFromDut_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Step 5a: TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestStep5aThWrites0ToTheOptionsAttribute_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Step 5b: TH reads Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestStep5bThReadsOptionsAttribute_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Step 5c: TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestStep5cThSendsOnCommandToDut_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Step 5d: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep5dThSendsAMoveToLevelCommandToTheDutWith_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Step 5e: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep5eThReadsCurrentLevelAttributeFromDut_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Step 5f: TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep5fThSendsOffCommandToDut_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Step 5g: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep5gThSendsAMoveToLevelCommandToTheDutWith_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Step 5h: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep5hThReadsCurrentLevelAttributeFromDut_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Step 5i: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep5iThSendsAMoveToLevelCommandToTheDutWith_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Step 5j: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep5jThReadsCurrentLevelAttributeFromDut_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Step 5k: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep5kThSendsAMoveToLevelCommandToTheDutWith_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Step 5l: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep5lThReadsCurrentLevelAttributeFromDut_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Step 6a: TH writes 1 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestStep6aThWrites1ToTheOptionsAttribute_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Step 6b: TH reads Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestStep6bThReadsOptionsAttribute_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Step 6c: TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestStep6cThSendsOnCommandToDut_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Step 6d: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep6dThSendsAMoveToLevelCommandToTheDutWith_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Step 6e: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep6eThReadsCurrentLevelAttributeFromDut_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Step 6f: TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep6fThSendsOffCommandToDut_40(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10s\n"); + err = TestWait10s_14(); break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Step 6g: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Step 4c: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestStep6gThSendsAMoveToLevelCommandToTheDutWith_41(); + err = TestStep4cThReadsCurrentLevelAttributeFromDut_15(); break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Step 6h: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10s\n"); + err = TestWait10s_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4d: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestStep6hThReadsCurrentLevelAttributeFromDut_42(); + err = TestStep4dThReadsCurrentLevelAttributeFromDut_17(); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Step 6i: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 5000ms\n"); + err = TestWait5000ms_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Step 4e: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestStep6iThSendsAMoveToLevelCommandToTheDutWith_43(); + err = TestStep4eThReadsCurrentLevelAttributeFromDut_19(); break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Step 6j: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Step 4f: TH reads CurrentLevel attribute from DUT (after DUT has finished the " + "transition)\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { NextTest(); return; } - err = TestStep6jThReadsCurrentLevelAttributeFromDut_44(); + err = TestStep4fThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_20(); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Step 6k: TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Precondition send Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestStep6kThSendsAMoveToLevelCommandToTheDutWith_45(); + err = TestPreconditionSendOffCommand_21(); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Step 6l: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestStep6lThReadsCurrentLevelAttributeFromDut_46(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22(); break; } @@ -61840,78 +65350,6 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 31: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 32: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 33: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 34: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 35: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 36: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 38: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 39: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 40: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 41: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 43: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 45: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -61925,7 +65363,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 47; + const uint16_t mTestCount = 23; chip::Optional mNodeId; chip::Optional mCluster; @@ -62026,28 +65464,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep1aThWritesNullToTheOnLevelAttribute_5() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id onLevelArgument; - onLevelArgument = nil; - [cluster writeAttributeOnLevelWithValue:onLevelArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 1a: TH writes NULL to the OnLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2aThSendsOffCommandToDut_6() + CHIP_ERROR TestStep2aThSendsOffCommandToDut_5() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62065,33 +65482,34 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2bThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_7() + CHIP_ERROR TestStep2bThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_6() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:50U]; + __auto_type * params = [[MTRLevelControlClusterStepWithOnOffParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:0U]; + params.stepSize = [NSNumber numberWithUnsignedChar:50U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2b: TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and " - @"TransitionTime =0 (immediate) Error: %@", - err); + [cluster stepWithOnOffWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2b: TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 " + @"and TransitionTime =0 (immediate) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8() + CHIP_ERROR TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62114,31 +65532,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2dThReadsCurrentLevelAttributeFromDut_9() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2d: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3aThSendsOnCommandToDut_10() + CHIP_ERROR TestStep3aThSendsOnCommandToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62156,7 +65550,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_11() + CHIP_ERROR TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62182,7 +65576,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3cThReadsCurrentLevelAttributeFromDut_12() + CHIP_ERROR TestStep3cReadsCurrentLevelAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62190,7 +65584,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3c: TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Step 3c: Reads current level attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -62206,35 +65600,34 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep4aThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_13() + CHIP_ERROR TestStep4aThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_11() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:200U]; + __auto_type * params = [[MTRLevelControlClusterStepParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:0U]; + params.stepSize = [NSNumber numberWithUnsignedChar:150U]; params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster - moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 4a: TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 " - @"(30 s). This means the level should increase by 150 units in 30s, so 5 units/s Error: %@", - err); + [cluster stepWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4a: TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and " + @"TransitionTime =300 Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_14() + CHIP_ERROR TestWait10s_12() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -62242,7 +65635,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4bThReadsCurrentLevelAttributeFromDut_15() + CHIP_ERROR TestStep4bThReadsCurrentLevelAttributeFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62266,7 +65659,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_16() + CHIP_ERROR TestWait10s_14() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -62274,7 +65667,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4cThReadsCurrentLevelAttributeFromDut_17() + CHIP_ERROR TestStep4cThReadsCurrentLevelAttributeFromDut_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62298,7 +65691,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_18() + CHIP_ERROR TestWait10s_16() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -62306,7 +65699,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4dThReadsCurrentLevelAttributeFromDut_19() + CHIP_ERROR TestStep4dThReadsCurrentLevelAttributeFromDut_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62330,7 +65723,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait5000ms_20() + CHIP_ERROR TestWait5000ms_18() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -62338,7 +65731,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4eThReadsCurrentLevelAttributeFromDut_21() + CHIP_ERROR TestStep4eThReadsCurrentLevelAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62362,7 +65755,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4fThReadsCurrentLevelAttributeFromDut_22() + CHIP_ERROR TestStep4fThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62370,7 +65763,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4f: TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Step 4f: TH reads CurrentLevel attribute from DUT (after DUT has finished the transition) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -62386,117 +65779,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5aThWrites0ToTheOptionsAttribute_23() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 5a: TH writes 0 to the Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5bThReadsOptionsAttribute_24() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5b: TH reads Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("Options", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5cThSendsOnCommandToDut_25() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 5c: TH sends On command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5dThSendsAMoveToLevelCommandToTheDutWith_26() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:100U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 5d: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5eThReadsCurrentLevelAttributeFromDut_27() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5e: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5fThSendsOffCommandToDut_28() + CHIP_ERROR TestPreconditionSendOffCommand_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -62504,424 +65787,31 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster offWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 5f: TH sends Off command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5gThSendsAMoveToLevelCommandToTheDutWith_29() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:120U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 5g: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5hThReadsCurrentLevelAttributeFromDut_30() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5h: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5iThSendsAMoveToLevelCommandToTheDutWith_31() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:140U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 5i: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5jThReadsCurrentLevelAttributeFromDut_32() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5j: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5kThSendsAMoveToLevelCommandToTheDutWith_33() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:160U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 5k: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5lThReadsCurrentLevelAttributeFromDut_34() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5l: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6aThWrites1ToTheOptionsAttribute_35() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:1U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6a: TH writes 1 to the Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6bThReadsOptionsAttribute_36() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6b: TH reads Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("Options", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6cThSendsOnCommandToDut_37() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 6c: TH sends On command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6dThSendsAMoveToLevelCommandToTheDutWith_38() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:100U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6d: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6eThReadsCurrentLevelAttributeFromDut_39() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6e: TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Precondition send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6fThSendsOffCommandToDut_40() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 6f: TH sends Off command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6gThSendsAMoveToLevelCommandToTheDutWith_41() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:120U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6g: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6hThReadsCurrentLevelAttributeFromDut_42() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6h: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6iThSendsAMoveToLevelCommandToTheDutWith_43() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:140U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6i: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6jThReadsCurrentLevelAttributeFromDut_44() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6j: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6kThSendsAMoveToLevelCommandToTheDutWith_45() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:160U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6k: TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6lThReadsCurrentLevelAttributeFromDut_46() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6l: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } NextTest(); @@ -62931,11 +65821,11 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { } }; -class Test_TC_LVL_4_1 : public TestCommandBridge { +class Test_TC_LVL_6_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_4_1() - : TestCommandBridge("Test_TC_LVL_4_1") + Test_TC_LVL_6_1() + : TestCommandBridge("Test_TC_LVL_6_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -62945,7 +65835,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_4_1() {} + ~Test_TC_LVL_6_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -62953,11 +65843,11 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_4_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_6_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_4_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_6_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -62974,190 +65864,138 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition: write default value of OnOffTransitionTime attribute\n"); + if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestPreconditionSendOnCommand_1(); + err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("OO.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1a: H writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + err = TestStep1aHWrites0ToTheOptionsAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Precondition: write default value of OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 1b: TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3(); + err = TestStep1bThSendsOnCommandToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 1a: TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + ChipLogProgress(chipTool, + " ***** Test Step 4 : Step 2a: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " + "(immediate)\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestStep1aThWrites0ToTheOptionsAttribute_4(); + err = TestStep2aThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 1b: TH reads the MaxLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 2b: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5(); + err = TestStep2bThReadsCurrentLevelAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 2a: TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C05.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : Step 2c: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) " + "and the Rate field set to 0x05 (5 units/s)\n"); + if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestStep2aThSendsOffCommandToDut_6(); + err = TestStep2cThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Step 2b: TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 " - "(units/s)\n"); - if (ShouldSkip("LVL.S.C05.Rsp")) { - NextTest(); - return; - } - err = TestStep2bThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 2d: Wait 5000ms\n"); + err = TestStep2dWait5000ms_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT\n"); - if (ShouldSkip("OO.S.A0000 && LVL.S.C05.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 3: Sends stop command to DUT\n"); + if (ShouldSkip("LVL.S.C03.Rsp")) { NextTest(); return; } - err = TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8(); + err = TestStep3SendsStopCommandToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2d: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Physically verify that the device has stopped transitioning\n"); + if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C03.Rsp")) { NextTest(); return; } - err = TestStep2dThReadsCurrentLevelAttributeFromDut_9(); + err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 5000ms\n"); - err = TestWait5000ms_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 2e: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 4: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C03.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep2eThReadsCurrentLevelAttributeFromDut_11(); + err = TestStep4ThReadsCurrentLevelAttributeFromDut_10(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3a: TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 5: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) " + "and the Rate field set to 0x05 (5 units/s)\n"); + if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestStep3aThSendsOnCommandToDut_12(); + err = TestStep5ThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 5000ms\n"); + err = TestWait5000ms_12(); break; case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " - "(immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 6: TH sends a StopWithOnOff command to the DUT\n"); + if (ShouldSkip("LVL.S.C07.Rsp")) { NextTest(); return; } - err = TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_13(); + err = TestStep6ThSendsAStopWithOnOffCommandToTheDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Step 3c: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : Physically verify that the device has stopped transitioning\n"); + if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C07.Rsp")) { NextTest(); return; } - err = TestStep3cThReadsCurrentLevelAttributeFromDut_14(); + err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_14(); break; case 15: - ChipLogProgress(chipTool, - " ***** Test Step 15 : Step 4a: TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 " - "(units/s)\n"); - if (ShouldSkip("LVL.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : Step 7: Reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C07.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep4aThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_15(); + err = TestStep7ReadsCurrentLevelAttributeFromDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10s\n"); - err = TestWait10s_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4b: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep4bThReadsCurrentLevelAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 10s\n"); - err = TestWait10s_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 4c: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep4cThReadsCurrentLevelAttributeFromDut_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Wait 10s\n"); - err = TestWait10s_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Step 4d: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep4dThReadsCurrentLevelAttributeFromDut_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 19s\n"); - err = TestWait19s_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Step 4e: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep4eThReadsCurrentLevelAttributeFromDut_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Precondition send Off Command\n"); + ChipLogProgress(chipTool, " ***** Test Step 16 : Precondition send Off Command\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestPreconditionSendOffCommand_24(); + err = TestPreconditionSendOffCommand_16(); break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Check on/off attribute value is false after off command\n"); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Check on/off attribute value is false after off command\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_25(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17(); break; } @@ -63224,30 +66062,6 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -63261,63 +66075,22 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 26; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestPreconditionSendOnCommand_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Precondition Send On Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3() + CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63341,7 +66114,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep1aThWrites0ToTheOptionsAttribute_4() + CHIP_ERROR TestStep1aHWrites0ToTheOptionsAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63352,7 +66125,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { optionsArgument = [NSNumber numberWithUnsignedChar:0U]; [cluster writeAttributeOptionsWithValue:optionsArgument completion:^(NSError * _Nullable err) { - NSLog(@"Step 1a: TH writes 0 to the Options attribute Error: %@", err); + NSLog(@"Step 1a: H writes 0 to the Options attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -63362,155 +66135,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1b: TH reads the MaxLevel attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2aThSendsOffCommandToDut_6() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 2a: TH sends Off command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2bThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_7() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveWithOnOffParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0U]; - params.rate = [NSNumber numberWithUnsignedChar:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveWithOnOffWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2b: TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 " - @"(units/s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nullable CurrentLevelValue; - - CHIP_ERROR TestStep2dThReadsCurrentLevelAttributeFromDut_9() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2d: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - } - { - CurrentLevelValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait5000ms_10() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestStep2eThReadsCurrentLevelAttributeFromDut_11() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2e: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3aThSendsOnCommandToDut_12() + CHIP_ERROR TestStep1bThSendsOnCommandToDut_3() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63518,7 +66143,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 3a: TH sends On command to DUT Error: %@", err); + NSLog(@"Step 1b: TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -63528,7 +66153,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_13() + CHIP_ERROR TestStep2aThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_4() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63542,7 +66167,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; [cluster moveToLevelWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " + NSLog(@"Step 2a: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " @"(immediate) Error: %@", err); @@ -63554,7 +66179,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3cThReadsCurrentLevelAttributeFromDut_14() + CHIP_ERROR TestStep2bThReadsCurrentLevelAttributeFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63562,7 +66187,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3c: TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Step 2b: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -63578,7 +66203,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_15() + CHIP_ERROR TestStep2cThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63590,61 +66215,61 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { params.rate = [NSNumber numberWithUnsignedChar:5U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster - moveWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 4a: TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 (units/s) Error: %@", - err); + [cluster moveWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2c: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and " + @"the Rate field set to 0x05 (5 units/s) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_16() + CHIP_ERROR TestStep2dWait5000ms_7() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = 5000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4bThReadsCurrentLevelAttributeFromDut_17() + CHIP_ERROR TestStep3SendsStopCommandToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterStopParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster stopWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 3: Sends stop command to DUT Error: %@", err); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_18() + CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestStep4cThReadsCurrentLevelAttributeFromDut_19() + CHIP_ERROR TestStep4ThReadsCurrentLevelAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63652,14 +66277,14 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4c: TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Step 4: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 64U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 86U)); } NextTest(); @@ -63668,47 +66293,73 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_20() + CHIP_ERROR TestStep5ThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0U]; + params.rate = [NSNumber numberWithUnsignedChar:5U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 5: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " + @"Rate field set to 0x05 (5 units/s) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait5000ms_12() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = 5000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4dThReadsCurrentLevelAttributeFromDut_21() + CHIP_ERROR TestStep6ThSendsAStopWithOnOffCommandToTheDut_13() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4d: TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterStopWithOnOffParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster stopWithOnOffWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6: TH sends a StopWithOnOff command to the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 230U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait19s_22() + CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_14() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 19000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestStep4eThReadsCurrentLevelAttributeFromDut_23() + CHIP_ERROR TestStep7ReadsCurrentLevelAttributeFromDut_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63716,14 +66367,14 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4e: TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Step 7: Reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 254U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); } NextTest(); @@ -63732,7 +66383,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionSendOffCommand_24() + CHIP_ERROR TestPreconditionSendOffCommand_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63750,7 +66401,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_25() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -63774,21 +66425,23 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { } }; -class Test_TC_LVL_5_1 : public TestCommandBridge { +class Test_TC_LVL_7_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_5_1() - : TestCommandBridge("Test_TC_LVL_5_1") + Test_TC_LVL_7_1() + : TestCommandBridge("Test_TC_LVL_7_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("RandomLevelValue", 0, UINT8_MAX, &mRandomLevelValue); + AddArgument("RandomFrequencyValue", 0, UINT16_MAX, &mRandomFrequencyValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_5_1() {} + ~Test_TC_LVL_7_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -63796,11 +66449,11 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_5_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_7_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_5_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_7_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -63817,172 +66470,160 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition: write default value of OnOffTransitionTime attribute\n"); + if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestPreconditionSendOnCommand_1(); + err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("OO.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 0a: TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + err = TestStep0aThWrites0ToTheOptionsAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Precondition: write default value of OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 0b: TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3(); + err = TestStep0bThSendsOnCommandToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 1: TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 1a: TH reads the MinLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0002")) { NextTest(); return; } - err = TestStep1ThWrites0ToTheOptionsAttribute_4(); + err = TestStep1aThReadsTheMinLevelAttributeFromTheDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 2a: TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C06.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 1b: TH reads the MaxLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0003")) { NextTest(); return; } - err = TestStep2aThSendsOffCommandToDut_5(); + err = TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5(); break; case 6: ChipLogProgress(chipTool, - " ***** Test Step 6 : Step 2b: TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 and " - "TransitionTime =0 (immediate)\n"); - if (ShouldSkip("LVL.S.C06.Rsp")) { + " ***** Test Step 6 : Step 1c: TH sends a MoveToLevel command to DUT, with the Level field set to a value between " + "the MinLevel and MaxLevel values (if present, otherwise between 0x01 and 0xFE) and the TransitionTime field set " + "to 0x0000 (move immediately).\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestStep2bThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_6(); + err = TestStep1cThSendsAMoveToLevelCommandToDutWithTheLevelFieldSetToAValueBetweenTheMinLevelAndMaxLevelValuesIfPresentOtherwiseBetween0x01And0xFEAndTheTransitionTimeFieldSetTo0x0000MoveImmediately_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT\n"); - if (ShouldSkip("OO.S.A0000 && LVL.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 100ms\n"); + err = TestWait100ms_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 3a: TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 1d: TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestStep3aThSendsOnCommandToDut_8(); + err = TestStep1dThReadsCurrentLevelAttributeFromDut_8(); break; case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " - "(immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2a: TH reads the CurrentFrequency attribute.\n"); + if (ShouldSkip("LVL.S.A0004")) { NextTest(); return; } - err = TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9(); + err = TestStep2aThReadsTheCurrentFrequencyAttribute_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 3c: Reads current level attribute from DUT\n"); - if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 2b: TH reads the MinFrequency attribute.\n"); + if (ShouldSkip("LVL.S.A0005")) { NextTest(); return; } - err = TestStep3cReadsCurrentLevelAttributeFromDut_10(); + err = TestStep2bThReadsTheMinFrequencyAttribute_10(); break; case 11: ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 4a: TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and " - "TransitionTime =300\n"); - if (ShouldSkip("LVL.S.C02.Rsp")) { + " ***** Test Step 11 : Step 2c: TH reads the MaxFrequency attribute and check, if fmax < fmin, FAIL the test.\n"); + if (ShouldSkip("LVL.S.A0006")) { NextTest(); return; } - err = TestStep4aThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_11(); + err = TestStep2cThReadsTheMaxFrequencyAttributeAndCheckIfFmaxFminFailTheTest_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 10s\n"); - err = TestWait10s_12(); + ChipLogProgress(chipTool, + " ***** Test Step 12 : Step 2d: sanity check on values read in steps 2a..2c, if fc < fmin, FAIL the test and fc > " + "fmax, FAIL the test\n"); + if (ShouldSkip("LVL.S.A0004")) { + NextTest(); + return; + } + err = TestStep2dSanityCheckOnValuesReadInSteps2a2cIfFcFminFailTheTestAndFcFmaxFailTheTest_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 4b: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + ChipLogProgress(chipTool, + " ***** Test Step 13 : Step 3a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to " + "a random value frand, chosen such that: fmin < frand < fmax\n"); + if (ShouldSkip("LVL.S.C08.Rsp")) { NextTest(); return; } - err = TestStep4bThReadsCurrentLevelAttributeFromDut_13(); + err = TestStep3aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToARandomValueFrandChosenSuchThatFminFrandFmax_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10s\n"); - err = TestWait10s_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 100ms\n"); + err = TestWait100ms_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 4c: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : Step 3b: TH reads the CurrentFrequency attribute.\n"); + if (ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004")) { NextTest(); return; } - err = TestStep4cThReadsCurrentLevelAttributeFromDut_15(); + err = TestStep3bThReadsTheCurrentFrequencyAttribute_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10s\n"); - err = TestWait10s_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4d: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + ChipLogProgress(chipTool, + " ***** Test Step 16 : Step 4a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to " + "fmax + 1\n"); + if (ShouldSkip("LVL.S.C08.Rsp && PICS_USER_PROMPT")) { NextTest(); return; } - err = TestStep4dThReadsCurrentLevelAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 5000ms\n"); - err = TestWait5000ms_18(); + err = TestStep4aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmax1_16(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 4e: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4b: TH reads the CurrentFrequency attribute.\n"); + if (ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004 && PICS_USER_PROMPT")) { NextTest(); return; } - err = TestStep4eThReadsCurrentLevelAttributeFromDut_19(); + err = TestStep4bThReadsTheCurrentFrequencyAttribute_17(); break; - case 20: + case 18: ChipLogProgress(chipTool, - " ***** Test Step 20 : Step 4f: TH reads CurrentLevel attribute from DUT (after DUT has finished the " - "transition)\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestStep4fThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Precondition send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + " ***** Test Step 18 : Step 5a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to " + "fmin - 1\n"); + if (ShouldSkip("LVL.S.C08.Rsp && PICS_USER_PROMPT")) { NextTest(); return; } - err = TestPreconditionSendOffCommand_21(); + err = TestStep5aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmin1_18(); break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Step 5b: TH reads the CurrentFrequency attribute.\n"); + if (ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004 && PICS_USER_PROMPT")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22(); + err = TestStep5bThReadsTheCurrentFrequencyAttribute_19(); break; } @@ -64055,15 +66696,6 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -64077,11 +66709,13 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 23; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mRandomLevelValue; + chip::Optional mRandomFrequencyValue; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -64092,152 +66726,175 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionSendOnCommand_1() + CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Precondition Send On Command Error: %@", err); + id onOffTransitionTimeArgument; + onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster + writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"Precondition: write default value of OnOffTransitionTime attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestStep0aThWrites0ToTheOptionsAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 0a: TH writes 0 to the Options attribute Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3() + CHIP_ERROR TestStep0bThSendsOnCommandToDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completion:^(NSError * _Nullable err) { - NSLog( - @"Precondition: write default value of OnOffTransitionTime attribute Error: %@", - err); + [cluster onWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Step 0b: TH sends On command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull minLevelValue; - CHIP_ERROR TestStep1ThWrites0ToTheOptionsAttribute_4() + CHIP_ERROR TestStep1aThReadsTheMinLevelAttributeFromTheDut_4() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 1: TH writes 0 to the Options attribute Error: %@", err); + [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1a: TH reads the MinLevel attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 254U)); + { + minLevelValue = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull maxLevelValue; - CHIP_ERROR TestStep2aThSendsOffCommandToDut_5() + CHIP_ERROR TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 2a: TH sends Off command to DUT Error: %@", err); + [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1b: TH reads the MaxLevel attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); + { + maxLevelValue = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2bThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_6() + CHIP_ERROR + TestStep1cThSendsAMoveToLevelCommandToDutWithTheLevelFieldSetToAValueBetweenTheMinLevelAndMaxLevelValuesIfPresentOtherwiseBetween0x01And0xFEAndTheTransitionTimeFieldSetTo0x0000MoveImmediately_6() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterStepWithOnOffParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:0U]; - params.stepSize = [NSNumber numberWithUnsignedChar:50U]; + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = mRandomLevelValue.HasValue() ? [NSNumber numberWithUnsignedChar:mRandomLevelValue.Value()] + : [NSNumber numberWithUnsignedChar:100U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stepWithOnOffWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2b: TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 " - @"and TransitionTime =0 (immediate) Error: %@", - err); + [cluster moveToLevelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 1c: TH sends a MoveToLevel command to DUT, with the Level field set to a value " + @"between the MinLevel and MaxLevel values (if present, otherwise between 0x01 and 0xFE) and " + @"the TransitionTime field set to 0x0000 (move immediately). Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2cThReadsOnOffAttributeOnOffClusterFromDut_7() + CHIP_ERROR TestWait100ms_7() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep1dThReadsCurrentLevelAttributeFromDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2c: TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1d: TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn( + CheckValue("CurrentLevel", actualValue, mRandomLevelValue.HasValue() ? mRandomLevelValue.Value() : 100U)); } NextTest(); @@ -64245,67 +66902,77 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull CurrentFrequencyValue; - CHIP_ERROR TestStep3aThSendsOnCommandToDut_8() + CHIP_ERROR TestStep2aThReadsTheCurrentFrequencyAttribute_9() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 3a: TH sends On command to DUT Error: %@", err); + [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2a: TH reads the CurrentFrequency attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], 65535U)); + { + CurrentFrequencyValue = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MinFrequencyValue; - CHIP_ERROR TestStep3bThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9() + CHIP_ERROR TestStep2bThReadsTheMinFrequencyAttribute_10() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 3b: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " - @"(immediate) Error: %@", - err); + [cluster readAttributeMinFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2b: TH reads the MinFrequency attribute. Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("minFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("minFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minFrequency", [value unsignedShortValue], 65535U)); + { + MinFrequencyValue = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MaxFrequencyValue; - CHIP_ERROR TestStep3cReadsCurrentLevelAttributeFromDut_10() + CHIP_ERROR TestStep2cThReadsTheMaxFrequencyAttributeAndCheckIfFmaxFminFailTheTest_11() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3c: Reads current level attribute from DUT Error: %@", err); + [cluster readAttributeMaxFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2c: TH reads the MaxFrequency attribute and check, if fmax < fmin, FAIL the test. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("maxFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("maxFrequency", [value unsignedShortValue], MinFrequencyValue)); + VerifyOrReturn(CheckConstraintMaxValue("maxFrequency", [value unsignedShortValue], 65535U)); { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); + MaxFrequencyValue = value; } NextTest(); @@ -64314,57 +66981,80 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_11() + CHIP_ERROR TestStep2dSanityCheckOnValuesReadInSteps2a2cIfFcFminFailTheTestAndFcFmaxFailTheTest_12() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterStepParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:0U]; - params.stepSize = [NSNumber numberWithUnsignedChar:150U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stepWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 4a: TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and " - @"TransitionTime =300 Error: %@", - err); + [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2d: sanity check on values read in steps 2a..2c, if fc < fmin, FAIL the test and fc > fmax, FAIL the test " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], MinFrequencyValue)); + VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], MaxFrequencyValue)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_12() + CHIP_ERROR + TestStep3aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToARandomValueFrandChosenSuchThatFminFrandFmax_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveToClosestFrequencyParams alloc] init]; + params.frequency = mRandomFrequencyValue.HasValue() ? [NSNumber numberWithUnsignedShort:mRandomFrequencyValue.Value()] + : [NSNumber numberWithUnsignedShort:30000U]; + [cluster + moveToClosestFrequencyWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Step 3a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field " + @"set to a random value frand, chosen such that: fmin < frand < fmax Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_14() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = 100UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4bThReadsCurrentLevelAttributeFromDut_13() + CHIP_ERROR TestStep3bThReadsTheCurrentFrequencyAttribute_15() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3b: TH reads the CurrentFrequency attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue( + "CurrentFrequency", actualValue, mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); } NextTest(); @@ -64373,30 +67063,32 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_14() + CHIP_ERROR TestStep4aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmax1_16() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestStep4cThReadsCurrentLevelAttributeFromDut_15() + CHIP_ERROR TestStep4bThReadsTheCurrentFrequencyAttribute_17() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4c: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads the CurrentFrequency attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue( + "CurrentFrequency", actualValue, mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); } NextTest(); @@ -64405,30 +67097,32 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_16() + CHIP_ERROR TestStep5aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmin1_18() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestStep4dThReadsCurrentLevelAttributeFromDut_17() + CHIP_ERROR TestStep5bThReadsTheCurrentFrequencyAttribute_19() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4d: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5b: TH reads the CurrentFrequency attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 200U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue( + "CurrentFrequency", actualValue, mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); } NextTest(); @@ -64436,56 +67130,257 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWait5000ms_18() +class Test_TC_LCFG_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LCFG_1_1() + : TestCommandBridge("Test_TC_LCFG_1_1") + , mTestIndex(0) { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); + ~Test_TC_LCFG_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LCFG_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LCFG_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the ClusterRevision from DUT\n"); + err = TestStep2ThReadsTheClusterRevisionFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the FeatureMap from DUT\n"); + err = TestStep3ThReadsTheFeatureMapFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads AttributeList from DUT\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4ThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH reads AttributeList from DUT\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4ThReadsAttributeListFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: Read the global attribute: EventList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: TH reads AcceptedCommandList from DUT\n"); + err = TestStep6ThReadsAcceptedCommandListFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH reads GeneratedCommandList from DUT\n"); + err = TestStep7ThReadsGeneratedCommandListFromDut_7(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestStep4eThReadsCurrentLevelAttributeFromDut_19() + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4e: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads the ClusterRevision from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsTheFeatureMapFromDut_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads the FeatureMap from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4ThReadsAttributeListFromDut_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4fThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_20() + CHIP_ERROR TestStep4ThReadsAttributeListFromDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4f: TH reads CurrentLevel attribute from DUT (after DUT has finished the transition) Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -64493,41 +67388,52 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionSendOffCommand_21() + CHIP_ERROR TestStep6ThReadsAcceptedCommandListFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Precondition send Off Command Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: TH reads AcceptedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22() + CHIP_ERROR TestStep7ThReadsGeneratedCommandListFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: TH reads GeneratedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -64535,11 +67441,11 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { } }; -class Test_TC_LVL_6_1 : public TestCommandBridge { +class Test_TC_LUNIT_1_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_6_1() - : TestCommandBridge("Test_TC_LVL_6_1") + Test_TC_LUNIT_1_2() + : TestCommandBridge("Test_TC_LUNIT_1_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -64549,7 +67455,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_6_1() {} + ~Test_TC_LUNIT_1_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -64557,11 +67463,11 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_6_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LUNIT_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_6_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LUNIT_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -64574,142 +67480,70 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition: write default value of OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { - NextTest(); - return; - } - err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the ClusterRevision from DUT\n"); + err = TestStep2ThReadsTheClusterRevisionFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1a: H writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the FeatureMap from DUT\n"); + if (ShouldSkip(" !LUNIT.S.F00 ")) { NextTest(); return; } - err = TestStep1aHWrites0ToTheOptionsAttribute_2(); + err = TestStep3ThReadsTheFeatureMapFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 1b: TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 3 : Step 3: Given LUNIT.S.F00(TEMP) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("LUNIT.S.F00")) { NextTest(); return; } - err = TestStep1bThSendsOnCommandToDut_3(); + err = TestStep3GivenLunitsf00tempEnsureFeaturemapHasTheCorrectBitSet_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Step 2a: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " - "(immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads AttributeList from DUT\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep2aThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_4(); + err = TestStep4aThReadsAttributeListFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 2b: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads AttributeList from DUT\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep2bThReadsCurrentLevelAttributeFromDut_5(); + err = TestStep4aThReadsAttributeListFromDut_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Step 2c: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) " - "and the Rate field set to 0x05 (5 units/s)\n"); - if (ShouldSkip("LVL.S.C01.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 6 : Step 4b: TH reads Feature dependent(LUNIT.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("LUNIT.S.F00")) { NextTest(); return; } - err = TestStep2cThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_6(); + err = TestStep4bThReadsFeatureDependentLUNITSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 2d: Wait 5000ms\n"); - err = TestStep2dWait5000ms_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 3: Sends stop command to DUT\n"); - if (ShouldSkip("LVL.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 5: TH reads EventList from DUT\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep3SendsStopCommandToDut_8(); + NextTest(); + return; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 6: TH reads AcceptedCommandList from DUT\n"); + err = TestStep6ThReadsAcceptedCommandListFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Physically verify that the device has stopped transitioning\n"); - if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 4: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C03.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep4ThReadsCurrentLevelAttributeFromDut_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 5: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) " - "and the Rate field set to 0x05 (5 units/s)\n"); - if (ShouldSkip("LVL.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestStep5ThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 5000ms\n"); - err = TestWait5000ms_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 6: TH sends a StopWithOnOff command to the DUT\n"); - if (ShouldSkip("LVL.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestStep6ThSendsAStopWithOnOffCommandToTheDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Physically verify that the device has stopped transitioning\n"); - if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 7: Reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C07.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep7ReadsCurrentLevelAttributeFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Precondition send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOffCommand_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 7: TH reads GeneratedCommandList from DUT\n"); + err = TestStep7ThReadsGeneratedCommandListFromDut_9(); break; } @@ -64752,30 +67586,6 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -64789,14 +67599,14 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -64804,202 +67614,92 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completion:^(NSError * _Nullable err) { - NSLog( - @"Precondition: write default value of OnOffTransitionTime attribute Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep1aHWrites0ToTheOptionsAttribute_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 1a: H writes 0 to the Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep1bThSendsOnCommandToDut_3() + CHIP_ERROR TestStep2ThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 1b: TH sends On command to DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads the ClusterRevision from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2aThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2a: TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 " - @"(immediate) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2bThReadsCurrentLevelAttributeFromDut_5() + CHIP_ERROR TestStep3ThReadsTheFeatureMapFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2b: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads the FeatureMap from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2cThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_6() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0U]; - params.rate = [NSNumber numberWithUnsignedChar:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2c: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and " - @"the Rate field set to 0x05 (5 units/s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2dWait5000ms_7() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestStep3SendsStopCommandToDut_8() + CHIP_ERROR TestStep3GivenLunitsf00tempEnsureFeaturemapHasTheCorrectBitSet_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterStopParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stopWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 3: Sends stop command to DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: Given LUNIT.S.F00(TEMP) ensure featuremap has the correct bit set Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep4ThReadsCurrentLevelAttributeFromDut_10() + CHIP_ERROR TestStep4aThReadsAttributeListFromDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 64U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 86U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -65007,89 +67707,45 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5ThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_11() + CHIP_ERROR TestStep4aThReadsAttributeListFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0U]; - params.rate = [NSNumber numberWithUnsignedChar:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 5: TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " - @"Rate field set to 0x05 (5 units/s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait5000ms_12() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestStep6ThSendsAStopWithOnOffCommandToTheDut_13() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); - __auto_type * params = [[MTRLevelControlClusterStopWithOnOffParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stopWithOnOffWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6: TH sends a StopWithOnOff command to the DUT Error: %@", err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_14() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep7ReadsCurrentLevelAttributeFromDut_15() + CHIP_ERROR TestStep4bThReadsFeatureDependentLUNITSF00AttributeInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: Reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads Feature dependent(LUNIT.S.F00) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); NextTest(); }]; @@ -65097,41 +67753,48 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionSendOffCommand_16() + CHIP_ERROR TestStep6ThReadsAcceptedCommandListFromDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Precondition send Off Command Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: TH reads AcceptedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17() + CHIP_ERROR TestStep7ThReadsGeneratedCommandListFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: TH reads GeneratedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -65139,23 +67802,21 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { } }; -class Test_TC_LVL_7_1 : public TestCommandBridge { +class Test_TC_LUNIT_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_7_1() - : TestCommandBridge("Test_TC_LVL_7_1") + Test_TC_LUNIT_3_1() + : TestCommandBridge("Test_TC_LUNIT_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("RandomLevelValue", 0, UINT8_MAX, &mRandomLevelValue); - AddArgument("RandomFrequencyValue", 0, UINT16_MAX, &mRandomFrequencyValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_7_1() {} + ~Test_TC_LUNIT_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -65163,11 +67824,11 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_7_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LUNIT_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_7_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LUNIT_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -65180,164 +67841,72 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + ChipLogProgress(chipTool, " ***** Test Step 0 : wait for the commissioned device to be retrieved\n"); err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition: write default value of OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: TH reads TemperatureUnit attribute from DUT\n"); + if (ShouldSkip("LUNIT.S.A0000")) { NextTest(); return; } - err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1(); + err = TestStep1ThReadsTemperatureUnitAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 0a: TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: TH writes 0 (Fahrenheit) to TemperatureUnit attribute\n"); + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit")) { NextTest(); return; } - err = TestStep0aThWrites0ToTheOptionsAttribute_2(); + err = TestStep2ThWrites0FahrenheitToTemperatureUnitAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 0b: TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads TemperatureUnit attribute\n"); + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit")) { NextTest(); return; } - err = TestStep0bThSendsOnCommandToDut_3(); + err = TestStep3ThReadsTemperatureUnitAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 1a: TH reads the MinLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH writes 1 (Celsius) to TemperatureUnit attribute\n"); + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius")) { NextTest(); return; } - err = TestStep1aThReadsTheMinLevelAttributeFromTheDut_4(); + err = TestStep4ThWrites1CelsiusToTemperatureUnitAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 1b: TH reads the MaxLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: TH reads TemperatureUnit attribute\n"); + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius")) { NextTest(); return; } - err = TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5(); + err = TestStep5ThReadsTemperatureUnitAttribute_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Step 1c: TH sends a MoveToLevel command to DUT, with the Level field set to a value between " - "the MinLevel and MaxLevel values (if present, otherwise between 0x01 and 0xFE) and the TransitionTime field set " - "to 0x0000 (move immediately).\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: TH writes 2 (Kelvin) to TemperatureUnit attribute\n"); + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin")) { NextTest(); return; } - err = TestStep1cThSendsAMoveToLevelCommandToDutWithTheLevelFieldSetToAValueBetweenTheMinLevelAndMaxLevelValuesIfPresentOtherwiseBetween0x01And0xFEAndTheTransitionTimeFieldSetTo0x0000MoveImmediately_6(); + err = TestStep6ThWrites2KelvinToTemperatureUnitAttribute_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 100ms\n"); - err = TestWait100ms_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 1d: TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestStep1dThReadsCurrentLevelAttributeFromDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2a: TH reads the CurrentFrequency attribute.\n"); - if (ShouldSkip("LVL.S.A0004")) { - NextTest(); - return; - } - err = TestStep2aThReadsTheCurrentFrequencyAttribute_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 2b: TH reads the MinFrequency attribute.\n"); - if (ShouldSkip("LVL.S.A0005")) { - NextTest(); - return; - } - err = TestStep2bThReadsTheMinFrequencyAttribute_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 2c: TH reads the MaxFrequency attribute and check, if fmax < fmin, FAIL the test.\n"); - if (ShouldSkip("LVL.S.A0006")) { - NextTest(); - return; - } - err = TestStep2cThReadsTheMaxFrequencyAttributeAndCheckIfFmaxFminFailTheTest_11(); - break; - case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Step 2d: sanity check on values read in steps 2a..2c, if fc < fmin, FAIL the test and fc > " - "fmax, FAIL the test\n"); - if (ShouldSkip("LVL.S.A0004")) { - NextTest(); - return; - } - err = TestStep2dSanityCheckOnValuesReadInSteps2a2cIfFcFminFailTheTestAndFcFmaxFailTheTest_12(); - break; - case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : Step 3a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to " - "a random value frand, chosen such that: fmin < frand < fmax\n"); - if (ShouldSkip("LVL.S.C08.Rsp")) { - NextTest(); - return; - } - err = TestStep3aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToARandomValueFrandChosenSuchThatFminFrandFmax_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 100ms\n"); - err = TestWait100ms_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 3b: TH reads the CurrentFrequency attribute.\n"); - if (ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004")) { - NextTest(); - return; - } - err = TestStep3bThReadsTheCurrentFrequencyAttribute_15(); - break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Step 4a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to " - "fmax + 1\n"); - if (ShouldSkip("LVL.S.C08.Rsp && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestStep4aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmax1_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 4b: TH reads the CurrentFrequency attribute.\n"); - if (ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004 && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestStep4bThReadsTheCurrentFrequencyAttribute_17(); - break; - case 18: - ChipLogProgress(chipTool, - " ***** Test Step 18 : Step 5a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field set to " - "fmin - 1\n"); - if (ShouldSkip("LVL.S.C08.Rsp && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH reads TemperatureUnit attribute\n"); + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin")) { NextTest(); return; } - err = TestStep5aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmin1_18(); + err = TestStep7ThReadsTemperatureUnitAttribute_7(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 5b: TH reads the CurrentFrequency attribute.\n"); - if (ShouldSkip("LVL.S.C08.Rsp && LVL.S.A0004 && PICS_USER_PROMPT")) { + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 8: TH writes 5 to TemperatureUnit attribute\n"); + if (ShouldSkip("LUNIT.S.A0000")) { NextTest(); return; } - err = TestStep5bThReadsTheCurrentFrequencyAttribute_19(); + err = TestStep8ThWrites5ToTemperatureUnitAttribute_8(); break; } @@ -65375,40 +67944,7 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; } @@ -65423,13 +67959,11 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mRandomLevelValue; - chip::Optional mRandomFrequencyValue; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -65440,201 +67974,62 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completion:^(NSError * _Nullable err) { - NSLog( - @"Precondition: write default value of OnOffTransitionTime attribute Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep0aThWrites0ToTheOptionsAttribute_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 0a: TH writes 0 to the Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep0bThSendsOnCommandToDut_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 0b: TH sends On command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull minLevelValue; - - CHIP_ERROR TestStep1aThReadsTheMinLevelAttributeFromTheDut_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1a: TH reads the MinLevel attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 254U)); - { - minLevelValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull maxLevelValue; - - CHIP_ERROR TestStep1bThReadsTheMaxLevelAttributeFromTheDut_5() + CHIP_ERROR TestStep1ThReadsTemperatureUnitAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1b: TH reads the MaxLevel attribute from the DUT Error: %@", err); + [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1: TH reads TemperatureUnit attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); - { - maxLevelValue = value; - } - + VerifyOrReturn(CheckConstraintType("temperatureUnit", "enum8", "enum8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep1cThSendsAMoveToLevelCommandToDutWithTheLevelFieldSetToAValueBetweenTheMinLevelAndMaxLevelValuesIfPresentOtherwiseBetween0x01And0xFEAndTheTransitionTimeFieldSetTo0x0000MoveImmediately_6() + CHIP_ERROR TestStep2ThWrites0FahrenheitToTemperatureUnitAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = mRandomLevelValue.HasValue() ? [NSNumber numberWithUnsignedChar:mRandomLevelValue.Value()] - : [NSNumber numberWithUnsignedChar:100U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 1c: TH sends a MoveToLevel command to DUT, with the Level field set to a value " - @"between the MinLevel and MaxLevel values (if present, otherwise between 0x01 and 0xFE) and " - @"the TransitionTime field set to 0x0000 (move immediately). Error: %@", - err); + id temperatureUnitArgument; + temperatureUnitArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster + writeAttributeTemperatureUnitWithValue:temperatureUnitArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2: TH writes 0 (Fahrenheit) to TemperatureUnit attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_7() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestStep1dThReadsCurrentLevelAttributeFromDut_8() + CHIP_ERROR TestStep3ThReadsTemperatureUnitAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1d: TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads TemperatureUnit attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn( - CheckValue("CurrentLevel", actualValue, mRandomLevelValue.HasValue() ? mRandomLevelValue.Value() : 100U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull CurrentFrequencyValue; - - CHIP_ERROR TestStep2aThReadsTheCurrentFrequencyAttribute_9() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2a: TH reads the CurrentFrequency attribute. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], 65535U)); - { - CurrentFrequencyValue = value; + VerifyOrReturn(CheckValue("TemperatureUnit", actualValue, 0U)); } NextTest(); @@ -65642,51 +68037,44 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull MinFrequencyValue; - CHIP_ERROR TestStep2bThReadsTheMinFrequencyAttribute_10() + CHIP_ERROR TestStep4ThWrites1CelsiusToTemperatureUnitAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2b: TH reads the MinFrequency attribute. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id temperatureUnitArgument; + temperatureUnitArgument = [NSNumber numberWithUnsignedChar:1U]; + [cluster + writeAttributeTemperatureUnitWithValue:temperatureUnitArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4: TH writes 1 (Celsius) to TemperatureUnit attribute Error: %@", err); - VerifyOrReturn(CheckConstraintType("minFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("minFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minFrequency", [value unsignedShortValue], 65535U)); - { - MinFrequencyValue = value; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MaxFrequencyValue; - CHIP_ERROR TestStep2cThReadsTheMaxFrequencyAttributeAndCheckIfFmaxFminFailTheTest_11() + CHIP_ERROR TestStep5ThReadsTemperatureUnitAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2c: TH reads the MaxFrequency attribute and check, if fmax < fmin, FAIL the test. Error: %@", err); + [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: TH reads TemperatureUnit attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxFrequency", [value unsignedShortValue], MinFrequencyValue)); - VerifyOrReturn(CheckConstraintMaxValue("maxFrequency", [value unsignedShortValue], 65535U)); { - MaxFrequencyValue = value; + id actualValue = value; + VerifyOrReturn(CheckValue("TemperatureUnit", actualValue, 1U)); } NextTest(); @@ -65695,114 +68083,42 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2dSanityCheckOnValuesReadInSteps2a2cIfFcFminFailTheTestAndFcFmaxFailTheTest_12() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2d: sanity check on values read in steps 2a..2c, if fc < fmin, FAIL the test and fc > fmax, FAIL the test " - @"Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], MinFrequencyValue)); - VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], MaxFrequencyValue)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR - TestStep3aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToARandomValueFrandChosenSuchThatFminFrandFmax_13() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToClosestFrequencyParams alloc] init]; - params.frequency = mRandomFrequencyValue.HasValue() ? [NSNumber numberWithUnsignedShort:mRandomFrequencyValue.Value()] - : [NSNumber numberWithUnsignedShort:30000U]; - [cluster - moveToClosestFrequencyWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Step 3a: TH sends a MoveToClosestFrequency command to DUT, with the frequency field " - @"set to a random value frand, chosen such that: fmin < frand < fmax Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_14() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestStep3bThReadsTheCurrentFrequencyAttribute_15() + CHIP_ERROR TestStep6ThWrites2KelvinToTemperatureUnitAttribute_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3b: TH reads the CurrentFrequency attribute. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue( - "CurrentFrequency", actualValue, mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); - } - - NextTest(); - }]; + id temperatureUnitArgument; + temperatureUnitArgument = [NSNumber numberWithUnsignedChar:2U]; + [cluster writeAttributeTemperatureUnitWithValue:temperatureUnitArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6: TH writes 2 (Kelvin) to TemperatureUnit attribute Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestStep4aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmax1_16() - { + NextTest(); + }]; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bThReadsTheCurrentFrequencyAttribute_17() + CHIP_ERROR TestStep7ThReadsTemperatureUnitAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: TH reads the CurrentFrequency attribute. Error: %@", err); + [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: TH reads TemperatureUnit attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue( - "CurrentFrequency", actualValue, mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); + VerifyOrReturn(CheckValue("TemperatureUnit", actualValue, 2U)); } NextTest(); @@ -65811,46 +68127,37 @@ class Test_TC_LVL_7_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5aThSendsAMoveToClosestFrequencyCommandToDutWithTheFrequencyFieldSetToFmin1_18() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep5bThReadsTheCurrentFrequencyAttribute_19() + CHIP_ERROR TestStep8ThWrites5ToTemperatureUnitAttribute_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5b: TH reads the CurrentFrequency attribute. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue( - "CurrentFrequency", actualValue, mRandomFrequencyValue.HasValue() ? mRandomFrequencyValue.Value() : 30000U)); - } + id temperatureUnitArgument; + temperatureUnitArgument = [NSNumber numberWithUnsignedChar:5U]; + [cluster writeAttributeTemperatureUnitWithValue:temperatureUnitArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 8: TH writes 5 to TemperatureUnit attribute Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] + ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_LCFG_1_1 : public TestCommandBridge { +class Test_TC_LTIME_1_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LCFG_1_1() - : TestCommandBridge("Test_TC_LCFG_1_1") + Test_TC_LTIME_1_2() + : TestCommandBridge("Test_TC_LTIME_1_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -65860,7 +68167,7 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LCFG_1_1() {} + ~Test_TC_LTIME_1_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -65868,11 +68175,11 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LCFG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LTIME_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LCFG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LTIME_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -65897,36 +68204,54 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { err = TestStep3ThReadsTheFeatureMapFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads AttributeList from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4a: TH reads AttributeList from DUT\n"); if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep4ThReadsAttributeListFromDut_3(); + err = TestStep4aThReadsAttributeListFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH reads AttributeList from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads AttributeList from DUT\n"); if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep4ThReadsAttributeListFromDut_4(); + err = TestStep4aThReadsAttributeListFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: Read the global attribute: EventList\n"); + ChipLogProgress(chipTool, + " ***** Test Step 5 : Step 4b: TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT\n"); + if (ShouldSkip("LTIME.S.A0001")) { + NextTest(); + return; + } + err = TestStep4bThReadsOptionalAttributeActiveCalendarTypeInAttributeListFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Step 4c: TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT\n"); + if (ShouldSkip("LTIME.S.A0002")) { + NextTest(); + return; + } + err = TestStep4cThReadsOptionalAttributeSupportedCalendarTypesInAttributeListFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 5: TH reads EventList from DUT\n"); if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } NextTest(); return; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: TH reads AcceptedCommandList from DUT\n"); - err = TestStep6ThReadsAcceptedCommandListFromDut_6(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 6: TH reads AcceptedCommandList from DUT\n"); + err = TestStep6ThReadsAcceptedCommandListFromDut_8(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH reads GeneratedCommandList from DUT\n"); - err = TestStep7ThReadsGeneratedCommandListFromDut_7(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 7: TH reads GeneratedCommandList from DUT\n"); + err = TestStep7ThReadsGeneratedCommandListFromDut_9(); break; } @@ -65963,6 +68288,12 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -65976,7 +68307,7 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -65995,9 +68326,9 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -66021,9 +68352,9 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -66031,35 +68362,32 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 1UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ThReadsAttributeListFromDut_3() + CHIP_ERROR TestStep4aThReadsAttributeListFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); + NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); @@ -66073,23 +68401,22 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ThReadsAttributeListFromDut_4() + CHIP_ERROR TestStep4aThReadsAttributeListFromDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: TH reads AttributeList from DUT Error: %@", err); + NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -66102,13 +68429,59 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6ThReadsAcceptedCommandListFromDut_6() + CHIP_ERROR TestStep4bThReadsOptionalAttributeActiveCalendarTypeInAttributeListFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4cThReadsOptionalAttributeSupportedCalendarTypesInAttributeListFromDut_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6ThReadsAcceptedCommandListFromDut_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -66128,13 +68501,13 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ThReadsGeneratedCommandListFromDut_7() + CHIP_ERROR TestStep7ThReadsGeneratedCommandListFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLocalizationConfiguration alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -66155,11 +68528,11 @@ class Test_TC_LCFG_1_1 : public TestCommandBridge { } }; -class Test_TC_LUNIT_1_2 : public TestCommandBridge { +class Test_TC_LTIME_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LUNIT_1_2() - : TestCommandBridge("Test_TC_LUNIT_1_2") + Test_TC_LTIME_3_1() + : TestCommandBridge("Test_TC_LTIME_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66169,7 +68542,7 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LUNIT_1_2() {} + ~Test_TC_LTIME_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66177,11 +68550,11 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LUNIT_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LTIME_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LUNIT_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LTIME_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -66194,70 +68567,98 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 0: Wait for the commissioned device to be retrieved\n"); + err = TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the ClusterRevision from DUT\n"); - err = TestStep2ThReadsTheClusterRevisionFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: TH reads HourFormat attribute from DUT\n"); + if (ShouldSkip("LTIME.S.A0000")) { + NextTest(); + return; + } + err = TestStep1ThReadsHourFormatAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the FeatureMap from DUT\n"); - if (ShouldSkip(" !LUNIT.S.F00 ")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: If (LTIME.S.A0000.12HR) TH writes 0 to HourFormat attribute\n"); + if (ShouldSkip("LTIME.S.A0000.12HR")) { NextTest(); return; } - err = TestStep3ThReadsTheFeatureMapFromDut_2(); + err = TestStep2IfLtimesa000012hrThWrites0ToHourFormatAttribute_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Step 3: Given LUNIT.S.F00(TEMP) ensure featuremap has the correct bit set\n"); - if (ShouldSkip("LUNIT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads HourFormat attribute\n"); + if (ShouldSkip("LTIME.S.A0000")) { NextTest(); return; } - err = TestStep3GivenLunitsf00tempEnsureFeaturemapHasTheCorrectBitSet_3(); + err = TestStep3ThReadsHourFormatAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads AttributeList from DUT\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: If (LTIME.S.A0000.24HR) TH writes 1 to HourFormat attribute\n"); + if (ShouldSkip("LTIME.S.A0000.24HR")) { NextTest(); return; } - err = TestStep4aThReadsAttributeListFromDut_4(); + err = TestStep4IfLtimesa000024hrThWrites1ToHourFormatAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads AttributeList from DUT\n"); - if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: TH reads HourFormat attribute\n"); + if (ShouldSkip("LTIME.S.A0000")) { NextTest(); return; } - err = TestStep4aThReadsAttributeListFromDut_5(); + err = TestStep5ThReadsHourFormatAttribute_5(); break; case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Step 4b: TH reads Feature dependent(LUNIT.S.F00) attribute in AttributeList\n"); - if (ShouldSkip("LUNIT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: TH reads ActiveCalendarType attribute from DUT\n"); + if (ShouldSkip("LTIME.S.A0001")) { NextTest(); return; } - err = TestStep4bThReadsFeatureDependentLUNITSF00AttributeInAttributeList_6(); + err = TestStep6ThReadsActiveCalendarTypeAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 5: TH reads EventList from DUT\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH reads SupportedCalendarTypes attribute from DUT\n"); + if (ShouldSkip("LTIME.S.A0002")) { NextTest(); return; } - NextTest(); - return; + err = TestStep7ThReadsSupportedCalendarTypesAttributeFromDut_7(); + break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 6: TH reads AcceptedCommandList from DUT\n"); - err = TestStep6ThReadsAcceptedCommandListFromDut_8(); + ChipLogProgress(chipTool, + " ***** Test Step 8 : Step 8: TH writes value in PIXIT.LTIME.SCT to ActiveCalendarType attribute, followed by " + "reading the ActiveCalendarType attribute value\n"); + if (ShouldSkip("LTIME.S.A0001 && PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestStep8ThWritesValueInPixitltimesctToActiveCalendarTypeAttributeFollowedByReadingTheActiveCalendarTypeAttributeValue_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 7: TH reads GeneratedCommandList from DUT\n"); - err = TestStep7ThReadsGeneratedCommandListFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 9: Repeat step 8 for all the values in PIXIT.LTIME.SCT\n"); + if (ShouldSkip("LTIME.S.A0001 && PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestStep9RepeatStep8ForAllTheValuesInPixitltimesct_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 10: TH writes 50 to ActiveCalendarType attribute\n"); + if (ShouldSkip("LTIME.S.A0001")) { + NextTest(); + return; + } + err = TestStep10ThWrites50ToActiveCalendarTypeAttribute_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 11: TH writes 5 to HourFormat attribute\n"); + if (ShouldSkip("LTIME.S.A0000")) { + NextTest(); + return; + } + err = TestStep11ThWrites5ToHourFormatAttribute_11(); break; } @@ -66300,6 +68701,12 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; } // Go on to the next test. @@ -66313,14 +68720,14 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -66328,92 +68735,118 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep2ThReadsTheClusterRevisionFromDut_1() + CHIP_ERROR TestStep1ThReadsHourFormatAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads the ClusterRevision from DUT Error: %@", err); + [cluster readAttributeHourFormatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1: TH reads HourFormat attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintType("hourFormat", "enum8", "enum8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ThReadsTheFeatureMapFromDut_2() + CHIP_ERROR TestStep2IfLtimesa000012hrThWrites0ToHourFormatAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads the FeatureMap from DUT Error: %@", err); + id hourFormatArgument; + hourFormatArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster + writeAttributeHourFormatWithValue:hourFormatArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 2: If (LTIME.S.A0000.12HR) TH writes 0 to HourFormat attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsHourFormatAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeHourFormatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads HourFormat attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + VerifyOrReturn(CheckValue("HourFormat", actualValue, 0U)); } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3GivenLunitsf00tempEnsureFeaturemapHasTheCorrectBitSet_3() + CHIP_ERROR TestStep4IfLtimesa000024hrThWrites1ToHourFormatAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: Given LUNIT.S.F00(TEMP) ensure featuremap has the correct bit set Error: %@", err); + id hourFormatArgument; + hourFormatArgument = [NSNumber numberWithUnsignedChar:1U]; + [cluster + writeAttributeHourFormatWithValue:hourFormatArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4: If (LTIME.S.A0000.24HR) TH writes 1 to HourFormat attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsAttributeListFromDut_4() + CHIP_ERROR TestStep5ThReadsHourFormatAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); + [cluster readAttributeHourFormatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: TH reads HourFormat attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("HourFormat", actualValue, 1U)); + } NextTest(); }]; @@ -66421,24 +68854,22 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsAttributeListFromDut_5() + CHIP_ERROR TestStep6ThReadsActiveCalendarTypeAttributeFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); + [cluster readAttributeActiveCalendarTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: TH reads ActiveCalendarType attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintMinValue("activeCalendarType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("activeCalendarType", [value unsignedCharValue], 11U)); NextTest(); }]; @@ -66446,81 +68877,108 @@ class Test_TC_LUNIT_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bThReadsFeatureDependentLUNITSF00AttributeInAttributeList_6() + CHIP_ERROR TestStep7ThReadsSupportedCalendarTypesAttributeFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: TH reads Feature dependent(LUNIT.S.F00) attribute in AttributeList Error: %@", err); + [cluster readAttributeSupportedCalendarTypesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: TH reads SupportedCalendarTypes attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - + VerifyOrReturn(CheckConstraintMaxLength("supportedCalendarTypes", value, 12)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6ThReadsAcceptedCommandListFromDut_8() + CHIP_ERROR + TestStep8ThWritesValueInPixitltimesctToActiveCalendarTypeAttributeFollowedByReadingTheActiveCalendarTypeAttributeValue_8() { - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: TH reads AcceptedCommandList from DUT Error: %@", err); + CHIP_ERROR TestStep9RepeatStep8ForAllTheValuesInPixitltimesct_9() + { - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + CHIP_ERROR TestStep10ThWrites50ToActiveCalendarTypeAttribute_10() + { - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - NextTest(); - }]; + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id activeCalendarTypeArgument; + activeCalendarTypeArgument = [NSNumber numberWithUnsignedChar:50U]; + [cluster writeAttributeActiveCalendarTypeWithValue:activeCalendarTypeArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 10: TH writes 50 to ActiveCalendarType attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] + ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ThReadsGeneratedCommandListFromDut_9() + CHIP_ERROR TestStep11ThWrites5ToHourFormatAttribute_11() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: TH reads GeneratedCommandList from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + id hourFormatArgument; + hourFormatArgument = [NSNumber numberWithUnsignedChar:5U]; + [cluster + writeAttributeHourFormatWithValue:hourFormatArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 11: TH writes 5 to HourFormat attribute Error: %@", err); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_LUNIT_3_1 : public TestCommandBridge { +class Test_TC_LWM_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LUNIT_3_1() - : TestCommandBridge("Test_TC_LUNIT_3_1") + Test_TC_LWM_1_1() + : TestCommandBridge("Test_TC_LWM_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66530,7 +68988,7 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LUNIT_3_1() {} + ~Test_TC_LWM_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66538,11 +68996,11 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LUNIT_3_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LWM_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LUNIT_3_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LWM_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -66555,72 +69013,139 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: TH reads TemperatureUnit attribute from DUT\n"); - if (ShouldSkip("LUNIT.S.A0000")) { - NextTest(); - return; - } - err = TestStep1ThReadsTemperatureUnitAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the ClusterRevision attribute.\n"); + err = TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: TH writes 0 (Fahrenheit) to TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit")) { + ChipLogProgress(chipTool, + " ***** Test Step 2 : Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if " + "LWM.S.F00(DEPONOFF)\n"); + if (ShouldSkip("LWM.S.F00")) { NextTest(); return; } - err = TestStep2ThWrites0FahrenheitToTemperatureUnitAttribute_2(); + err = TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfLwmsf00deponoff_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads from the DUT the FeatureMap attribute.\n"); + if (ShouldSkip(" !LWM.S.F00 ")) { NextTest(); return; } - err = TestStep3ThReadsTemperatureUnitAttribute_3(); + err = TestStep3ThReadsFromTheDutTheFeatureMapAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH writes 1 (Celsius) to TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep4ThWrites1CelsiusToTemperatureUnitAttribute_4(); + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: TH reads TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep5ThReadsTemperatureUnitAttribute_5(); + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: TH writes 2 (Kelvin) to TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4b: Read the optional attribute(StartUpMode) in AttributeList\n"); + if (ShouldSkip("LWM.S.A0002")) { NextTest(); return; } - err = TestStep6ThWrites2KelvinToTemperatureUnitAttribute_6(); + err = TestStep4bReadTheOptionalAttributeStartUpModeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH reads TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin")) { + ChipLogProgress( + chipTool, " ***** Test Step 7 : Step 4c: Read the Feature dependent attribute(DEPONOFF) in AttributeList\n"); + if (ShouldSkip("LWM.S.F00")) { NextTest(); return; } - err = TestStep7ThReadsTemperatureUnitAttribute_7(); + err = TestStep4cReadTheFeatureDependentAttributeDEPONOFFInAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 8: TH writes 5 to TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000")) { + ChipLogProgress(chipTool, + " ***** Test Step 8 : Step 4d: TH reads AttributeList attribute from DUT 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) " + "2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " + "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain " + "any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestStep8ThWrites5ToTemperatureUnitAttribute_8(); + err = TestStep4dThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5a: TH reads from the DUT the EventList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Step 5b: TH reads EventList attribute from DUT 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range " + "(0x0001 - 0xFFF1), these values SHALL be ignore 3.The list SHALL NOT contain any values in the Test Vendor or " + "invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep5bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnore3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 6a: TH reads from the DUT the AcceptedCommandList attribute.\n"); + err = TestStep6aThReadsFromTheDutTheAcceptedCommandListAttribute_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Step 6b: TH reads AcceptedCommandList attribute from DUT.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor " + "or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep6bThReadsAcceptedCommandListAttributeFromDUTTheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 7a: TH reads from the DUT the GeneratedCommandList attribute.\n"); + err = TestStep7aThReadsFromTheDutTheGeneratedCommandListAttribute_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor " + "or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), " + "where[1688447564.178537][4220:4222] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFF8 DataVersion: " + "1795162772 [1688447564.178684][4220:4222] CHIP:TOO: GeneratedCommandList: 0 entries " + "[1688447564.178984][4220:4222] CHIP:EM: <<< [E:5540i S:25125 M:256711779 (Ack:197472718)] (S) Msg TX to " + "1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) XXXX is the allowed MEI range (0x0001 - " + "0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhere168844756417853742204222ChiptooEndpoint1Cluster0x00000057Attribute0x0000Fff8DataVersion1795162772168844756417868442204222ChiptooGeneratedCommandList0Entries168844756417898442204222ChipemE5540iS25125M256711779Ack197472718SMsgTxTo1000000000000000110dbType000010SecureChannelStandaloneAckXxxxIsTheAllowedMeiRange0x00010xFFF1_14(); break; } @@ -66658,7 +69183,25 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } @@ -66673,14 +69216,14 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 15; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -66688,108 +69231,133 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep1ThReadsTemperatureUnitAttributeFromDut_1() + CHIP_ERROR TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1: TH reads TemperatureUnit attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads from the DUT the ClusterRevision attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("temperatureUnit", "enum8", "enum8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2ThWrites0FahrenheitToTemperatureUnitAttribute_2() + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfLwmsf00deponoff_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id temperatureUnitArgument; - temperatureUnitArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster - writeAttributeTemperatureUnitWithValue:temperatureUnitArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 2: TH writes 0 (Fahrenheit) to TemperatureUnit attribute Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if LWM.S.F00(DEPONOFF) " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ThReadsTemperatureUnitAttribute_3() + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads TemperatureUnit attribute Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("TemperatureUnit", actualValue, 0U)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ThWrites1CelsiusToTemperatureUnitAttribute_4() + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id temperatureUnitArgument; - temperatureUnitArgument = [NSNumber numberWithUnsignedChar:1U]; - [cluster - writeAttributeTemperatureUnitWithValue:temperatureUnitArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 4: TH writes 1 (Celsius) to TemperatureUnit attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5ThReadsTemperatureUnitAttribute_5() + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5: TH reads TemperatureUnit attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TemperatureUnit", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -66797,43 +69365,45 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6ThWrites2KelvinToTemperatureUnitAttribute_6() + CHIP_ERROR TestStep4bReadTheOptionalAttributeStartUpModeInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id temperatureUnitArgument; - temperatureUnitArgument = [NSNumber numberWithUnsignedChar:2U]; - [cluster writeAttributeTemperatureUnitWithValue:temperatureUnitArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 6: TH writes 2 (Kelvin) to TemperatureUnit attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: Read the optional attribute(StartUpMode) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ThReadsTemperatureUnitAttribute_7() + CHIP_ERROR TestStep4cReadTheFeatureDependentAttributeDEPONOFFInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: TH reads TemperatureUnit attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: Read the Feature dependent attribute(DEPONOFF) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TemperatureUnit", actualValue, 2U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -66841,47 +69411,115 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep8ThWrites5ToTemperatureUnitAttribute_8() + CHIP_ERROR + TestStep4dThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_8() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestStep5bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnore3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_10() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep6aThReadsFromTheDutTheAcceptedCommandListAttribute_11() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterUnitLocalization alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id temperatureUnitArgument; - temperatureUnitArgument = [NSNumber numberWithUnsignedChar:5U]; - [cluster writeAttributeTemperatureUnitWithValue:temperatureUnitArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Step 8: TH writes 5 to TemperatureUnit attribute Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6a: TH reads from the DUT the AcceptedCommandList attribute. Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] - ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep6bThReadsAcceptedCommandListAttributeFromDUTTheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_12() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep7aThReadsFromTheDutTheGeneratedCommandListAttribute_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7a: TH reads from the DUT the GeneratedCommandList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } + + CHIP_ERROR + TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhere168844756417853742204222ChiptooEndpoint1Cluster0x00000057Attribute0x0000Fff8DataVersion1795162772168844756417868442204222ChiptooGeneratedCommandList0Entries168844756417898442204222ChipemE5540iS25125M256711779Ack197472718SMsgTxTo1000000000000000110dbType000010SecureChannelStandaloneAckXxxxIsTheAllowedMeiRange0x00010xFFF1_14() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_LTIME_1_2 : public TestCommandBridge { +class Test_TC_LWM_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LTIME_1_2() - : TestCommandBridge("Test_TC_LTIME_1_2") + Test_TC_LWM_2_1() + : TestCommandBridge("Test_TC_LWM_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("NewMode_CHANGE_OK", 0, UINT8_MAX, &mNewModeChangeOk); + AddArgument("NewMode_CHANGE_FAIL", 0, UINT8_MAX, &mNewModeChangeFail); + AddArgument("invalid_mode_th", 0, UINT8_MAX, &mInvalidModeTh); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LTIME_1_2() {} + ~Test_TC_LWM_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66889,11 +69527,11 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LTIME_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LWM_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LTIME_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LWM_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -66906,66 +69544,127 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress( + chipTool, " ***** Test Step 0 : Step 1:Commission DUT to TH (can be skipped if done in a preceding test).\n"); + err = TestStep1CommissionDutToThCanBeSkippedIfDoneInAPrecedingTest_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the ClusterRevision from DUT\n"); - err = TestStep2ThReadsTheClusterRevisionFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the SupportedModes attribute.\n"); + if (ShouldSkip("LWM.S.A0000")) { + NextTest(); + return; + } + err = TestStep2ThReadsFromTheDutTheSupportedModesAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the FeatureMap from DUT\n"); - err = TestStep3ThReadsTheFeatureMapFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the CurrentMode attribute.\n"); + if (ShouldSkip("LWM.S.A0001")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheCurrentModeAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4a: TH reads AttributeList from DUT\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : Step 4: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th\n"); + if (ShouldSkip("LWM.S.C00.Rsp")) { NextTest(); return; } - err = TestStep4aThReadsAttributeListFromDut_3(); + err = TestStep4ThSendsAChangeToModeCommandToTheDutWithNewModeSetToNewModeTh_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads AttributeList from DUT\n"); - if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 4 : Step 5: Manually put the device in a state from which it will FAIL to transition to " + "PIXIT.LWM.MODE_CHANGE_FAIL\n"); + if (ShouldSkip("LWM.S.M.CAN_TEST_MODE_FAILURE && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestStep4aThReadsAttributeListFromDut_4(); + err = TestStep5ManuallyPutTheDeviceInAStateFromWhichItWillFailToTransitionToPixitlwmmodeChangeFail_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Step 4b: TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT\n"); - if (ShouldSkip("LTIME.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 6: TH reads from the DUT the CurrentMode attribute.\n"); + if (ShouldSkip("LWM.S.A0001")) { NextTest(); return; } - err = TestStep4bThReadsOptionalAttributeActiveCalendarTypeInAttributeListFromDut_5(); + err = TestStep6ThReadsFromTheDutTheCurrentModeAttribute_5(); break; case 6: ChipLogProgress(chipTool, - " ***** Test Step 6 : Step 4c: TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT\n"); - if (ShouldSkip("LTIME.S.A0002")) { + " ***** Test Step 6 : Step 7: TH sends a ChangeToMode command to the DUT with NewMode set to " + "PIXIT.LWM.MODE_CHANGE_FAIL\n"); + if (ShouldSkip("LWM.S.M.CAN_TEST_MODE_FAILURE && LWM.S.C00.Rsp && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestStep4cThReadsOptionalAttributeSupportedCalendarTypesInAttributeListFromDut_6(); + err = TestStep7ThSendsAChangeToModeCommandToTheDutWithNewModeSetToPixitlwmmodeChangeFail_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 5: TH reads EventList from DUT\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 8: TH reads from the DUT the CurrentMode attribute.\n"); + if (ShouldSkip("LWM.S.A0001")) { NextTest(); return; } - NextTest(); - return; + err = TestStep8ThReadsFromTheDutTheCurrentModeAttribute_7(); + break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 6: TH reads AcceptedCommandList from DUT\n"); - err = TestStep6ThReadsAcceptedCommandListFromDut_8(); + ChipLogProgress(chipTool, + " ***** Test Step 8 : Step 9: Manually put the device in a state from which it will SUCCESSFULLY transition to " + "PIXIT.LWM.MODE_CHANGE_OK\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestStep9ManuallyPutTheDeviceInAStateFromWhichItWillSuccessfullyTransitionToPixitlwmmodeChangeOk_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 7: TH reads GeneratedCommandList from DUT\n"); - err = TestStep7ThReadsGeneratedCommandListFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 10: TH reads from the DUT the CurrentMode attribute.\n"); + if (ShouldSkip("LWM.S.A0001")) { + NextTest(); + return; + } + err = TestStep10ThReadsFromTheDutTheCurrentModeAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Step 11: TH sends a ChangeToMode command to the DUT with NewMode set to " + "PIXIT.LWM.MODE_CHANGE_OK\n"); + if (ShouldSkip("LWM.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep11ThSendsAChangeToModeCommandToTheDutWithNewModeSetToPixitlwmmodeChangeOk_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 12: TH reads from the DUT the CurrentMode attribute. Verify that the DUT response " + "contains an integer value equal to PIXIT.LWM.MODE_CHANGE_OK\n"); + if (ShouldSkip("LWM.S.A0001")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheCurrentModeAttributeVerifyThatTheDutResponseContainsAnIntegerValueEqualToPixitlwmmodeChangeOk_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Step 13: TH sends a ChangeToMode command to the DUT with NewMode set to invalid_mode_th\n"); + if (ShouldSkip("LWM.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep13ThSendsAChangeToModeCommandToTheDutWithNewModeSetToInvalidModeTh_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Step 14: TH reads from the DUT the CurrentMode attribute. Verify that the DUT response " + "contains an integer value equal to PIXIT.LWM.MODE_CHANGE_OK\n"); + if (ShouldSkip("LWM.S.A0001")) { + NextTest(); + return; + } + err = TestStep14ThReadsFromTheDutTheCurrentModeAttributeVerifyThatTheDutResponseContainsAnIntegerValueEqualToPixitlwmmodeChangeOk_13(); break; } @@ -67008,6 +69707,18 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -67021,14 +69732,17 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 14; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mNewModeChangeOk; + chip::Optional mNewModeChangeFail; + chip::Optional mInvalidModeTh; chip::Optional mTimeout; - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestStep1CommissionDutToThCanBeSkippedIfDoneInAPrecedingTest_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -67036,49 +69750,49 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep2ThReadsTheClusterRevisionFromDut_1() + CHIP_ERROR TestStep2ThReadsFromTheDutTheSupportedModesAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads the ClusterRevision from DUT Error: %@", err); + [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads from the DUT the SupportedModes attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintType("supportedModes", "list", "list")); + VerifyOrReturn(CheckConstraintMinLength("supportedModes", value, 2)); NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull old_current_mode_dut; - CHIP_ERROR TestStep3ThReadsTheFeatureMapFromDut_2() + CHIP_ERROR TestStep3ThReadsFromTheDutTheCurrentModeAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads the FeatureMap from DUT Error: %@", err); + [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the CurrentMode attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 1UL)); + VerifyOrReturn(CheckConstraintType("currentMode", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentMode", [value unsignedCharValue], 254U)); + { + old_current_mode_dut = value; + } NextTest(); }]; @@ -67086,56 +69800,68 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsAttributeListFromDut_3() + CHIP_ERROR TestStep4ThSendsAChangeToModeCommandToTheDutWithNewModeSetToNewModeTh_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); + __auto_type * params = [[MTRLaundryWasherModeClusterChangeToModeParams alloc] init]; + params.newMode = [old_current_mode_dut copy]; + [cluster + changeToModeWithParams:params + completion:^( + MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Step 4: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsAttributeListFromDut_4() + CHIP_ERROR TestStep5ManuallyPutTheDeviceInAStateFromWhichItWillFailToTransitionToPixitlwmmodeChangeFail_4() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + NSNumber * _Nonnull Step6_current_mode_dut; + + CHIP_ERROR TestStep6ThReadsFromTheDutTheCurrentModeAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads AttributeList from DUT Error: %@", err); + [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: TH reads from the DUT the CurrentMode attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintType("currentMode", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentMode", [value unsignedCharValue], 254U)); + { + Step6_current_mode_dut = value; + } NextTest(); }]; @@ -67143,22 +69869,38 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bThReadsOptionalAttributeActiveCalendarTypeInAttributeListFromDut_5() + CHIP_ERROR TestStep7ThSendsAChangeToModeCommandToTheDutWithNewModeSetToPixitlwmmodeChangeFail_6() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep8ThReadsFromTheDutTheCurrentModeAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT Error: %@", err); + [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 8: TH reads from the DUT the CurrentMode attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, Step6_current_mode_dut)); + } + + VerifyOrReturn(CheckConstraintType("currentMode", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentMode", [value unsignedCharValue], 254U)); NextTest(); }]; @@ -67166,22 +69908,37 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4cThReadsOptionalAttributeSupportedCalendarTypesInAttributeListFromDut_6() + CHIP_ERROR TestStep9ManuallyPutTheDeviceInAStateFromWhichItWillSuccessfullyTransitionToPixitlwmmodeChangeOk_8() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + NSNumber * _Nonnull Step10_current_mode_dut; + + CHIP_ERROR TestStep10ThReadsFromTheDutTheCurrentModeAttribute_9() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4c: TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT Error: %@", err); + [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 10: TH reads from the DUT the CurrentMode attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintType("currentMode", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentMode", [value unsignedCharValue], 254U)); + { + Step10_current_mode_dut = value; + } NextTest(); }]; @@ -67189,52 +69946,120 @@ class Test_TC_LTIME_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6ThReadsAcceptedCommandListFromDut_8() + CHIP_ERROR TestStep11ThSendsAChangeToModeCommandToTheDutWithNewModeSetToPixitlwmmodeChangeOk_10() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: TH reads AcceptedCommandList from DUT Error: %@", err); + __auto_type * params = [[MTRLaundryWasherModeClusterChangeToModeParams alloc] init]; + params.newMode = mNewModeChangeOk.HasValue() ? [NSNumber numberWithUnsignedChar:mNewModeChangeOk.Value()] + : [NSNumber numberWithUnsignedChar:2U]; + [cluster changeToModeWithParams:params + completion:^(MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Step 11: TH sends a ChangeToMode command to the DUT with NewMode set to " + @"PIXIT.LWM.MODE_CHANGE_OK Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep12ThReadsFromTheDutTheCurrentModeAttributeVerifyThatTheDutResponseContainsAnIntegerValueEqualToPixitlwmmodeChangeOk_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 12: TH reads from the DUT the CurrentMode attribute. Verify that the DUT response contains an integer " + @"value equal to PIXIT.LWM.MODE_CHANGE_OK Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("CurrentMode", actualValue, mNewModeChangeOk.HasValue() ? mNewModeChangeOk.Value() : 2U)); } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ThReadsGeneratedCommandListFromDut_9() + CHIP_ERROR TestStep13ThSendsAChangeToModeCommandToTheDutWithNewModeSetToInvalidModeTh_12() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device - endpointID:@(0) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: TH reads GeneratedCommandList from DUT Error: %@", err); + __auto_type * params = [[MTRLaundryWasherModeClusterChangeToModeParams alloc] init]; + params.newMode = mInvalidModeTh.HasValue() ? [NSNumber numberWithUnsignedChar:mInvalidModeTh.Value()] + : [NSNumber numberWithUnsignedChar:5U]; + [cluster changeToModeWithParams:params + completion:^(MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Step 13: TH sends a ChangeToMode command to the DUT with NewMode set to invalid_mode_th " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep14ThReadsFromTheDutTheCurrentModeAttributeVerifyThatTheDutResponseContainsAnIntegerValueEqualToPixitlwmmodeChangeOk_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 14: TH reads from the DUT the CurrentMode attribute. Verify that the DUT response contains an integer " + @"value equal to PIXIT.LWM.MODE_CHANGE_OK Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("CurrentMode", actualValue, mNewModeChangeOk.HasValue() ? mNewModeChangeOk.Value() : 2U)); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -91472,6 +94297,429 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { } }; +class Test_TC_REFALM_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_REFALM_1_1() + : TestCommandBridge("Test_TC_REFALM_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_REFALM_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_REFALM_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_REFALM_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the ClusterRevision attribute\n"); + err = TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the FeatureMap attribute\n"); + err = TestStep3ThReadsFromTheDutTheFeatureMapAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4a: TH reads from the DUT the AttributeList attribute\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads from the DUT the AttributeList attribute\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Step 4b: TH reads AttributeList attribute from DUT 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) " + "2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " + "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain " + "any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep4bThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 5a: TH reads from the DUT the EventList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 5b: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range " + "(0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or " + "invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep5bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 6a: TH reads from the DUT the AcceptedCommandList attribute.\n"); + err = TestStep6aThReadsFromTheDutTheAcceptedCommandListAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Step 6: TH reads AcceptedCommandList attribute from DUT. 1. The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep6ThReadsAcceptedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 7a: TH reads from the DUT the AcceptedCommandList attribute.\n"); + err = TestStep7aThReadsFromTheDutTheAcceptedCommandListAttribute_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 12; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads from the DUT the ClusterRevision attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep4bThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_5() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestStep5bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_7() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep6aThReadsFromTheDutTheAcceptedCommandListAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6a: TH reads from the DUT the AcceptedCommandList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep6ThReadsAcceptedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_9() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep7aThReadsFromTheDutTheAcceptedCommandListAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7a: TH reads from the DUT the AcceptedCommandList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + class Test_TC_RH_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -94083,7 +97331,1129 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 14; + const uint16_t mTestCount = 14; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads the ClusterRevision attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads the FeatureMap attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4bThReadsFromTheDutTheOptionalAttributeCountdownTimeInTheAttributeListFromTheDut_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Step 4b: TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6aReadTheOptionalCommandPauseInAcceptedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6a: Read the optional command(Pause) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6bReadTheOptionalCommandStopInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6b: Read the optional command(Stop) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6cReadTheOptionalCommandStartInAcceptedCommandList_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6c: Read the optional command(Start) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6dReadTheOptionalCommandResumeInAcceptedCommandList_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6d: Read the optional command(Resume) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCCM_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TCCM_1_1() + : TestCommandBridge("Test_TC_TCCM_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TCCM_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCCM_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCCM_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: Read the global attribute: ClusterRevision\n"); + err = TestStep2ReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the FeatureMap attribute.\n"); + if (ShouldSkip("!TCCM.S.F00")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheFeatureMapAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if " + "TCCM.S.F00(DEPONOFF)\n"); + if (ShouldSkip("TCCM.S.F00")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfTccmsf00deponoff_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Step 4b: TH reads from the DUT the AttributeList attribute. 0x0002: SHALL be included if and " + "only if TCCM.S.A0002(StartUpMode)\n"); + if (ShouldSkip("TCCM.S.A0002")) { + NextTest(); + return; + } + err = TestStep4bThReadsFromTheDutTheAttributeListAttribute0x0002ShallBeIncludedIfAndOnlyIfTCCMSA0002StartUpMode_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003 SHALL be included if and " + "only if TCCM.S.F00(DEPONOFF)\n"); + if (ShouldSkip("TCCM.S.F00")) { + NextTest(); + return; + } + err = TestStep4cThReadsFromTheDutTheAttributeListAttribute0x0003ShallBeIncludedIfAndOnlyIfTccmsf00deponoff_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Step 4d: TH reads AttributeList attribute from DUT. 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) " + "2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " + "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT " + "contain any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 " + "- 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1))\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep4dThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5a: TH reads from the DUT the EventList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Step 5b: TH reads EventList attribute from DUT 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range " + "(0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor or " + "invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep5bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 6a: TH reads from the DUT the AcceptedCommandList attribute.\n"); + err = TestStep6aThReadsFromTheDutTheAcceptedCommandListAttribute_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Step 6b: TH reads AcceptedCommandList attribute from DUT. 1. The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep6bThReadsAcceptedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 7a: TH reads from the DUT the GeneratedCommandList attribute.\n"); + err = TestStep7aThReadsFromTheDutTheGeneratedCommandListAttribute_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : Step 7b: TH reads GeneratedCommandList attribute from DUT. 1.The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored. 2.The list SHALL NOT contain any values in the Test " + "Vendor or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - " + "0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_14(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 15; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfTccmsf00deponoff_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if TCCM.S.F00(DEPONOFF) " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4bThReadsFromTheDutTheAttributeListAttribute0x0002ShallBeIncludedIfAndOnlyIfTCCMSA0002StartUpMode_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads from the DUT the AttributeList attribute. 0x0002: SHALL be included if and only if " + @"TCCM.S.A0002(StartUpMode) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4cThReadsFromTheDutTheAttributeListAttribute0x0003ShallBeIncludedIfAndOnlyIfTccmsf00deponoff_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003 SHALL be included if and only if " + @"TCCM.S.F00(DEPONOFF) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep4dThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_8() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestStep5bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_10() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep6aThReadsFromTheDutTheAcceptedCommandListAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6a: TH reads from the DUT the AcceptedCommandList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep6bThReadsAcceptedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_12() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep7aThReadsFromTheDutTheGeneratedCommandListAttribute_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7a: TH reads from the DUT the GeneratedCommandList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep7bThReadsGeneratedCommandListAttributeFromDut1TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored2TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_14() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + +class Test_TC_TCTL_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TCTL_1_1() + : TestCommandBridge("Test_TC_TCTL_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TCTL_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCTL_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCTL_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the ClusterRevision attribute\n"); + err = TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3a: TH reads from the DUT the FeatureMap attribute\n"); + if (ShouldSkip("!TCTL.S.F00 && !TCTL.S.F01 && !TCTL.S.F02")) { + NextTest(); + return; + } + err = TestStep3aThReadsFromTheDutTheFeatureMapAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Step 3b: TH reads from the DUT the FeatureMap attribute. bit 0: SHALL be 1 if and only if " + "TCTL.S.F00(TN) & !TCTL.S.F01(TL)\n"); + if (ShouldSkip("TCTL.S.F00 && !TCTL.S.F01")) { + NextTest(); + return; + } + err = TestStep3bThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfTctlsf00tntctlsf01tl_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Step 3c: TH reads from the DUT the FeatureMap attribute. bit 1: SHALL be 1 if and only if " + "TCTL.S.F01(TL) & !TCTL.S.F00(TN)\n"); + if (ShouldSkip("TCTL.S.F01 && !TCTL.S.F00")) { + NextTest(); + return; + } + err = TestStep3cThReadsFromTheDutTheFeatureMapAttributeBit1ShallBe1IfAndOnlyIfTctlsf01tltctlsf00tn_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Step 3d: TH reads from the DUT the FeatureMap attribute. bit 2: SHALL be 1 if and only if " + "TCTL.S.F02(A_STEP) & TCTL.S.F00(TN)\n"); + if (ShouldSkip("TCTL.S.F02 && !TCTL.S.F00")) { + NextTest(); + return; + } + err = TestStep3dThReadsFromTheDutTheFeatureMapAttributeBit2ShallBe1IfAndOnlyIfTctlsf02aStepTctlsf00tn_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Step 4b: TH reads from the DUT the AttributeList attribute. 0x0000, 0x0001, 0x0002: SHALL be " + "included if and only if TCTL.S.F00(TN)\n"); + if (ShouldSkip("TCTL.S.F00")) { + NextTest(); + return; + } + err = TestStep4bThReadsFromTheDutTheAttributeListAttribute0x00000x00010x0002ShallBeIncludedIfAndOnlyIfTctlsf00tn_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003: SHALL be included if and " + "only if TCTL.S.F02(A_STEP)\n"); + if (ShouldSkip("TCTL.S.F02")) { + NextTest(); + return; + } + err = TestStep4cThReadsFromTheDutTheAttributeListAttribute0x0003ShallBeIncludedIfAndOnlyIfTctlsf02aStep_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Step 4d: TH reads from the DUT the AttributeList attribute. 0x0004 & 0x0005: SHALL be " + "included if and only if TCTL.S.F01(TL)\n"); + if (ShouldSkip("TCTL.S.F01")) { + NextTest(); + return; + } + err = TestStep4dThReadsFromTheDutTheAttributeListAttribute0x00040x0005ShallBeIncludedIfAndOnlyIfTctlsf01tl_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 4e: TH reads AttributeList attribute from DUT 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_4FFF) and (0x0000_F000 - 0x0000_FFFE) " + "2.The list MAY contain values in the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_4FFF), " + "where XXXX is the allowed MEI range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain " + "any values in the Test Vendor or invalid range: (0x0000_5000 - 0x0000_EFFF and 0x0000_FFFF), (0xXXXX_5000 - " + "0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep4eThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 5a: TH reads from the DUT the AcceptedCommandList attribute.\n"); + err = TestStep5aThReadsFromTheDutTheAcceptedCommandListAttribute_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Step 5b: TH reads AcceptedCommandList attribute from DUT 1.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor " + "or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep5bThReadsAcceptedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Step 6a: TH reads from the DUT the GeneratedCommandList attribute.\n"); + err = TestStep6aThReadsFromTheDutTheGeneratedCommandListAttribute_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : Step 6b: TH reads GeneratedCommandList attribute from DUT.The list SHALL NOT contain any " + "additional values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF) 2. The list MAY contain values in " + "the Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI " + "range (0x0001 - 0xFFF1), these values SHALL be ignored 3.The list SHALL NOT contain any values in the Test Vendor " + "or invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep6bThReadsGeneratedCommandListAttributeFromDUTTheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Step 7a: Read the global attribute: EventList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Step 7b: TH reads EventList attribute from DUT. 1.The list SHALL NOT contain any additional " + "values in the standard or scoped range: (0x0000_0000 - 0x0000_00FF). 2.The list MAY contain values in the " + "Manufacturer Extensible Identifier (MEI) range: (0xXXXX_0000 - 0xXXXX_00FF), where XXXX is the allowed MEI range " + "(0x0001 - 0xFFF1), these values SHALL be ignored. 3.The list SHALL NOT contain any values in the Test Vendor or " + "invalid range: (0x0000_0100 - 0x0000_FFFF), (0xXXXX_0100 - 0xXXXX_FFFF) and (0xFFF1_0000 - 0xFFFF_FFFF), where " + "XXXX is the allowed MEI range (0x0001 - 0xFFF1)\n"); + if (ShouldSkip("PICS_USER_PROMPT && PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep7bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_17(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -94098,17 +98468,17 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1() + CHIP_ERROR TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads the ClusterRevision attribute from the DUT Error: %@", err); + NSLog(@"Step 2: TH reads from the DUT the ClusterRevision attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -94124,17 +98494,17 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2() + CHIP_ERROR TestStep3aThReadsFromTheDutTheFeatureMapAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads the FeatureMap attribute from the DUT Error: %@", err); + NSLog(@"Step 3a: TH reads from the DUT the FeatureMap attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -94150,61 +98520,93 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_3() + CHIP_ERROR TestStep3bThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfTctlsf00tntctlsf01tl_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3b: TH reads from the DUT the FeatureMap attribute. bit 0: SHALL be 1 if and only if TCTL.S.F00(TN) & " + @"!TCTL.S.F01(TL) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3cThReadsFromTheDutTheFeatureMapAttributeBit1ShallBe1IfAndOnlyIfTctlsf01tltctlsf00tn_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3c: TH reads from the DUT the FeatureMap attribute. bit 1: SHALL be 1 if and only if TCTL.S.F01(TL) & " + @"!TCTL.S.F00(TN) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_4() + CHIP_ERROR TestStep3dThReadsFromTheDutTheFeatureMapAttributeBit2ShallBe1IfAndOnlyIfTctlsf02aStepTctlsf00tn_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3d: TH reads from the DUT the FeatureMap attribute. bit 2: SHALL be 1 if and only if TCTL.S.F02(A_STEP) & " + @"TCTL.S.F00(TN) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); @@ -94215,24 +98617,26 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bThReadsFromTheDutTheOptionalAttributeCountdownTimeInTheAttributeListFromTheDut_5() + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Step 4b: TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT Error: %@", - err); + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -94240,23 +98644,26 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6aReadTheOptionalCommandPauseInAcceptedCommandList_8() + CHIP_ERROR TestStep4bThReadsFromTheDutTheAttributeListAttribute0x00000x00010x0002ShallBeIncludedIfAndOnlyIfTctlsf00tn_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6a: Read the optional command(Pause) in AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads from the DUT the AttributeList attribute. 0x0000, 0x0001, 0x0002: SHALL be included if and " + @"only if TCTL.S.F00(TN) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -94264,23 +98671,24 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6bReadTheOptionalCommandStopInAcceptedCommandList_9() + CHIP_ERROR TestStep4cThReadsFromTheDutTheAttributeListAttribute0x0003ShallBeIncludedIfAndOnlyIfTctlsf02aStep_9() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6b: Read the optional command(Stop) in AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003: SHALL be included if and only if " + @"TCTL.S.F02(A_STEP) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -94288,22 +98696,25 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6cReadTheOptionalCommandStartInAcceptedCommandList_10() + CHIP_ERROR TestStep4dThReadsFromTheDutTheAttributeListAttribute0x00040x0005ShallBeIncludedIfAndOnlyIfTctlsf01tl_10() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6c: Read the optional command(Start) in AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4d: TH reads from the DUT the AttributeList attribute. 0x0004 & 0x0005: SHALL be included if and only if " + @"TCTL.S.F01(TL) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); NextTest(); }]; @@ -94311,23 +98722,33 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6dReadTheOptionalCommandResumeInAcceptedCommandList_11() + CHIP_ERROR + TestStep4eThReadsAttributeListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x00004fffAnd0x0000F0000x0000Fffe2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX4fffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000050000x0000EfffAnd0x0000Ffff0xXXXX50000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_11() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep5aThReadsFromTheDutTheAcceptedCommandListAttribute_12() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6d: Read the optional command(Resume) in AcceptedCommandList Error: %@", err); + NSLog(@"Step 5a: TH reads from the DUT the AcceptedCommandList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); NextTest(); }]; @@ -94335,25 +98756,31 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_12() + CHIP_ERROR + TestStep5bThReadsAcceptedCommandListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_13() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep6aThReadsFromTheDutTheGeneratedCommandListAttribute_14() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: Read the global attribute: GeneratedCommandList Error: %@", err); + NSLog(@"Step 6a: TH reads from the DUT the GeneratedCommandList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -94361,27 +98788,26 @@ class Test_TC_RVCOPSTATE_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_13() + CHIP_ERROR + TestStep6bThReadsGeneratedCommandListAttributeFromDUTTheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_15() { - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device - endpointID:@(1) - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 4UL)); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - NextTest(); - }]; + CHIP_ERROR + TestStep7bThReadsEventListAttributeFromDut1TheListShallNotContainAnyAdditionalValuesInTheStandardOrScopedRange0x000000000x000000ff2TheListMayContainValuesInTheManufacturerExtensibleIdentifierMeiRange0xXXXX00000xXXXX00ffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1TheseValuesShallBeIgnored3TheListShallNotContainAnyValuesInTheTestVendorOrInvalidRange0x000001000x0000Ffff0xXXXX01000xXXXXFfffAnd0xFFF100000xFFFFFfffWhereXxxxIsTheAllowedMeiRange0x00010xFFF1_17() + { - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } }; @@ -95029,10 +99455,6 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: Read the global attribute: ClusterRevision\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } err = TestStep2ReadTheGlobalAttributeClusterRevision_1(); break; case 2: @@ -95756,11 +100178,25 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { CHIP_ERROR TestStep2ReadTheGlobalAttributeClusterRevision_1() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 6U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep3aReadTheGlobalAttributeFeatureMap_2() @@ -106639,55 +111075,57 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Step 3a: TH reads OperationalStatus attribute's bit 0..1\n"); - if (ShouldSkip("WNCV.S.A000a && PICS_SDK_CI_ONLY")) { + if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } err = TestStep3aThReadsOperationalStatusAttributesBit01_14(); break; case 15: - ChipLogProgress( - chipTool, " ***** Test Step 15 : Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))\n"); - if (ShouldSkip("WNCV.S.A000a && WNCV.S.F00 && PICS_SDK_CI_ONLY")) { + ChipLogProgress(chipTool, + " ***** Test Step 15 : Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in " + "upcoming OperationalStatus read steps.\n"); + if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_15(); + err = TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15(); break; case 16: ChipLogProgress( - chipTool, " ***** Test Step 16 : Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))\n"); - if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F00 && PICS_SDK_CI_ONLY")) { + chipTool, " ***** Test Step 16 : Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + if (ShouldSkip("WNCV.S.A000a && WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_16(); + err = TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16(); break; case 17: ChipLogProgress( - chipTool, " ***** Test Step 17 : Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))\n"); - if (ShouldSkip("WNCV.S.A000a && WNCV.S.F01 && PICS_SDK_CI_ONLY")) { + chipTool, " ***** Test Step 17 : Step 3a: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_17(); + err = TestStep3aThCheckOperationalStatusValueBit23Wncvsf00lf_17(); break; case 18: ChipLogProgress( - chipTool, " ***** Test Step 18 : Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))\n"); - if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F01 && PICS_SDK_CI_ONLY")) { + chipTool, " ***** Test Step 18 : Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + if (ShouldSkip("WNCV.S.A000a && WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_18(); + err = TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 3a: TH reads OperationalStatus attribute from DUT\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress( + chipTool, " ***** Test Step 19 : Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributeFromDut_19(); + err = TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_19(); break; case 20: ChipLogProgress(chipTool, " ***** Test Step 20 : Step 3a2: DUT updates its attributes\n"); @@ -107177,6 +111615,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { value.ms = 2000UL; return WaitForMs("alpha", value); } + NSNumber * _Nonnull OperationalStatusValue; CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit01_14() { @@ -107191,96 +111630,133 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + OperationalStatusValue = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_15() + CHIP_ERROR TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + id bitmap8Argument; + bitmap8Argument = [OperationalStatusValue copy]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits " + @"checks in upcoming OperationalStatus read steps. Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_16() + CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_17() + CHIP_ERROR TestStep3aThCheckOperationalStatusValueBit23Wncvsf00lf_17() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_18() + CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributeFromDut_19() + CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_19() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep3a2DutUpdatesItsAttributes_20() @@ -107649,55 +112125,57 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Step 3a: TH reads OperationalStatus attribute's bit 0..1\n"); - if (ShouldSkip("WNCV.S.A000a && PICS_SDK_CI_ONLY")) { + if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } err = TestStep3aThReadsOperationalStatusAttributesBit01_14(); break; case 15: - ChipLogProgress( - chipTool, " ***** Test Step 15 : Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))\n"); - if (ShouldSkip("WNCV.S.A000a && WNCV.S.F00 && PICS_SDK_CI_ONLY")) { + ChipLogProgress(chipTool, + " ***** Test Step 15 : Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in " + "upcoming OperationalStatus read steps.\n"); + if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_15(); + err = TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15(); break; case 16: ChipLogProgress( - chipTool, " ***** Test Step 16 : Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF))\n"); - if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F00 && PICS_SDK_CI_ONLY")) { + chipTool, " ***** Test Step 16 : Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + if (ShouldSkip("WNCV.S.A000a && WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_16(); + err = TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16(); break; case 17: ChipLogProgress( - chipTool, " ***** Test Step 17 : Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))\n"); - if (ShouldSkip("WNCV.S.A000a && WNCV.S.F01 && PICS_SDK_CI_ONLY")) { + chipTool, " ***** Test Step 17 : Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_17(); + err = TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_17(); break; case 18: ChipLogProgress( - chipTool, " ***** Test Step 18 : Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL))\n"); - if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F01 && PICS_SDK_CI_ONLY")) { + chipTool, " ***** Test Step 18 : Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + if (ShouldSkip("WNCV.S.A000a && WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_18(); + err = TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 3a: TH reads OperationalStatus attribute from DUT\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress( + chipTool, " ***** Test Step 19 : Step 3a: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributeFromDut_19(); + err = TestStep3aThChesksOperationalStatusValueBit45Wncvsf01tl_19(); break; case 20: ChipLogProgress(chipTool, " ***** Test Step 20 : Step 3a2: DUT updates its attributes\n"); @@ -108187,6 +112665,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { value.ms = 2000UL; return WaitForMs("alpha", value); } + NSNumber * _Nonnull OperationalStatusValue; CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit01_14() { @@ -108201,96 +112680,133 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + OperationalStatusValue = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_15() + CHIP_ERROR TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + id bitmap8Argument; + bitmap8Argument = [OperationalStatusValue copy]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits " + @"checks in upcoming OperationalStatus read steps. Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit23Wncvsf00lf_16() + CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_17() + CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_17() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit45Wncvsf01tl_18() + CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributeFromDut_19() + CHIP_ERROR TestStep3aThChesksOperationalStatusValueBit45Wncvsf01tl_19() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3a: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, OperationalStatusValue)); + } + + VerifyOrReturn(CheckConstraintType("bitmap8", "bitmap8", "bitmap8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep3a2DutUpdatesItsAttributes_20() @@ -176789,15 +181305,14 @@ 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(), @@ -176818,6 +181333,9 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -176876,12 +181394,15 @@ 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(),